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

Commit

Permalink
Fix bug when querying remote user keys that require a resync. (#6796)
Browse files Browse the repository at this point in the history
We ended up only returning a single device, rather than all of them.
  • Loading branch information
erikjohnston authored Jan 29, 2020
1 parent fcfb591 commit 2cad8ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/6796.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where querying a remote user's device keys that weren't cached resulted in only returning a single device.
3 changes: 2 additions & 1 deletion synapse/handlers/e2e_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ def do_remote_query(destination):
)

user_devices = user_devices["devices"]
user_results = results.setdefault(user_id, {})
for device in user_devices:
results[user_id] = {device["device_id"]: device["keys"]}
user_results[device["device_id"]] = device["keys"]
user_ids_updated.append(user_id)
except Exception as e:
failures[destination] = _exception_to_failure(e)
Expand Down

0 comments on commit 2cad8ba

Please sign in to comment.