summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-01-25 14:52:30 -0500
committerGitHub <noreply@github.com>2021-01-25 14:52:30 -0500
commit5b857b77f7de62bb9be0aa88a3fffcf7cb11efe6 (patch)
tree3a59f8b46b1569b72771b173e36d09baf37b6633
parentAdd an admin API for shadow-banning users. (#9209) (diff)
downloadsynapse-5b857b77f7de62bb9be0aa88a3fffcf7cb11efe6.tar.xz
Don't error if deleting a non-existent pusher. (#9121)
-rw-r--r--changelog.d/9121.bugfix1
-rw-r--r--synapse/storage/databases/main/pusher.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/changelog.d/9121.bugfix b/changelog.d/9121.bugfix
new file mode 100644
index 0000000000..a566878ec0
--- /dev/null
+++ b/changelog.d/9121.bugfix
@@ -0,0 +1 @@
+Fix spurious errors in logs when deleting a non-existant pusher.
diff --git a/synapse/storage/databases/main/pusher.py b/synapse/storage/databases/main/pusher.py
index bc7621b8d6..2687ef3e43 100644
--- a/synapse/storage/databases/main/pusher.py
+++ b/synapse/storage/databases/main/pusher.py
@@ -344,7 +344,9 @@ class PusherStore(PusherWorkerStore):
                 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},