Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Always set event_stream_ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Sep 12, 2022
1 parent b6e8321 commit 3814eb8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions synapse/storage/databases/main/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,14 +664,6 @@ def _insert_linearized_receipt_txn(
self._receipts_stream_cache.entity_has_changed, room_id, stream_id
)

upsert_values: Dict[str, Any] = {
"stream_id": stream_id,
"event_id": event_id,
"data": json_encoder.encode(data),
}
if stream_ordering is not None:
upsert_values["event_stream_ordering"] = stream_ordering

self.db_pool.simple_upsert_txn(
txn,
table="receipts_linearized",
Expand All @@ -680,7 +672,12 @@ def _insert_linearized_receipt_txn(
"receipt_type": receipt_type,
"user_id": user_id,
},
values=upsert_values,
values={
"stream_id": stream_id,
"event_id": event_id,
"event_stream_ordering": stream_ordering,
"data": json_encoder.encode(data),
},
# receipts_linearized has a unique constraint on
# (user_id, room_id, receipt_type), so no need to lock
lock=False,
Expand Down

0 comments on commit 3814eb8

Please sign in to comment.