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

Commit

Permalink
Fix rotating existing notifications in push summary
Browse files Browse the repository at this point in the history
Broke by #14045. Fixes #14120.

Introduced in v1.69.0rc2.
  • Loading branch information
erikjohnston committed Oct 11, 2022
1 parent 422cff7 commit 6375484
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions synapse/storage/databases/main/event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,11 +1104,16 @@ def _handle_new_receipts_for_notifs_txn(self, txn: LoggingTransaction) -> bool:
)

# First ensure that the existing rows have an updated thread_id field.
self.db_pool.simple_update_txn(
txn,
table="event_push_summary",
keyvalues={"room_id": room_id, "user_id": user_id, "thread_id": None},
updatevalues={"thread_id": "main"},
txn.execute(
"""
UPDATE event_push_summary
SET thread_id = ?
WHERE room_id = ? AND user_id = ? AND thread_id is NULL
""",
(
room_id,
user_id,
),
)

# Replace the previous summary with the new counts.
Expand Down

0 comments on commit 6375484

Please sign in to comment.