Skip to content

bridgev2/portal: fix stale ghost displayname in member events - #535

Open
Fizzadar wants to merge 1 commit into
mainfrom
nick/member-event-name-drift
Open

bridgev2/portal: fix stale ghost displayname in member events#535
Fizzadar wants to merge 1 commit into
mainfrom
nick/member-event-name-drift

Conversation

@Fizzadar

Copy link
Copy Markdown
Member

A room member event whose displayname has drifted from the ghost profile is never repaired: the membership value is unchanged so no member event is sent, and when one is sent it copies the stale cached displayname straight back.

Sync joined ghosts whose name differs from the room's current member state, take the displayname and avatar from the ghost when rewriting an existing member event, and skip the invite downgrade for members who are already joined.

A room member event whose displayname has drifted from the ghost profile is
never repaired: the membership value is unchanged so no member event is sent,
and when one is sent it copies the stale cached displayname straight back.

Sync joined ghosts whose name differs from the room's current member state,
take the displayname and avatar from the ghost when rewriting an existing
member event, and skip the invite downgrade for members who are already joined.
Comment thread bridgev2/portal.go
if ghost != nil && ok {
content.Displayname = ghost.Name
if ghost.AvatarMXC != "" {
content.AvatarURL = ghost.AvatarMXC

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also be checking avatar? This function is already pretty complicated..

Perhaps there's a nicer way to do this and separate membership sync from profile.

@tulir

tulir commented Jul 29, 2026

Copy link
Copy Markdown
Member

Member events should never drift 🤔

@Fizzadar

Copy link
Copy Markdown
Member Author

Member events should never drift 🤔

I think the problem is specific to gmessages - the ghost names fallback to phone number if not found and then later we get the name. Though now I type that I think that should trigger a profile update anyway which the HS would then propagate to the rooms.

In which case maybe it's a nameSet=true comparison issue or something...

@highesttt

Copy link
Copy Markdown
Contributor

I also have a similar problem with the snapchat bridge and this seems very similar to my patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants