Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
915280f1
Commit
915280f1
authored
5 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fixup comment
parent
8d452e0c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/presence.py
+13
-6
13 additions, 6 deletions
synapse/handlers/presence.py
with
13 additions
and
6 deletions
synapse/handlers/presence.py
+
13
−
6
View file @
915280f1
...
...
@@ -1021,12 +1021,19 @@ class PresenceEventSource(object):
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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment