summary refs log tree commit diff
path: root/synapse/storage/event_push_actions.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-02-20 12:33:04 +0000
committerErik Johnston <erik@matrix.org>2018-02-20 12:34:31 +0000
commit24087bffa932660cf4482b465b759f7161465f8a (patch)
tree719247f4542f148fccb53319140bfb35f5eb9158 /synapse/storage/event_push_actions.py
parentRefactor _set_push_actions_for_event_and_users_txn to use events_and_contexts (diff)
downloadsynapse-24087bffa932660cf4482b465b759f7161465f8a.tar.xz
Ensure all push actions are deleted from staging
Diffstat (limited to 'synapse/storage/event_push_actions.py')
-rw-r--r--synapse/storage/event_push_actions.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/storage/event_push_actions.py b/synapse/storage/event_push_actions.py
index dac3505480..6a122b05a8 100644
--- a/synapse/storage/event_push_actions.py
+++ b/synapse/storage/event_push_actions.py
@@ -88,13 +88,21 @@ class EventPushActionsStore(SQLBaseStore):
             self._rotate_notifs, 30 * 60 * 1000
         )
 
-    def _set_push_actions_for_event_and_users_txn(self, txn, events_and_contexts):
+    def _set_push_actions_for_event_and_users_txn(self, txn, events_and_contexts,
+                                                  all_events_and_contexts):
         """Handles moving push actions from staging table to main
         event_push_actions table for all events in `events_and_contexts`.
 
+        Also ensures that all events in `all_events_and_contexts` are removed
+        from the push action staging area.
+
         Args:
             events_and_contexts (list[(EventBase, EventContext)]): events
                 we are persisting
+            all_events_and_contexts (list[(EventBase, EventContext)]): all
+                events that we were going to persist. This includes events
+                we've already persisted, etc, that wouldn't appear in
+                events_and_context.
         """
 
         sql = """