Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fixup comment
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jul 1, 2019
1 parent 8d452e0 commit 915280f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,12 +1021,19 @@ def get_new_events(
if from_key == max_token:
# This is necessary as due to the way stream ID generators work
# we may get updates that have a stream ID greater than the max
# token. This is usually fine, as it just means that we may send
# down some presence updates multiple times. However, we need to
# be careful that the sync stream actually does make some
# progress, otherwise clients will end up tight looping calling
# /sync due to it returning the same token repeatedly. Hence
# this guard. C.f. #5503.
# token (e.g. max_token is N but stream generator may return
# results for N+2, due to N+1 not having finished being
# persisted yet).
#
# This is usually fine, as it just means that we may send down
# some presence updates multiple times. However, we need to be
# careful that the sync stream either actually does make some
# progress or doesn't return, otherwise clients will end up
# tight looping calling /sync due to it immediately returning
# the same token repeatedly.
#
# Hence this guard where we just return nothing so that the sync
# doesn't return. C.f. #5503.
defer.returnValue(([], max_token))

presence = self.get_presence_handler()
Expand Down

0 comments on commit 915280f

Please sign in to comment.