Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Don't query for to-device messages without a device
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Jan 26, 2022
1 parent 25488fa commit 026cb8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ async def _generate_sync_entry_for_to_device(
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):
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
)
Expand Down

0 comments on commit 026cb8a

Please sign in to comment.