fix: Adjust sync watcher logic to be more explicit

This commit is contained in:
Ginger authored and Ellis Git committed 2026-07-05 00:42:44 +00:00
1 parent 3adeee04d7
commit 3467dffd94
22 files changed
+189 -249

No files matched your search

+1 -4
View File
@@ -80,9 +80,6 @@ pub(crate) async fn sync_events_v5_route(
let mut body = body.body;
// Setup watchers, so if there's no response, we can wait for them
let watcher = services.sync.watch(sender_user, sender_device);
let next_batch = services.globals.next_count()?;
let conn_id = body.conn_id.clone();
@@ -220,7 +217,7 @@ pub(crate) async fn sync_events_v5_route(
// Stop hanging if new info arrives
let default = Duration::from_secs(30);
let duration = cmp::min(body.timeout.unwrap_or(default), default);
_ = tokio::time::timeout(duration, watcher).await;
_ = tokio::time::timeout(duration, services.sync.wait_for_wake(sender_user)).await;
}
let typing = collect_typing_events(services, sender_user, &body, &todo_rooms).await?;