Compare commits

...

2 Commits

Author SHA1 Message Date
Ginger 5fb3a04526 chore: Add comment and warning to unhappy path 2025-12-31 15:25:48 -05:00
Laurențiu Nicola 885776086a fix(admin): fix force-leaving rooms with no left_state PDU 2025-12-31 19:36:53 +00:00
+13 -1
View File
@@ -178,7 +178,19 @@ pub async fn leave_room(
.rooms
.state_cache
.left_state(user_id, room_id)
.await?
.await
.inspect_err(|err| {
// `left_state` may return an Err if the user _is_ in the room they're
// trying to leave, but the membership cache is incorrect and
// they're cached as being joined. In this situation
// we save a `None` to the `roomuserid_leftcount` table, which generates
// and sends a dummy leave to the client.
warn!(
"Trying to leave room not cached as leave, sending dummy leave \
event to client"
);
})
.unwrap_or_default()
},
}
};