summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-05-21 17:40:10 +0100
committerErik Johnston <erik@matrix.org>2018-05-25 10:55:10 +0100
commitb0beffa99eb46f88c2ebe3f79ad5682cf9cec6aa (patch)
tree9eaff67bff6b80bc4016dce832ed0af7ee25bc1c
parentAdd chunk ID to pagination token (diff)
downloadsynapse-b0beffa99eb46f88c2ebe3f79ad5682cf9cec6aa.tar.xz
Use calculated topological ordering when persisting events
-rw-r--r--synapse/storage/events.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py

index 6db390485a..9084a62456 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py
@@ -1020,7 +1020,7 @@ class EventsStore(EventsWorkerStore): } ) - chunk_id, _ = self._compute_chunk_id_txn( + chunk_id, topo = self._compute_chunk_id_txn( txn, event.room_id, event.event_id, [eid for eid, _ in event.prev_events], ) @@ -1032,6 +1032,7 @@ class EventsStore(EventsWorkerStore): updatevalues={ "outlier": False, "chunk_id": chunk_id, + "topological_ordering": topo, }, ) @@ -1116,9 +1117,9 @@ class EventsStore(EventsWorkerStore): ) if event.internal_metadata.is_outlier(): - chunk_id, _topo = None, 0 + chunk_id, topo = None, 0 else: - chunk_id, _topo = self._compute_chunk_id_txn( + chunk_id, topo = self._compute_chunk_id_txn( txn, event.room_id, event.event_id, [eid for eid, _ in event.prev_events], ) @@ -1130,7 +1131,7 @@ class EventsStore(EventsWorkerStore): { "stream_ordering": event.internal_metadata.stream_ordering, "chunk_id": chunk_id, - "topological_ordering": event.depth, + "topological_ordering": topo, "depth": event.depth, "event_id": event.event_id, "room_id": event.room_id,