Browse Source

Add comment to sync as to why code path is split

Erik Johnston 6 years ago
parent
commit
d26bec8a43
1 changed files with 5 additions and 0 deletions
  1. 5 0
      synapse/handlers/sync.py

+ 5 - 0
synapse/handlers/sync.py

@@ -354,6 +354,11 @@ class SyncHandler(object):
                 since_key = since_token.room_key
 
             while limited and len(recents) < timeline_limit and max_repeat:
+                # If we have a since_key then we are trying to get any events
+                # that have happened since `since_key` up to `end_key`, so we
+                # can just use `get_room_events_stream_for_room`.
+                # Otherwise, we want to return the last N events in the room
+                # in toplogical ordering.
                 if since_key:
                     events, end_key = yield self.store.get_room_events_stream_for_room(
                         room_id,