summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-02-16 11:52:51 +0000
committerGitHub <noreply@github.com>2018-02-16 11:52:51 +0000
commitbf5ef10a93c0f39c4260b341cc0eca61d143f154 (patch)
tree2fc05e9438db06f200bee80be9b4d4fff67d5ff1 /synapse/handlers/message.py
parentMerge pull request #2873 from matrix-org/erikj/event_creator_no_state (diff)
parentFix typo of double is_highlight (diff)
downloadsynapse-bf5ef10a93c0f39c4260b341cc0eca61d143f154.tar.xz
Merge pull request #2874 from matrix-org/erikj/creator_push_actions
Store push actions in DB staging area instead of context
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 1c3ac03f20..d99d8049b3 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -683,9 +683,15 @@ class EventCreationHandler(object):
             event, context
         )
 
-        (event_stream_id, max_stream_id) = yield self.store.persist_event(
-            event, context=context
-        )
+        try:
+            (event_stream_id, max_stream_id) = yield self.store.persist_event(
+                event, context=context
+            )
+        except:  # noqa: E722, as we reraise the exception this is fine.
+            # Ensure that we actually remove the entries in the push actions
+            # staging area
+            preserve_fn(self.store.remove_push_actions_from_staging)(event.event_id)
+            raise
 
         # this intentionally does not yield: we don't care about the result
         # and don't need to wait for it.