Fix sequence windowing for sync v3 invite/leave/knock rooms.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-25 12:03:40 +00:00
parent 22ef704ac6
commit 0d439188e8

View File

@@ -246,7 +246,7 @@ pub(crate) async fn build_sync_events(
.ok(); .ok();
// Invited before last sync // Invited before last sync
if Some(since) >= invite_count { if Some(since) >= invite_count || Some(next_batch) < invite_count {
return invited_rooms; return invited_rooms;
} }
@@ -270,8 +270,8 @@ pub(crate) async fn build_sync_events(
.await .await
.ok(); .ok();
// Knocked before last sync // Knocked before last sync; or after the cutoff for this sync
if Some(since) >= knock_count { if Some(since) >= knock_count || Some(next_batch) < knock_count {
return knocked_rooms; return knocked_rooms;
} }
@@ -439,8 +439,8 @@ async fn handle_left_room(
.await .await
.ok(); .ok();
// Left before last sync // Left before last sync or after cutoff for next sync
if Some(since) >= left_count { if Some(since) >= left_count || Some(next_batch) < left_count {
return Ok(None); return Ok(None);
} }