summary refs log tree commit diff
path: root/synapse/rest/client/sync.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-10-08 11:17:23 +0100
committerGitHub <noreply@github.com>2024-10-08 11:17:23 +0100
commit422f3ecec1ffb4fa352f83d7ec8b3327f36a93c8 (patch)
tree2d80d58aa94f719056b77909a02e239668ef1727 /synapse/rest/client/sync.py
parentSliding sync minor performance speed up using new table (#17787) (diff)
downloadsynapse-422f3ecec1ffb4fa352f83d7ec8b3327f36a93c8.tar.xz
Sliding sync: omit bump stamp when it is unchanged (#17788)
This saves some DB lookups in rooms
Diffstat (limited to 'synapse/rest/client/sync.py')
-rw-r--r--synapse/rest/client/sync.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/rest/client/sync.py b/synapse/rest/client/sync.py

index 364cf40153..122708e933 100644 --- a/synapse/rest/client/sync.py +++ b/synapse/rest/client/sync.py
@@ -1010,11 +1010,13 @@ class SlidingSyncRestServlet(RestServlet): serialized_rooms: Dict[str, JsonDict] = {} for room_id, room_result in rooms.items(): serialized_rooms[room_id] = { - "bump_stamp": room_result.bump_stamp, "notification_count": room_result.notification_count, "highlight_count": room_result.highlight_count, } + if room_result.bump_stamp is not None: + serialized_rooms[room_id]["bump_stamp"] = room_result.bump_stamp + if room_result.joined_count is not None: serialized_rooms[room_id]["joined_count"] = room_result.joined_count