summary refs log tree commit diff
path: root/synapse/handlers/device.py
diff options
context:
space:
mode:
authorMathieu Velten <matmaul@gmail.com>2023-10-18 17:42:01 +0200
committerGitHub <noreply@github.com>2023-10-18 16:42:01 +0100
commitbcff01b40673238dca29c0f22dc4fda05f635030 (patch)
tree734b2322812d72191a8cefd315651f70a5b09e94 /synapse/handlers/device.py
parentRun trial/integration tests if .ci is modified. (#16512) (diff)
downloadsynapse-bcff01b40673238dca29c0f22dc4fda05f635030.tar.xz
Improve performance of delete device messages query (#16492)
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r--synapse/handlers/device.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index 544bc7c13d..3ce96ef3cb 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -592,6 +592,8 @@ class DeviceHandler(DeviceWorkerHandler):
                 )
 
             # Delete device messages asynchronously and in batches using the task scheduler
+            # We specify an upper stream id to avoid deleting non delivered messages
+            # if an user re-uses a device ID.
             await self._task_scheduler.schedule_task(
                 DELETE_DEVICE_MSGS_TASK_NAME,
                 resource_id=device_id,