Fix bug when querying remote user keys that require a resync. (#6796)

We ended up only returning a single device, rather than all of them.
This commit is contained in:
Erik Johnston 2020-01-29 09:56:41 +00:00 committed by GitHub
parent fcfb591b31
commit 2cad8baa70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

1
changelog.d/6796.bugfix Normal file
View file

@ -0,0 +1 @@
Fix bug where querying a remote user's device keys that weren't cached resulted in only returning a single device.

View file

@ -208,8 +208,9 @@ class E2eKeysHandler(object):
)
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)