summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-02-22 12:26:17 +0000
committerErik Johnston <erik@matrix.org>2022-02-22 12:26:17 +0000
commit07f82ac29be42098ab5b135cb173437f9cd7c754 (patch)
tree52ede505210af0dd06421e9644fa09705d4703cd /synapse/handlers/sync.py
parentRecommend upgrading treq alongside twisted (#11943) (diff)
parentUpdate changelog (diff)
downloadsynapse-07f82ac29be42098ab5b135cb173437f9cd7c754.tar.xz
Merge branch 'release-v1.53'
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index c72ed7c290..aa9a76f8a9 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -1348,8 +1348,8 @@ class SyncHandler:
         if sync_result_builder.since_token is not None:
             since_stream_id = int(sync_result_builder.since_token.to_device_key)
 
-        if since_stream_id != int(now_token.to_device_key):
-            messages, stream_id = await self.store.get_new_messages_for_device(
+        if device_id is not None and since_stream_id != int(now_token.to_device_key):
+            messages, stream_id = await self.store.get_messages_for_device(
                 user_id, device_id, since_stream_id, now_token.to_device_key
             )