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

Add type hints to the federation server transport. #10080

Merged
merged 10 commits into from
Jun 8, 2021
1 change: 1 addition & 0 deletions changelog.d/10080.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add type hints to the federation servlets.
6 changes: 3 additions & 3 deletions synapse/federation/federation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(self, hs: "HomeServer"):
# come in waves.
self._state_resp_cache = ResponseCache(
hs.get_clock(), "state_resp", timeout_ms=30000
) # type: ResponseCache[Tuple[str, str]]
) # type: ResponseCache[Tuple[str, Optional[str]]]
self._state_ids_resp_cache = ResponseCache(
hs.get_clock(), "state_ids_resp", timeout_ms=30000
) # type: ResponseCache[Tuple[str, str]]
Expand Down Expand Up @@ -406,7 +406,7 @@ async def _process_edu(edu_dict):
)

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

async def _on_context_state_request_compute(
self, room_id: str, event_id: str
self, room_id: str, event_id: Optional[str]
) -> Dict[str, list]:
if event_id:
pdus = await self.handler.get_state_for_pdu(
Expand Down
Loading