summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-08-28 15:59:28 +0100
committerGitHub <noreply@github.com>2020-08-28 15:59:28 +0100
commit22b926c284f98b5507583a3a7866da12a9f4bb47 (patch)
tree42ca82f4cd7cf9873a5203941ec7e297d3785299
parentConvert state and stream stores and related code to async (#8194) (diff)
downloadsynapse-22b926c284f98b5507583a3a7866da12a9f4bb47.tar.xz
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.
-rw-r--r--changelog.d/8198.feature1
-rw-r--r--synapse/storage/databases/main/devices.py4
2 files changed, 2 insertions, 3 deletions
diff --git a/changelog.d/8198.feature b/changelog.d/8198.feature
new file mode 100644
index 0000000000..c4401288bf
--- /dev/null
+++ b/changelog.d/8198.feature
@@ -0,0 +1 @@
+Optimise `/federation/v1/user/devices/` API by only returning devices with encryption keys.
diff --git a/synapse/storage/databases/main/devices.py b/synapse/storage/databases/main/devices.py
index ecd3f3b310..def96637a2 100644
--- a/synapse/storage/databases/main/devices.py
+++ b/synapse/storage/databases/main/devices.py
@@ -498,9 +498,7 @@ class DeviceWorkerStore(SQLBaseStore):
     ) -> 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]