summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-21 15:57:35 +0100
committerErik Johnston <erik@matrix.org>2015-05-21 15:57:35 +0100
commite309b1045db036174b66364740b645466e459454 (patch)
tree51813518ecf7caa1b1a0d8db3c790cce9a6cfe7b /synapse
parentRemove dead code (diff)
downloadsynapse-e309b1045db036174b66364740b645466e459454.tar.xz
Sort backfill events
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/event_federation.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 8a56476f56..5fd126cdb9 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -364,7 +364,11 @@ class EventFederationStore(SQLBaseStore):
         return self.runInteraction(
             "get_backfill_events",
             self._get_backfill_events, room_id, event_list, limit
-        ).addCallback(self._get_events)
+        ).addCallback(
+            self._get_events
+        ).addCallback(
+            lambda l: l.sort(key=lambda e: -e.depth)
+        )
 
     def _get_backfill_events(self, txn, room_id, event_list, limit):
         logger.debug(