diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py
index c6bfa5451f..6284bcdfbc 100644
--- a/synapse/handlers/room_list.py
+++ b/synapse/handlers/room_list.py
@@ -47,12 +47,12 @@ class RoomListHandler(BaseHandler):
def __init__(self, hs: "HomeServer"):
super().__init__(hs)
self.enable_room_list_search = hs.config.enable_room_list_search
- self.response_cache = ResponseCache(
- hs.get_clock(), "room_list"
- ) # type: ResponseCache[Tuple[Optional[int], Optional[str], Optional[ThirdPartyInstanceID]]]
- self.remote_response_cache = ResponseCache(
- hs.get_clock(), "remote_room_list", timeout_ms=30 * 1000
- ) # type: ResponseCache[Tuple[str, Optional[int], Optional[str], bool, Optional[str]]]
+ self.response_cache: ResponseCache[
+ Tuple[Optional[int], Optional[str], Optional[ThirdPartyInstanceID]]
+ ] = ResponseCache(hs.get_clock(), "room_list")
+ self.remote_response_cache: ResponseCache[
+ Tuple[str, Optional[int], Optional[str], bool, Optional[str]]
+ ] = ResponseCache(hs.get_clock(), "remote_room_list", timeout_ms=30 * 1000)
async def get_local_public_room_list(
self,
@@ -139,10 +139,10 @@ class RoomListHandler(BaseHandler):
if since_token:
batch_token = RoomListNextBatch.from_token(since_token)
- bounds = (
+ bounds: Optional[Tuple[int, str]] = (
batch_token.last_joined_members,
batch_token.last_room_id,
- ) # type: Optional[Tuple[int, str]]
+ )
forwards = batch_token.direction_is_forward
has_batch_token = True
else:
@@ -182,7 +182,7 @@ class RoomListHandler(BaseHandler):
results = [build_room_entry(r) for r in results]
- response = {} # type: JsonDict
+ response: JsonDict = {}
num_results = len(results)
if limit is not None:
more_to_come = num_results == probing_limit
|