Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit c7f3fb2

Browse files
authored
Add type hints to the federation server transport. (#10080)
1 parent e0ddd82 commit c7f3fb2

File tree

5 files changed

+194
-75
lines changed

5 files changed

+194
-75
lines changed

changelog.d/10080.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add type hints to the federation servlets.

synapse/federation/federation_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def __init__(self, hs: "HomeServer"):
129129
# come in waves.
130130
self._state_resp_cache = ResponseCache(
131131
hs.get_clock(), "state_resp", timeout_ms=30000
132-
) # type: ResponseCache[Tuple[str, str]]
132+
) # type: ResponseCache[Tuple[str, Optional[str]]]
133133
self._state_ids_resp_cache = ResponseCache(
134134
hs.get_clock(), "state_ids_resp", timeout_ms=30000
135135
) # type: ResponseCache[Tuple[str, str]]
@@ -406,7 +406,7 @@ async def _process_edu(edu_dict):
406406
)
407407

408408
async def on_room_state_request(
409-
self, origin: str, room_id: str, event_id: str
409+
self, origin: str, room_id: str, event_id: Optional[str]
410410
) -> Tuple[int, Dict[str, Any]]:
411411
origin_host, _ = parse_server_name(origin)
412412
await self.check_server_matches_acl(origin_host, room_id)
@@ -463,7 +463,7 @@ async def _on_state_ids_request_compute(self, room_id, event_id):
463463
return {"pdu_ids": state_ids, "auth_chain_ids": auth_chain_ids}
464464

465465
async def _on_context_state_request_compute(
466-
self, room_id: str, event_id: str
466+
self, room_id: str, event_id: Optional[str]
467467
) -> Dict[str, list]:
468468
if event_id:
469469
pdus = await self.handler.get_state_for_pdu(

0 commit comments

Comments
 (0)