Closed frebib closed 2 months ago
I just remembered that EleX shows the Rust model for the state event:
EventTimelineItem {
sender: "@frebib:spritsail.io",
sender_profile: Ready(
Profile {
display_name: Some(
"frebib ⚡\u{fe0f}",
),
display_name_ambiguous: false,
avatar_url: Some(
"mxc://spritsail.io/CT5Q8KSagUCI32Sk8P98fN64WoOZjPke",
),
},
),
reactions: ReactionsByKeyBySender(
{},
),
timestamp: 2024-09-05T21:43:14.185,
content: MembershipChange(
RoomMembershipChange {
user_id: "@frebib:spritsail.io",
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: None, 👈🏼
},
change: Some(
None,
),
},
),
kind: Remote(
RemoteEventTimelineItem {
event_id: "$h1cZB-4x0TiNSK7kdYqUN0aGO5S8AfekbyWQvgbjtR0",
transaction_id: None,
read_receipts: {},
is_own: true,
is_highlighted: false,
encryption_info: None,
origin: Pagination,
..
},
),
is_room_encrypted: Some(
true,
),
}
With prev_content being None, we're hitting this codepath here then here which explains the "made no changes" message. The question is why there is no prev_content
Is this a sync issue? Is prev_content
missing from unsigned
in sync? https://github.com/matrix-org/matrix-rust-sdk/blob/1eecb2d603edfae43b842010ac13d021411d0332/crates/matrix-sdk-ui/src/timeline/event_handler.rs#L179
This a conduwuit server (latest version, whatever that is) using the native sliding sync implementation.
After discussing in the conduwuit room, it seems this might be a server-side bug causing prev_events to be missing -> https://matrix.to/#/!n8DKU1BeeJilOJXDPr:seirdy.one/$xlbC1d33vb3gvhJ4Hickk6vCv-OIQ5oL-ge63d-g1LA?via=awawawawawawawawawawawawawawawawawawawawawawawawawawawawawawaw.gay&via=transfem.dev&via=matrix.org
I experienced this using Element X (Android) although tracing through the code it looks like the logic for the MembershipChange event lies either here in rust-sdk https://github.com/matrix-org/matrix-rust-sdk/blob/1eecb2d603edfae43b842010ac13d021411d0332/crates/matrix-sdk-ui/src/timeline/event_item/content/mod.rs#L300, or somewhere here in Ruma: https://github.com/matrix-org/ruma/blob/9d8c9c477f15c07b0f2fe4ff4a01aa2ea36eae66/crates/ruma-common/src/events/room/member/change.rs#L125
To reproduce:
If it's helpful, these are the two state events in the room that shows this on my device