0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-05-17 11:03:46 +02:00
Forget a line, and an empty batch is trivially linear.

c.f. #17064
This commit is contained in:
Erik Johnston 2024-04-08 14:55:19 +01:00 committed by GitHub
parent 1f8f991d51
commit 4d10a8fb18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

1
changelog.d/17065.bugfix Normal file
View file

@ -0,0 +1 @@
Fix various long-standing bugs which could cause incorrect state to be returned from `/sync` in certain situations.

View file

@ -1272,8 +1272,11 @@ class SyncHandler:
for e in batch.events[1:]: for e in batch.events[1:]:
if e.prev_event_ids() != [prev_event_id]: if e.prev_event_ids() != [prev_event_id]:
break break
prev_event_id = e.event_id
else: else:
is_linear_timeline = True is_linear_timeline = True
else:
is_linear_timeline = True
if is_linear_timeline and not batch.limited: if is_linear_timeline and not batch.limited:
state_ids: StateMap[str] = {} state_ids: StateMap[str] = {}