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

Commit 22b926c

Browse files
authored
Only return devices with keys from /federation/v1/user/devices/ (#8198)
There's not much point in returning all the others, and some people have a silly number of devices.
1 parent aec7085 commit 22b926c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

changelog.d/8198.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Optimise `/federation/v1/user/devices/` API by only returning devices with encryption keys.

synapse/storage/databases/main/devices.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,7 @@ def _get_devices_with_keys_by_user_txn(
498498
) -> Tuple[int, List[JsonDict]]:
499499
now_stream_id = self._device_list_id_gen.get_current_token()
500500

501-
devices = self._get_e2e_device_keys_txn(
502-
txn, [(user_id, None)], include_all_devices=True
503-
)
501+
devices = self._get_e2e_device_keys_txn(txn, [(user_id, None)])
504502

505503
if devices:
506504
user_devices = devices[user_id]

0 commit comments

Comments
 (0)