diff options
author | Eric Eastwood <eric.eastwood@beta.gouv.fr> | 2024-06-17 11:27:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-17 11:27:14 -0500 |
commit | e5b8a3e37f10168953124282c296821b9d9d81ad (patch) | |
tree | 0f3bea2d5067d6a5bd5be08c23fb5ad159a09577 /synapse/handlers/sync.py | |
parent | Merge branch 'release-v1.109' into develop (diff) | |
download | synapse-e5b8a3e37f10168953124282c296821b9d9d81ad.tar.xz |
Add `stream_ordering` sort to Sliding Sync `/sync` (#17293)
Sort is no longer configurable and we always sort rooms by the `stream_ordering` of the last event in the room or the point where the user can see up to in cases of leave/ban/invite/knock.
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r-- | synapse/handlers/sync.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index f1c69d9893..0a40d62c6a 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -1036,9 +1036,11 @@ class SyncHandler: # FIXME: This gets the state at the latest event before the stream ordering, # which might not be the same as the "current state" of the room at the time # of the stream token if there were multiple forward extremities at the time. - last_event_id = await self.store.get_last_event_in_room_before_stream_ordering( - room_id, - end_token=stream_position.room_key, + last_event_id = ( + await self.store.get_last_event_id_in_room_before_stream_ordering( + room_id, + end_token=stream_position.room_key, + ) ) if last_event_id: @@ -1519,7 +1521,7 @@ class SyncHandler: # We need to make sure the first event in our batch points to the # last event in the previous batch. last_event_id_prev_batch = ( - await self.store.get_last_event_in_room_before_stream_ordering( + await self.store.get_last_event_id_in_room_before_stream_ordering( room_id, end_token=since_token.room_key, ) |