Skip to content

Commit

Permalink
Fixups to #17064 (#17065)
Browse files Browse the repository at this point in the history
Forget a line, and an empty batch is trivially linear.

c.f. #17064
  • Loading branch information
erikjohnston authored Apr 8, 2024
1 parent 1f8f991 commit 4d10a8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/17065.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix various long-standing bugs which could cause incorrect state to be returned from `/sync` in certain situations.
3 changes: 3 additions & 0 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,8 +1272,11 @@ async def _compute_state_delta_for_incremental_sync(
for e in batch.events[1:]:
if e.prev_event_ids() != [prev_event_id]:
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] = {}
Expand Down

0 comments on commit 4d10a8f

Please sign in to comment.