diff --git a/src/api/client_server/membership.rs b/src/api/client_server/membership.rs index 244ea489..f31bc026 100644 --- a/src/api/client_server/membership.rs +++ b/src/api/client_server/membership.rs @@ -1597,6 +1597,8 @@ async fn remote_leave_room(user_id: &UserId, room_id: &RoomId) -> Result<()> { HashSet::from_iter, ); + debug!("servers in remote_leave_room: {servers:?}"); + for remote_server in servers { let make_leave_response = services() .sending diff --git a/src/database/key_value/rooms/state_cache.rs b/src/database/key_value/rooms/state_cache.rs index badf2875..99fcfe85 100644 --- a/src/database/key_value/rooms/state_cache.rs +++ b/src/database/key_value/rooms/state_cache.rs @@ -6,6 +6,7 @@ use ruma::{ serde::Raw, OwnedRoomId, OwnedServerName, OwnedUserId, RoomId, ServerName, UserId, }; +use tracing::error; use crate::{ database::KeyValueDatabase, @@ -589,13 +590,16 @@ impl service::rooms::state_cache::Data for KeyValueDatabase { #[tracing::instrument(skip(self))] fn servers_invite_via(&self, room_id: &RoomId) -> Result>> { - let room_id = room_id.as_bytes().to_vec(); + let mut key = room_id.as_bytes().to_vec(); + key.push(0xFF); self.roomid_inviteviaservers - .get(&room_id)? + .get(&key)? .map(|servers| { - let state = serde_json::from_slice(&servers) - .map_err(|_| Error::bad_database("Invalid state in userroomid_leftstate."))?; + let state = serde_json::from_slice(&servers).map_err(|e| { + error!("Invalid state in userroomid_leftstate: {e}"); + Error::bad_database("Invalid state in userroomid_leftstate.") + })?; Ok(state) })