summary refs log tree commit diff
path: root/synapse/replication/http/devices.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-02-08 07:44:39 -0500
committerGitHub <noreply@github.com>2022-02-08 07:44:39 -0500
commit63d90f10eccf804a6ca5bfa51cdb1b0d0233fe95 (patch)
tree5e592b9184bd562cd5c46135f341b6fff5c3ea56 /synapse/replication/http/devices.py
parentFetch edits for multiple events in a single query. (#11660) (diff)
downloadsynapse-63d90f10eccf804a6ca5bfa51cdb1b0d0233fe95.tar.xz
Add missing type hints to synapse.replication.http. (#11856)
Diffstat (limited to 'synapse/replication/http/devices.py')
-rw-r--r--synapse/replication/http/devices.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/synapse/replication/http/devices.py b/synapse/replication/http/devices.py

index 42dffb39cb..f2f40129fe 100644 --- a/synapse/replication/http/devices.py +++ b/synapse/replication/http/devices.py
@@ -13,9 +13,13 @@ # limitations under the License. import logging -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Tuple +from twisted.web.server import Request + +from synapse.http.server import HttpServer from synapse.replication.http._base import ReplicationEndpoint +from synapse.types import JsonDict if TYPE_CHECKING: from synapse.server import HomeServer @@ -63,14 +67,16 @@ class ReplicationUserDevicesResyncRestServlet(ReplicationEndpoint): self.clock = hs.get_clock() @staticmethod - async def _serialize_payload(user_id): + async def _serialize_payload(user_id: str) -> JsonDict: # type: ignore[override] return {} - async def _handle_request(self, request, user_id): + async def _handle_request( # type: ignore[override] + self, request: Request, user_id: str + ) -> Tuple[int, JsonDict]: user_devices = await self.device_list_updater.user_device_resync(user_id) return 200, user_devices -def register_servlets(hs: "HomeServer", http_server): +def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None: ReplicationUserDevicesResyncRestServlet(hs).register(http_server)