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

Commit

Permalink
Merge pull request #5789 from matrix-org/erikj/fix_error_handling_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 20, 2020
2 parents bab6f60 + 7a48d0b commit e6b6281
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/5789.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix UISIs during homeserver outage.
7 changes: 3 additions & 4 deletions synapse/handlers/e2e_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from synapse.api.errors import CodeMessageException, SynapseError
from synapse.logging.context import make_deferred_yieldable, run_in_background
from synapse.types import UserID, get_domain_from_id
from synapse.util import unwrapFirstError
from synapse.util.retryutils import NotRetryingDestination

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -161,9 +162,7 @@ def do_remote_query(destination):
results[user_id] = {device["device_id"]: device["keys"]}
user_ids_updated.append(user_id)
except Exception as e:
failures[destination] = failures.get(destination, []).append(
_exception_to_failure(e)
)
failures[destination] = _exception_to_failure(e)

if len(destination_query) == len(user_ids_updated):
# We've updated all the users in the query and we do not need to
Expand Down Expand Up @@ -194,7 +193,7 @@ def do_remote_query(destination):
for destination in remote_queries_not_in_cache
],
consumeErrors=True,
)
).addErrback(unwrapFirstError)
)

return {"device_keys": results, "failures": failures}
Expand Down

0 comments on commit e6b6281

Please sign in to comment.