mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Merge pull request #5789 from matrix-org/erikj/fix_error_handling_keys
Fix error handling when fetching remote device keys
This commit is contained in:
commit
7a48d0bab8
1
changelog.d/5789.bugfix
Normal file
1
changelog.d/5789.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix UISIs during homeserver outage.
|
@ -25,6 +25,7 @@ from twisted.internet import defer
|
|||||||
from synapse.api.errors import CodeMessageException, SynapseError
|
from synapse.api.errors import CodeMessageException, SynapseError
|
||||||
from synapse.logging.context import make_deferred_yieldable, run_in_background
|
from synapse.logging.context import make_deferred_yieldable, run_in_background
|
||||||
from synapse.types import UserID, get_domain_from_id
|
from synapse.types import UserID, get_domain_from_id
|
||||||
|
from synapse.util import unwrapFirstError
|
||||||
from synapse.util.retryutils import NotRetryingDestination
|
from synapse.util.retryutils import NotRetryingDestination
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -161,9 +162,7 @@ class E2eKeysHandler(object):
|
|||||||
results[user_id] = {device["device_id"]: device["keys"]}
|
results[user_id] = {device["device_id"]: device["keys"]}
|
||||||
user_ids_updated.append(user_id)
|
user_ids_updated.append(user_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
failures[destination] = failures.get(destination, []).append(
|
failures[destination] = _exception_to_failure(e)
|
||||||
_exception_to_failure(e)
|
|
||||||
)
|
|
||||||
|
|
||||||
if len(destination_query) == len(user_ids_updated):
|
if len(destination_query) == len(user_ids_updated):
|
||||||
# We've updated all the users in the query and we do not need to
|
# We've updated all the users in the query and we do not need to
|
||||||
@ -194,7 +193,7 @@ class E2eKeysHandler(object):
|
|||||||
for destination in remote_queries_not_in_cache
|
for destination in remote_queries_not_in_cache
|
||||||
],
|
],
|
||||||
consumeErrors=True,
|
consumeErrors=True,
|
||||||
)
|
).addErrback(unwrapFirstError)
|
||||||
)
|
)
|
||||||
|
|
||||||
return {"device_keys": results, "failures": failures}
|
return {"device_keys": results, "failures": failures}
|
||||||
|
Loading…
Reference in New Issue
Block a user