fix(sync): Omit empty room account data from sliding sync responses

This commit is contained in:
Erwan Leboucher authored and Ellis Git committed 2026-09-13 18:50:26 +00:00
1 parent 5117b104af
commit 9bb203abe8
2 files changed
+15 -8

No files matched your search

+1
View File
@@ -0,0 +1 @@
Sliding sync responses no longer include an empty room account data entry for every room in a list's range. Contributed by @eleboucher.
+14 -8
View File
@@ -855,15 +855,21 @@ where
};
if body.extensions.account_data.enabled == Some(true) {
response.extensions.account_data.rooms.insert(
room_id.to_owned(),
services
let room_account_data: Vec<_> = services
.account_data
.changes_since(Some(room_id), sender_user, Some(*roomsince), Some(next_batch))
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
.collect()
.await;
// An empty entry makes clients treat the room as updated.
if !room_account_data.is_empty() {
response
.extensions
.account_data
.changes_since(Some(room_id), sender_user, Some(*roomsince), Some(next_batch))
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
.collect()
.await,
);
.rooms
.insert(room_id.to_owned(), room_account_data);
}
}
let last_privateread_update = services