summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMathieu Velten <mathieuv@matrix.org>2023-04-14 14:12:37 +0200
committerGitHub <noreply@github.com>2023-04-14 14:12:37 +0200
commitdabbb94fafd335966bbdb5bd2187678872731a0d (patch)
treedfe27a9cf71696ca300cdcc53d4560ce1d6b1a71 /synapse
parentConvert async to normal tests in `TestSSOHandler` (#15433) (diff)
downloadsynapse-dabbb94fafd335966bbdb5bd2187678872731a0d.tar.xz
Delete pushers after calling on_logged_out module hook on device delete (#15410)
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/device.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index d2063d4435..ae1d9337ad 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -513,8 +513,6 @@ class DeviceHandler(DeviceWorkerHandler):
             else:
                 raise
 
-        await self.hs.get_pusherpool().remove_pushers_by_devices(user_id, device_ids)
-
         # Delete data specific to each device. Not optimised as it is not
         # considered as part of a critical path.
         for device_id in device_ids:
@@ -533,6 +531,10 @@ class DeviceHandler(DeviceWorkerHandler):
                     f"org.matrix.msc3890.local_notification_settings.{device_id}",
                 )
 
+        # Pushers are deleted after `delete_access_tokens_for_user` is called so that
+        # modules using `on_logged_out` hook can use them if needed.
+        await self.hs.get_pusherpool().remove_pushers_by_devices(user_id, device_ids)
+
         await self.notify_device_update(user_id, device_ids)
 
     async def update_device(self, user_id: str, device_id: str, content: dict) -> None: