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

Fix TypeError in synapse.notifier #7880

Merged
merged 3 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7880.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix "TypeError in `synapse.notifier`" exceptions.
8 changes: 8 additions & 0 deletions synapse/handlers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ async def notify_device_update(self, user_id, device_ids):
"""Notify that a user's device(s) has changed. Pokes the notifier, and
remote servers if the user is local.
"""
if not device_ids:
# No changes to notify about, so this is a no-op.
return

users_who_share_room = await self.store.get_users_who_share_room_with_user(
user_id
)
Expand All @@ -436,6 +440,10 @@ async def notify_device_update(self, user_id, device_ids):
user_id, device_ids, list(hosts)
)

if not position:
# This should only happen if there are no updates, so we bail.
return

for device_id in device_ids:
logger.debug(
"Notifying about update %r/%r, ID: %r", user_id, device_id, position
Expand Down