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

Description
When persist_events_and_notify raises an exception, we try to clean up push actions in a background task:
|
try: |
|
await self.persist_events_and_notify( |
|
event.room_id, [(event, context)], backfilled=backfilled |
|
) |
|
except Exception: |
|
run_in_background( |
|
self._store.remove_push_actions_from_staging, event.event_id |
|
) |
|
raise |
run_in_background inherits the current logging context, but since we don't await the background task, we end up closing the logging context before the background task finishes. We ought to either await remove_push_actions_from_staging directly, or create a logging context for it.