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

Commit

Permalink
Only return devices with keys from /federation/v1/user/devices/
Browse files Browse the repository at this point in the history
There's not much point in returning all the others, and some people have a
silly number of devices.
  • Loading branch information
richvdh committed Aug 28, 2020
1 parent d674153 commit acc90a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/8198.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Optimise `/federation/v1/user/devices/` API by only returning devices with encryption keys.
4 changes: 1 addition & 3 deletions synapse/storage/databases/main/end_to_end_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ async def get_devices_with_keys_by_user(
(stream_id, devices)
"""
now_stream_id = self._get_current_device_list_stream_id()
devices = await self.get_e2e_device_keys(
[(user_id, None)], include_all_devices=True
)
devices = await self.get_e2e_device_keys([(user_id, None)])
user_devices = devices.get("user_id", {})
results = []
for device_id, device in user_devices.items():
Expand Down

0 comments on commit acc90a7

Please sign in to comment.