File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
synapse/storage/databases/main Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -734,9 +734,13 @@ def _insert_linearized_receipt_txn(
734
734
thread_clause = "r.thread_id = ?"
735
735
thread_args = (thread_id ,)
736
736
737
+ # If the receipt doesn't have a stream ordering it is because we
738
+ # don't have the associated event, and so must be a remote receipt.
739
+ # Hence it's safe to just allow new receipts to clobber it.
737
740
sql = f"""
738
741
SELECT r.event_stream_ordering, r.event_id FROM receipts_linearized AS r
739
- WHERE r.room_id = ? AND r.receipt_type = ? AND r.user_id = ? AND { thread_clause }
742
+ WHERE r.room_id = ? AND r.receipt_type = ? AND r.user_id = ?
743
+ AND r.event_stream_ordering IS NOT NULL AND { thread_clause }
740
744
"""
741
745
txn .execute (
742
746
sql ,
You can’t perform that action at this time.
0 commit comments