mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 16:25:55 +03:00
[PR #1319] [MERGED] Extract compute_user_attribute_changes from update_user_with_transaction #1256
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#1256
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/lldap/lldap/pull/1319
Author: @Copilot
Created: 10/9/2025
Status: ✅ Merged
Merged: 10/10/2025
Merged by: @nitnelave
Base:
main← Head:copilot/refactor-update-user-transaction📝 Commits (3)
a99374dInitial plane5bb0b7Extract compute_user_attribute_changes function from update_user_with_transactionedb83b7Pass attributes by value to avoid unnecessary clones📊 Changes
1 file changed (+40 additions, -23 deletions)
View changed files
📝
crates/sql-backend-handler/src/sql_user_backend_handler.rs(+40 -23)📄 Description
update_user_with_transactionfunction to understand the code to extractupdate_user_with_transactionto use the new helper functionSummary
Successfully extracted the attribute computation logic from
update_user_with_transactioninto a new helper function calledcompute_user_attribute_changes.Changes Made:
Created
compute_user_attribute_changesfunction that:user_id,insert_attributes,delete_attributes, andschemaas parameters(update_user_attributes, remove_user_attributes)Refactored
update_user_with_transactionto:insert_attributesanddelete_attributesfrom the request and pass them to the helperTesting:
All 61 tests in the
lldap_sql_backend_handlercrate pass, including:test_update_user_all_valuestest_update_user_some_valuestest_update_user_insert_attributetest_update_user_delete_attributetest_update_user_replace_attributetest_update_user_delete_avatarThe refactoring maintains complete backward compatibility and functionality while improving performance by avoiding unnecessary clones.
Original prompt
Fixes lldap/lldap#1318
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.