Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"You invited %1$@" still shows a matrix id #2846

Closed
Tracked by #2395
manuroe opened this issue May 17, 2024 · 3 comments · Fixed by #2910
Closed
Tracked by #2395

"You invited %1$@" still shows a matrix id #2846

manuroe opened this issue May 17, 2024 · 3 comments · Fixed by #2910
Assignees
Labels

Comments

@manuroe
Copy link
Member

manuroe commented May 17, 2024

Steps to reproduce

This is a bug found by Hans while testing element-hq/element-meta#2395.

  1. Open DM you started
  2. Expand the room changes
  3. The app displays ""You invited @bob:matrix.org" instead of Bob

image

Outcome

What did you expect?

A display name instead of a matrix id like on EW:

image

The invite event has a displayname field:

{
  "content": {
    "displayname": "testiosr123",
    "is_direct": true,
    "membership": "invite"
  },
  "origin_server_ts": 1663321374100,
  "sender": "@Manu:matrix.org",
  "state_key": "@testiosr123:matrix.org",
  "type": "m.room.member",
  "unsigned": {
    "age": 52463967527
  },
  "event_id": "$ryCuR93bduTjs-u5CPZQPNPnZZK_AQtp2_4Ys2SUXxk",
  "room_id": "!hQMQdhNMYBzbNfRaKh:matrix.org"
}
@manuroe
Copy link
Member Author

manuroe commented Jun 7, 2024

It is fixed on EXA but not on EXI. See internal discussions.

Probably related, we display a user id in "state_event_room_invite" = "%1$@ invited %2$@" for %2$@ and in "state_event_room_invite_accepted" = "%1$@ accepted the invite". EXA is fine on those strings too.

@Velin92
Copy link
Contributor

Velin92 commented Jun 11, 2024

It is fixed on EXA but not on EXI. See internal discussions.

Probably related, we display a user id in "state_event_room_invite" = "%1$@ invited %2$@" for %2$@ and in "state_event_room_invite_accepted" = "%1$@ accepted the invite". EXA is fine on those strings too.

By checking the code I see that all our membership change events in the codebase were using the user ID instead of the display name, this is because EX-iOS was not suing the displayName coming from the Rust side that is attached to a roomMembershipChange event (to which the attached display name was recently added)
I imagine we want for all the state events to use the display name of the member subject to the member ship change is that correct? (Ofc the value that comes from the SDK is optional, so not all the state events will be managed with the display names, the ones that the SDK can't provide will still be using the userID)

@manuroe
Copy link
Member Author

manuroe commented Jun 11, 2024

This is most of the time exact, @Velin92 . We want to avoid to display matrix ids most of the time. So, we should try to use the display name first. If not available, we default on the matrix id.

However, we want to display matrix ids when the user changes their display name or avatar and when there are banned as the display name can contain explicit content.
The whole list is in the parent issue: element-hq/element-meta#2395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants