summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-02-01 17:23:44 +0000
committerErik Johnston <erik@matrix.org>2016-02-01 17:23:44 +0000
commit7a8ea7e78bb1a630b215793fd1aac18f06ce7373 (patch)
treee1370adf48d36f3e0f9d5c02ce305d56f3dc75b3 /synapse/storage
parentMerge pull request #543 from matrix-org/erikj/sync (diff)
parentOrder things correctly (diff)
downloadsynapse-7a8ea7e78bb1a630b215793fd1aac18f06ce7373.tar.xz
Merge pull request #546 from matrix-org/erikj/events
Switch over /events to use per room caches
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/stream.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index 8dc8f5c640..a03458c2fc 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -39,7 +39,6 @@ from ._base import SQLBaseStore
 from synapse.util.caches.descriptors import cachedInlineCallbacks
 from synapse.api.constants import EventTypes
 from synapse.types import RoomStreamToken
-from synapse.util.logutils import log_function
 
 import logging
 
@@ -288,11 +287,12 @@ class StreamStore(SQLBaseStore):
                 get_prev_content=True
             )
 
+            self._set_before_and_after(ret, rows, topo_order=False)
+
             return ret
 
         return self.runInteraction("get_room_changes_for_user", f)
 
-    @log_function
     def get_room_events_stream(
         self,
         user_id,
@@ -598,6 +598,10 @@ class StreamStore(SQLBaseStore):
             internal = event.internal_metadata
             internal.before = str(RoomStreamToken(topo, stream - 1))
             internal.after = str(RoomStreamToken(topo, stream))
+            internal.order = (
+                int(topo) if topo else 0,
+                int(stream),
+            )
 
     @defer.inlineCallbacks
     def get_events_around(self, room_id, event_id, before_limit, after_limit):