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

Commit 6375484

Browse files
committed
Fix rotating existing notifications in push summary
Broke by #14045. Fixes #14120. Introduced in v1.69.0rc2.
1 parent 422cff7 commit 6375484

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

synapse/storage/databases/main/event_push_actions.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,11 +1104,16 @@ def _handle_new_receipts_for_notifs_txn(self, txn: LoggingTransaction) -> bool:
11041104
)
11051105

11061106
# First ensure that the existing rows have an updated thread_id field.
1107-
self.db_pool.simple_update_txn(
1108-
txn,
1109-
table="event_push_summary",
1110-
keyvalues={"room_id": room_id, "user_id": user_id, "thread_id": None},
1111-
updatevalues={"thread_id": "main"},
1107+
txn.execute(
1108+
"""
1109+
UPDATE event_push_summary
1110+
SET thread_id = ?
1111+
WHERE room_id = ? AND user_id = ? AND thread_id is NULL
1112+
""",
1113+
(
1114+
room_id,
1115+
user_id,
1116+
),
11121117
)
11131118

11141119
# Replace the previous summary with the new counts.

0 commit comments

Comments
 (0)