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/ (#8198
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 authored Aug 28, 2020
1 parent aec7085 commit 22b926c
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/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,7 @@ def _get_devices_with_keys_by_user_txn(
) -> Tuple[int, List[JsonDict]]:
now_stream_id = self._device_list_id_gen.get_current_token()

devices = self._get_e2e_device_keys_txn(
txn, [(user_id, None)], include_all_devices=True
)
devices = self._get_e2e_device_keys_txn(txn, [(user_id, None)])

if devices:
user_devices = devices[user_id]
Expand Down

0 comments on commit 22b926c

Please sign in to comment.