summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-05-25 13:54:25 +0100
committerErik Johnston <erik@matrix.org>2018-05-25 13:54:25 +0100
commit66450785d8f3d5cd84d5291b4eb944cfe8b1f2d1 (patch)
treec8e11dd4d2a404d11ccd4b5d70e7e38064ce82f2
parentCheck is_state (diff)
downloadsynapse-66450785d8f3d5cd84d5291b4eb944cfe8b1f2d1.tar.xz
Ignore topological for receipts
-rw-r--r--synapse/storage/receipts.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/storage/receipts.py b/synapse/storage/receipts.py

index 709c69a926..643f875b0c 100644 --- a/synapse/storage/receipts.py +++ b/synapse/storage/receipts.py
@@ -369,7 +369,7 @@ class ReceiptsStore(ReceiptsWorkerStore): # We don't want to clobber receipts for more recent events, so we # have to compare orderings of existing receipts sql = ( - "SELECT topological_ordering, stream_ordering, event_id FROM events" + "SELECT stream_ordering FROM events" " INNER JOIN receipts_linearized as r USING (event_id, room_id)" " WHERE r.room_id = ? AND r.receipt_type = ? AND r.user_id = ?" ) @@ -377,10 +377,8 @@ class ReceiptsStore(ReceiptsWorkerStore): txn.execute(sql, (room_id, receipt_type, user_id)) if topological_ordering: - for to, so, _ in txn: - if int(to) > topological_ordering: - return False - elif int(to) == topological_ordering and int(so) >= stream_ordering: + for so, in txn: + if int(so) >= stream_ordering: return False self._simple_delete_txn(