Provide sync watch rooms as argument rather than assuming all joined rooms.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk committed 2025-10-08 03:33:12 +00:00
1 parent 6c724bbc2f
commit a6127fcd1a
3 files changed
+25 -12

No files matched your search

+6 -2
View File
@@ -160,10 +160,14 @@ pub(crate) async fn sync_events_v5_route(
};
loop {
let watchers = services.sync.watch(sender_user, sender_device);
let next_batch = services.globals.wait_pending().await?;
let watch_rooms = todo_rooms.keys().map(AsRef::as_ref).stream();
let watchers = services
.sync
.watch(sender_user, sender_device, watch_rooms);
let next_batch = services.globals.wait_pending().await?;
debug_assert!(globalsince <= next_batch, "next_batch is monotonic");
if globalsince < next_batch {
let rooms = handle_rooms(services, sync_info, next_batch, &todo_rooms)
.map_ok(|rooms| response.rooms = rooms);