MSC3575: allow empty conn_id

This commit is contained in:
Lambda 2025-08-10 18:53:10 +00:00
parent 64ad940bad
commit ede39370a4
2 changed files with 13 additions and 23 deletions

View file

@ -83,9 +83,7 @@ pub(crate) async fn sync_events_v4_route(
};
if globalsince == 0 {
if body.conn_id.is_some() {
services().users.forget_sync_request_connection(&connection_key);
}
services().users.forget_sync_request_connection(&connection_key);
}
let known_rooms =
@ -377,14 +375,12 @@ pub(crate) async fn sync_events_v4_route(
},
);
if body.conn_id.is_some() {
services().users.update_sync_known_rooms(
connection_key.clone(),
list_id,
new_known_rooms,
globalsince,
);
}
services().users.update_sync_known_rooms(
connection_key.clone(),
list_id,
new_known_rooms,
globalsince,
);
}
let mut known_subscription_rooms = BTreeSet::new();
@ -405,14 +401,12 @@ pub(crate) async fn sync_events_v4_route(
known_subscription_rooms.remove(&r);
}
if body.conn_id.is_some() {
services().users.update_sync_known_rooms(
connection_key.clone(),
"subscriptions".to_owned(),
known_subscription_rooms,
globalsince,
);
}
services().users.update_sync_known_rooms(
connection_key.clone(),
"subscriptions".to_owned(),
known_subscription_rooms,
globalsince,
);
let mut rooms = BTreeMap::new();
for (

View file

@ -70,10 +70,6 @@ impl Service {
&self,
connection_key: ConnectionKey,
) -> BTreeMap<String, BTreeMap<OwnedRoomId, u64>> {
if connection_key.connection.is_none() {
return BTreeMap::new();
};
let cached = self.get_cache_entry(connection_key);
let cached = cached.lock().unwrap();