Open manuroe opened 2 months ago
@amshakal perfect, thanks!
@stefanceriu I have added a status for each string in https://github.com/element-hq/element-x-android/issues/2722.
@stefanceriu I have added a status for each string in element-hq/element-x-android#2722.
Nice, thank you!
Some roomMembershipChange events coming from the SDK do not return a displayName (it returns as nil) even if the JSON content of the event contains it.
For example:
left
and invitationRevoked
{
"content": {
"membership": "leave",
"avatar_url": "mxc://matrix.org/kSmRgrCcHHWtCKGogsSvgInx",
"displayname": "Maurotest"
},
"origin_server_ts": 1718008452870,
"sender": "@mauro.romito:element.io",
"state_key": "@mauro.devtest:matrix.org",
"type": "m.room.member",
"unsigned": {
"replaces_state": "$LzTHluued3LYQ4lywtkEyuwHtu_BwtMxcsaoX_v172g",
"prev_content": {
"avatar_url": "mxc://matrix.org/kSmRgrCcHHWtCKGogsSvgInx",
"displayname": "Maurotest",
"membership": "invite"
},
"prev_sender": "@mauro.romito:element.io",
"io.element.msc4115.membership": "join",
"age": 788561190
},
"event_id": "$Odx3v2ptnnXwjQsv4cmCLWGRX5C8YgsUWHSkcwq8iE0",
"room_id": "!oQYgXvyPkZTyuOUzIl:element.io"
}
{
"content": {
"membership": "leave",
"avatar_url": "mxc://matrix.org/kSmRgrCcHHWtCKGogsSvgInx",
"displayname": "Maurotest"
},
"origin_server_ts": 1718797062145,
"sender": "@mauro.devtest:matrix.org",
"state_key": "@mauro.devtest:matrix.org",
"type": "m.room.member",
"unsigned": {
"replaces_state": "$Iiwx4HkzLthOJv0MDH-TYGSSwZmeGL-A5If5Y6uxInU",
"prev_content": {
"avatar_url": "mxc://matrix.org/kSmRgrCcHHWtCKGogsSvgInx",
"displayname": "Maurotest",
"membership": "join"
},
"prev_sender": "@mauro.devtest:matrix.org",
"io.element.msc4115.membership": "join"
},
"event_id": "$NdzYrgemVv3tbCswdNru7-x4iO3s6w6TrtIDGMOWGig",
"room_id": "!oQYgXvyPkZTyuOUzIl:element.io"
}
The issue is that these two events are technically replacements of existing events, and we for now only fetch display name from the original content. However I see the original content is also present for these two so is unclear to why the original content is skipped i'll do some more digging
Okay by debugging the SDK, and adding a some info!
traces at this point in the code: https://github.com/matrix-org/matrix-rust-sdk/blob/a6c962b9b0c6a713028522b92f3a95d0cad97dbd/bindings/matrix-sdk-ffi/src/timeline/content.rs#L53-L64
I extracted the following logs for the models coming from the SDK.
matrix_sdk_ffi::timeline::content: membership: RoomMembershipChange { user_id: "@mauro.devtest:matrix.org", content: Original { content: RoomMemberEventContent { avatar_url: None, displayname: None, is_direct: None, membership: "leave", third_party_invite: None, blurhash: None, reason: None, join_authorized_via_users_server: None }, prev_content: Some(RoomMemberEventContent { avatar_url: Some("mxc://matrix.org/kSmRgrCcHHWtCKGogsSvgInx"), displayname: Some("Maurotest"), is_direct: None, membership: "join", third_party_invite: None, blurhash: None, reason: None, join_authorized_via_users_server: None }) }, change: Some(Left) }, displayname: None |
So for some reason the content is not containing the avatar and the display name even if its present in the JSON. This is the log of the leave
event.
This is the invitation revoked one:
matrix_sdk_ffi::timeline::content: membership: RoomMembershipChange { user_id: "@mauro.devtest:matrix.org", content: Original { content: RoomMemberEventContent { avatar_url: None, displayname: None, is_direct: None, membership: "leave", third_party_invite: None, blurhash: None, reason: None, join_authorized_via_users_server: None }, prev_content: Some(RoomMemberEventContent { avatar_url: Some("mxc://matrix.org/kSmRgrCcHHWtCKGogsSvgInx"), displayname: Some("Maurotest"), is_direct: None, membership: "invite", third_party_invite: None, blurhash: None, reason: None, join_authorized_via_users_server: None }) }, change: Some(InvitationRevoked) }, displayname: None |
I see that the displayname is not nil in the previous content, which makes sense, but the original content given the JSON also contains the event so its unclear why is not getting set in the model for the SDK
I wonder if this is a Ruma bug, because the model RoomMemberEventContent
is coming directly from Ruma
Description
Second task:
@amshakal can you provide a design for sender display name disambiguation on mobile? (or point me to where the design does exist?) Thanks!
Acceptance criteria
Display names must be disambiguated with the matrix id when necessary.
Following strings are based on the EXI code in an attempt to be as exhaustive as possible. Thanks to common strings, it should apply to Android too.
The app must display user name for
%1$@
in:%1$@
and%2$@
must be user names in:%1$@
must be a matrix id in:%1$@
must be a user name and%2$@
must be a matrix id in:Other cases we do not need to check or change as part of this stoyr:
Leads
Size estimate
None
Dependencies
Out of scope
Open questions
Subtasks
Sign-off
Android
iOS