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

Commit

Permalink
Fix TypeError in synapse.notifier (#7880)
Browse files Browse the repository at this point in the history
Fixes #7774
  • Loading branch information
erikjohnston authored Jul 17, 2020
1 parent 852930a commit a3ad045
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit a3ad045

Please sign in to comment.