Fix returning incorrect prev_batch token in incremental sync (#8486)

code_spécifique_watcha
Erik Johnston 4 years ago committed by GitHub
parent d373ec2f72
commit 9ca6341969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/8486.bugfix
  2. 7
      synapse/handlers/sync.py

@ -0,0 +1 @@
Fix incremental sync returning an incorrect `prev_batch` token in timeline section, which when used to paginate returned events that were included in the incremental sync. Broken since v0.16.0.

@ -460,8 +460,13 @@ class SyncHandler:
recents = []
if not limited or block_all_timeline:
prev_batch_token = now_token
if recents:
room_key = recents[0].internal_metadata.before
prev_batch_token = now_token.copy_and_replace("room_key", room_key)
return TimelineBatch(
events=recents, prev_batch=now_token, limited=False
events=recents, prev_batch=prev_batch_token, limited=False
)
filtering_factor = 2

Loading…
Cancel
Save