From 65db1cebed03aec8fc188b951cb7bfde9250ea43 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 9 Apr 2020 15:59:15 +0100 Subject: [PATCH 1/2] Only register EDU handlers on the master process --- synapse/handlers/e2e_keys.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/synapse/handlers/e2e_keys.py b/synapse/handlers/e2e_keys.py index 95a9d71f4112..8d7075f2eb2a 100644 --- a/synapse/handlers/e2e_keys.py +++ b/synapse/handlers/e2e_keys.py @@ -54,19 +54,23 @@ def __init__(self, hs): self._edu_updater = SigningKeyEduUpdater(hs, self) + federation_registry = hs.get_federation_registry() + self._is_master = hs.config.worker_app is None if not self._is_master: self._user_device_resync_client = ReplicationUserDevicesResyncRestServlet.make_client( hs ) + else: + # Only register this edu handler on master as it requires writing + # device updates to the db + # + # FIXME: switch to m.signing_key_update when MSC1756 is merged into the spec + federation_registry.register_edu_handler( + "org.matrix.signing_key_update", + self._edu_updater.incoming_signing_key_update, + ) - federation_registry = hs.get_federation_registry() - - # FIXME: switch to m.signing_key_update when MSC1756 is merged into the spec - federation_registry.register_edu_handler( - "org.matrix.signing_key_update", - self._edu_updater.incoming_signing_key_update, - ) # doesn't really work as part of the generic query API, because the # query request requires an object POST, but we abuse the # "query handler" interface. From d3d24dfae43448645838f1b7c616c8f86881c940 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 9 Apr 2020 16:02:34 +0100 Subject: [PATCH 2/2] Changelog --- changelog.d/7255.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/7255.bugfix diff --git a/changelog.d/7255.bugfix b/changelog.d/7255.bugfix new file mode 100644 index 000000000000..a96d52256fcd --- /dev/null +++ b/changelog.d/7255.bugfix @@ -0,0 +1 @@ +Fix a bug that prevented cross-signing with users on worker-mode synapses. \ No newline at end of file