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

Commit 5b857b7

Browse files
authored
Don't error if deleting a non-existent pusher. (#9121)
1 parent 4a55d26 commit 5b857b7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog.d/9121.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix spurious errors in logs when deleting a non-existant pusher.

synapse/storage/databases/main/pusher.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ def delete_pusher_txn(txn, stream_id):
344344
txn, self.get_if_user_has_pusher, (user_id,)
345345
)
346346

347-
self.db_pool.simple_delete_one_txn(
347+
# It is expected that there is exactly one pusher to delete, but
348+
# if it isn't there (or there are multiple) delete them all.
349+
self.db_pool.simple_delete_txn(
348350
txn,
349351
"pushers",
350352
{"app_id": app_id, "pushkey": pushkey, "user_name": user_id},

0 commit comments

Comments
 (0)