Repository navigation
fix(user_ldap): compare configuration prefixes numerically - #67407
Open
thakurcoderz wants to merge 1 commit into
Open
thakurcoderz wants to merge 1 commit into
thakurcoderz wants to merge 1 commit into
Conversation
With 100 or more LDAP configurations, sorting the prefixes as strings put s100 before s99, so the next prefix came out as an existing one and that configuration was reused. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: thakurcoderz <91749233+thakurcoderz@users.noreply.github.com>
thakurcoderz
requested review from
Altahrim and
cristianscheid
and removed request for
a team
December 2, 2026 07:05
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Helper::getNextServerConfigurationPrefix()sorted the existing prefixes as strings and took the last one. As strings,s100comes befores99, so once there are 100 or more LDAP configurations the "next" prefix comes out ass100again. Creating a new configuration then reuses the existing one and adds its prefix toconfiguration_prefixesa second time.The prefixes are now compared by their number (
max()over the numeric parts), sos01, s99, s100givess101. The empty legacy prefix still counts as 0.One side effect: the old code also saved the prefix list back in that string-sorted order. It's now saved in its existing order with the new prefix appended. Nothing reads it in a particular order, and the old order wasn't numeric anyway.
Added a unit test with
s01, s99, s100. It fails on master (returnss100) and passes with the change. I haven't reproduced it on a live instance with 100 LDAP configurations; the unit test covers the case directly.TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)
This description was written with Claude Code (claude-opus-5-5). Claude Code also helped with the code; I chose the approach and the test values, and reviewed and tested the change locally.
Assisted by ClaudeCode:claude-opus-5-5