summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2020-04-14 10:09:58 +0100
committerGitHub <noreply@github.com>2020-04-14 10:09:58 +0100
commitfef82f4e22d06bf914b5f5eb78ee7a09f610e63a (patch)
tree89b5c3a554a1354893d7b5d5b9c9829785b36986
parentAdd setting to nginx configuration to allow larger file uploads (#7251) (diff)
downloadsynapse-fef82f4e22d06bf914b5f5eb78ee7a09f610e63a.tar.xz
Only register devices edu handler on the master process (#7255)
-rw-r--r--changelog.d/7255.bugfix1
-rw-r--r--synapse/handlers/e2e_keys.py18
2 files changed, 12 insertions, 7 deletions
diff --git a/changelog.d/7255.bugfix b/changelog.d/7255.bugfix
new file mode 100644
index 0000000000..a96d52256f
--- /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
diff --git a/synapse/handlers/e2e_keys.py b/synapse/handlers/e2e_keys.py
index 95a9d71f41..8d7075f2eb 100644
--- a/synapse/handlers/e2e_keys.py
+++ b/synapse/handlers/e2e_keys.py
@@ -54,19 +54,23 @@ class E2eKeysHandler(object):
 
         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.