summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-06-01 15:17:58 +0100
committerGitHub <noreply@github.com>2018-06-01 15:17:58 +0100
commit9eaf69a38697ac84fbcd3783b98d506b1c5b666f (patch)
tree3039821bbd61dec6b970b9a2c7ae531e92609ce2 /synapse/handlers/room.py
parentMerge pull request #3240 from matrix-org/erikj/events_chunks (diff)
parentRemove spurious conditional (diff)
downloadsynapse-github/erikj/room_chunks.tar.xz
Merge pull request #3315 from matrix-org/erikj/chunk_pag_1 github/erikj/room_chunks erikj/room_chunks
Implement pagination using chunks
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py

index b5850db42f..870dbd3799 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py
@@ -514,7 +514,8 @@ class RoomEventSource(object): events = list(room_events) events.extend(e for evs, _ in room_to_events.values() for e in evs) - events.sort(key=lambda e: e.internal_metadata.order) + # Order by the stream ordering of the events. + events.sort(key=lambda e: e.internal_metadata.stream_ordering) if limit: events[:] = events[:limit] @@ -534,7 +535,7 @@ class RoomEventSource(object): @defer.inlineCallbacks def get_pagination_rows(self, user, config, key): - events, next_key = yield self.store.paginate_room_events( + events, next_key, _ = yield self.store.paginate_room_events( room_id=key, from_key=config.from_key, to_key=config.to_key,