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

Commit 5615eb5

Browse files
authored
Rename _get_e2e_device_keys_txn (#8222)
... to `_get_e2e_device_keys_and_signatures_txn`, to better reflect what it does.
1 parent 54f8d73 commit 5615eb5

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

changelog.d/8222.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refactor queries for device keys and cross-signatures.

synapse/storage/databases/main/devices.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ async def _get_device_update_edus_by_remote(
256256
"""
257257
devices = (
258258
await self.db_pool.runInteraction(
259-
"_get_e2e_device_keys_txn",
260-
self._get_e2e_device_keys_txn,
259+
"get_e2e_device_keys_and_signatures_txn",
260+
self._get_e2e_device_keys_and_signatures_txn,
261261
query_map.keys(),
262262
include_all_devices=True,
263263
include_deleted_devices=True,

synapse/storage/databases/main/end_to_end_keys.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _get_e2e_device_keys_for_federation_query_txn(
5151
) -> Tuple[int, List[JsonDict]]:
5252
now_stream_id = self.get_device_stream_token()
5353

54-
devices = self._get_e2e_device_keys_txn(txn, [(user_id, None)])
54+
devices = self._get_e2e_device_keys_and_signatures_txn(txn, [(user_id, None)])
5555

5656
if devices:
5757
user_devices = devices[user_id]
@@ -96,7 +96,9 @@ async def get_e2e_device_keys_for_cs_api(
9696
return {}
9797

9898
results = await self.db_pool.runInteraction(
99-
"get_e2e_device_keys", self._get_e2e_device_keys_txn, query_list,
99+
"get_e2e_device_keys_and_signatures_txn",
100+
self._get_e2e_device_keys_and_signatures_txn,
101+
query_list,
100102
)
101103

102104
# Build the result structure, un-jsonify the results, and add the
@@ -120,9 +122,9 @@ async def get_e2e_device_keys_for_cs_api(
120122
return rv
121123

122124
@trace
123-
def _get_e2e_device_keys_txn(
125+
def _get_e2e_device_keys_and_signatures_txn(
124126
self, txn, query_list, include_all_devices=False, include_deleted_devices=False
125-
):
127+
) -> Dict[str, Dict[str, Optional[Dict]]]:
126128
set_tag("include_all_devices", include_all_devices)
127129
set_tag("include_deleted_devices", include_deleted_devices)
128130

0 commit comments

Comments
 (0)