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

Don't error if deleting a non-existant pusher. #9121

Merged
merged 4 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9121.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not throw spurious errors when deleting a non-existant pusher.
clokep marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 3 additions & 1 deletion synapse/storage/databases/main/pusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def delete_pusher_txn(txn, stream_id):
txn, self.get_if_user_has_pusher, (user_id,)
)

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