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

Back out perf regression from get_cross_signing_keys_from_cache. #6494

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/6494.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Back out perf regression from get_cross_signing_keys_from_cache.
neilisfragile marked this conversation as resolved.
Show resolved Hide resolved
25 changes: 1 addition & 24 deletions synapse/handlers/e2e_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,30 +284,7 @@ def get_cross_signing_keys_from_cache(self, query, from_user_id):
self_signing_keys = {}
user_signing_keys = {}

for user_id in query:
# XXX: consider changing the store functions to allow querying
# multiple users simultaneously.
key = yield self.store.get_e2e_cross_signing_key(
neilisfragile marked this conversation as resolved.
Show resolved Hide resolved
user_id, "master", from_user_id
)
if key:
master_keys[user_id] = key

key = yield self.store.get_e2e_cross_signing_key(
user_id, "self_signing", from_user_id
)
if key:
self_signing_keys[user_id] = key

# users can see other users' master and self-signing keys, but can
# only see their own user-signing keys
if from_user_id == user_id:
key = yield self.store.get_e2e_cross_signing_key(
user_id, "user_signing", from_user_id
)
if key:
user_signing_keys[user_id] = key

# Currently a stub, implementation coming in /~https://github.com/matrix-org/synapse/pull/6486
return {
"master_keys": master_keys,
"self_signing_keys": self_signing_keys,
Expand Down