Skip to content
Snippets Groups Projects
Commit 3edd2d5c authored by Mark Haines's avatar Mark Haines
Browse files

Fix v2 sync, update the last_notified_ms only if there was an active listener

parent 5e0c5336
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ class SyncHandler(BaseHandler):
result = yield self.current_sync_for_user(sync_config, since_token)
defer.returnValue(result)
else:
def current_sync_callback():
def current_sync_callback(before_token, after_token):
return self.current_sync_for_user(sync_config, since_token)
rm_handler = self.hs.get_handlers().room_member_handler
......
......@@ -81,14 +81,15 @@ class _NotifierUserStream(object):
self.last_notified_ms = time_now_ms
def notify(self, stream_key, stream_id, time_now_ms):
self.last_notified_ms = time_now_ms
self.current_token = self.current_token.copy_and_replace(
stream_key, stream_id
)
listeners = self.listeners
self.listeners = set()
for listener in listeners:
listener.notify(self.current_token)
if self.listeners:
self.last_notified_ms = time_now_ms
listeners = self.listeners
self.listeners = set()
for listener in listeners:
listener.notify(self.current_token)
def remove(self, notifier):
""" Remove this listener from all the indexes in the Notifier
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment