Implement specified non-blocking semantic for sliding-sync.

Simplify sliding-sync watch loop and bounds.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-10-22 20:53:04 +00:00
parent 4010fc62bc
commit 0397bb8237
5 changed files with 42 additions and 35 deletions

View File

@@ -174,7 +174,6 @@ async fn match_lists_for_room(
services
.user
.last_notification_read(sender_user, &room_id)
.map(|count| count.min(conn.next_batch))
})
.into();
@@ -183,23 +182,19 @@ async fn match_lists_for_room(
services
.read_receipt
.last_privateread_update(sender_user, &room_id)
.map(|count| count.min(conn.next_batch))
})
.into();
let last_receipt: OptionFuture<_> = matched
.and_is(false) // masked out, maybe unnecessary
.then(|| {
services
.read_receipt
.last_receipt_count(&room_id, sender_user.into(), None)
.unwrap_or_default()
.map(|count| count.min(conn.next_batch))
})
.into();
let last_account: OptionFuture<_> = matched
.and_is(false) // masked out, maybe unnecessary
.then(|| {
services
.account_data
@@ -236,6 +231,7 @@ async fn match_lists_for_room(
]
.into_iter()
.map(Option::unwrap_or_default)
.filter(|count| conn.next_batch.ge(count))
.max()
.unwrap_or_default(),
})