summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-02-09 15:20:56 +0000
committerKegan Dougal <kegan@matrix.org>2015-02-09 15:20:56 +0000
commit53557fc53259631d71055ef2ab8a6916b00d229b (patch)
tree208db19fb5bbcc5416e669bc496adc49acdcb1a7 /synapse/handlers/sync.py
parentFix bugs so lazy room joining works as intended. (diff)
parentMerge pull request #55 from matrix-org/profiling (diff)
downloadsynapse-53557fc53259631d71055ef2ab8a6916b00d229b.tar.xz
Merge branch 'develop' into application-services
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 962686f4bb..439164ae39 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -298,15 +298,17 @@ class SyncHandler(BaseHandler):
         load_limit = max(sync_config.limit * filtering_factor, 100)
         max_repeat = 3  # Only try a few times per room, otherwise
         room_key = now_token.room_key
+        end_key = room_key
 
         while limited and len(recents) < sync_config.limit and max_repeat:
             events, keys = yield self.store.get_recent_events_for_room(
                 room_id,
                 limit=load_limit + 1,
                 from_token=since_token.room_key if since_token else None,
-                end_token=room_key,
+                end_token=end_key,
             )
             (room_key, _) = keys
+            end_key = "s" + room_key.split('-')[-1]
             loaded_recents = sync_config.filter.filter_room_events(events)
             loaded_recents.extend(recents)
             recents = loaded_recents