fix: LDAP users not merging by email during sync - #41279
Conversation
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: a54d252 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe MongoDB query field used in ChangesLDAP email lookup fix
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #41279 +/- ##
===========================================
- Coverage 69.52% 69.44% -0.08%
===========================================
Files 3663 3663
Lines 145125 145125
Branches 25726 25746 +20
===========================================
- Hits 100896 100786 -110
- Misses 39945 40046 +101
- Partials 4284 4293 +9
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
During LDAP sync, when an existing (non-LDAP) Rocket.Chat user has the same email as a directory entry but a different username, the sync should merge them. It wasn't: the email fallback used during sync never matched, so the sync treated the entry as new and attempted an insert, colliding on the unique username and failing with
Username already exists. [403].This corrects the email lookup so the existing user is found and merged instead of duplicated.
Issue(s)
Closes: CORE-1285
Steps to test or reproduce
LDAP_Merge_Existing_Usersand run Sync Now.Username already existserror, no duplicate account).Further comments
CORE-1285