chore: Add comment and warning to unhappy path
This commit is contained in:
parent
a10bd71945
commit
88c84f221f
1 changed files with 11 additions and 0 deletions
|
|
@ -179,6 +179,17 @@ pub async fn leave_room(
|
|||
.state_cache
|
||||
.left_state(user_id, room_id)
|
||||
.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()
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue