summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2024-04-10 11:19:31 +0100
committerErik Johnston <erik@matrix.org>2024-04-10 11:19:31 +0100
commitb1c1f6d29a5e4665d1ddc4f40ade22d6ab546000 (patch)
tree52907b473fdf639080491f0debba9ae9b162bdcf /synapse/handlers
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentStabilize support for MSC4010: push rules & account data. (#17022) (diff)
downloadsynapse-b1c1f6d29a5e4665d1ddc4f40ade22d6ab546000.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/room.py1
-rw-r--r--synapse/handlers/sync.py20
2 files changed, 14 insertions, 7 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py

index ffda0f64e0..6ad6a90054 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py
@@ -958,6 +958,7 @@ class RoomCreationHandler: room_alias=room_alias, power_level_content_override=power_level_content_override, creator_join_profile=creator_join_profile, + ignore_forced_encryption=ignore_forced_encryption, ) # we avoid dropping the lock between invites, as otherwise joins can diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 410805e806..a6d54ee4b8 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py
@@ -1266,17 +1266,23 @@ class SyncHandler: # # c.f. #16941 for an example of why we can't do this for all non-gappy # syncs. - is_linear_timeline = False + is_linear_timeline = True if batch.events: - prev_event_id = batch.events[0].event_id - for e in batch.events[1:]: + # 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( + room_id, + end_token=since_token.room_key, + ) + ) + + prev_event_id = last_event_id_prev_batch + for e in batch.events: if e.prev_event_ids() != [prev_event_id]: + is_linear_timeline = False break prev_event_id = e.event_id - else: - is_linear_timeline = True - else: - is_linear_timeline = True if is_linear_timeline and not batch.limited: state_ids: StateMap[str] = {}