From 3e7eec3cc30c0ca06bb5fea13a76d4d328079ff9 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 29 Sep 2025 17:57:20 +0100 Subject: [PATCH 1/2] Remove `ReplicationUploadKeysForUserRestServlet` As we are now well past Synapse 1.135. This was originally added in https://github.com/element-hq/synapse/pull/18581. --- synapse/replication/http/devices.py | 41 ----------------------------- 1 file changed, 41 deletions(-) diff --git a/synapse/replication/http/devices.py b/synapse/replication/http/devices.py index 974d83bb8bf..94981e22eba 100644 --- a/synapse/replication/http/devices.py +++ b/synapse/replication/http/devices.py @@ -185,46 +185,6 @@ async def _handle_request( # type: ignore[override] return 200, multi_user_devices -# FIXME(2025-07-22): Remove this on the next release, this will only get used -# during rollout to Synapse 1.135 and can be removed after that release. -class ReplicationUploadKeysForUserRestServlet(ReplicationEndpoint): - """Unused endpoint, kept for backwards compatibility during rollout.""" - - NAME = "upload_keys_for_user" - PATH_ARGS = () - CACHE = False - - def __init__(self, hs: "HomeServer"): - super().__init__(hs) - - self.e2e_keys_handler = hs.get_e2e_keys_handler() - self.store = hs.get_datastores().main - self.clock = hs.get_clock() - - @staticmethod - async def _serialize_payload( # type: ignore[override] - user_id: str, device_id: str, keys: JsonDict - ) -> JsonDict: - return { - "user_id": user_id, - "device_id": device_id, - "keys": keys, - } - - async def _handle_request( # type: ignore[override] - self, request: Request, content: JsonDict - ) -> Tuple[int, JsonDict]: - user_id = content["user_id"] - device_id = content["device_id"] - keys = content["keys"] - - results = await self.e2e_keys_handler.upload_keys_for_user( - user_id, device_id, keys - ) - - return 200, results - - class ReplicationHandleNewDeviceUpdateRestServlet(ReplicationEndpoint): """Wake up a device writer to send local device list changes as federation outbound pokes. @@ -291,5 +251,4 @@ def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None: ReplicationNotifyUserSignatureUpdateRestServlet(hs).register(http_server) ReplicationMultiUserDevicesResyncRestServlet(hs).register(http_server) ReplicationHandleNewDeviceUpdateRestServlet(hs).register(http_server) - ReplicationUploadKeysForUserRestServlet(hs).register(http_server) ReplicationDeviceHandleRoomUnPartialStated(hs).register(http_server) From 08b999a3bd91b07921f9693630f1b519ace3c9ed Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 29 Sep 2025 18:00:50 +0100 Subject: [PATCH 2/2] newsfile --- changelog.d/18988.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/18988.misc diff --git a/changelog.d/18988.misc b/changelog.d/18988.misc new file mode 100644 index 00000000000..14dbe928128 --- /dev/null +++ b/changelog.d/18988.misc @@ -0,0 +1 @@ +Remove internal `ReplicationUploadKeysForUserRestServlet` as a follow-up to the work in https://github.com/element-hq/synapse/pull/18581 that moved device changes off the main process. \ No newline at end of file