Base: Look up display name ambiguity under the name a member is shown with - #7010
Open
SamuraiF0x wants to merge 2 commits into
Open
SamuraiF0x wants to merge 2 commits into
SamuraiF0x wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7010 +/- ##
==========================================
+ Coverage 90.26% 90.27% +0.01%
==========================================
Files 408 408
Lines 117566 117612 +46
Branches 117566 117612 +46
==========================================
+ Hits 106121 106175 +54
+ Misses 7491 7483 -8
Partials 3954 3954 ☔ View full report in Codecov by Harness. |
…shown with The ambiguity index is keyed by the name a member set themselves, and `RoomMember::name` renders that same name: the member's own profile first, then the latest member event, then the localpart. The lookup that sets `RoomMember::name_ambiguous` used the latest member event's name instead. The two differ for a kicked member: the kick event carries no display name, but the profile writer keeps the member's own profile, so they are still shown under their old name while the lookup asked about their localpart and always came back unambiguous. With three members sharing a name and one of them kicked, the kicked member's messages rendered under the shared name with no disambiguation while the other two were disambiguated. Resolve the name once, shared with `RoomMember::display_name` so the two cannot drift, and use it for the lookup in `members`, `get_member` and `from_parts`. Signed-off-by: Šimun Kordiš <kordis.simun@gmail.com>
Signed-off-by: Šimun Kordiš <kordis.simun@gmail.com>
SamuraiF0x
force-pushed
the
base/ambiguity-rendered-name
branch
from
September 9, 2026 08:34
5a1a632 to
ed0ae9c
Compare
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.
The ambiguity index is keyed by the name a member set themselves, which is also what
RoomMember::namerenders: own profile, then the latest member event, then the localpart. But the lookup behindRoomMember::name_ambiguousused the latest member event's name. The two differ for a kicked member: the kick event carries no display name, and the profile writer deliberately keeps the member's own profile, so the member is still shown under their old name while the lookup asked about their localpart and always came back unambiguous.Concretely, with three members sharing a display name and one of them kicked, the kicked member's messages render under the shared name without disambiguation while the two remaining members are disambiguated.
The fix resolves the name once, through a helper that
RoomMember::display_namenow shares so the two cannot drift, and uses it for the lookup inmembers,get_memberandfrom_parts. No public API changes. The new test drives the scenario through sync and the real profile writer; it fails onname_ambiguous()without the fix.This touches the same lines as #7004, whichever merges second rebases trivially.
Signed-off-by: Šimun Kordiš kordis.simun@gmail.com