summary refs log tree commit diff
path: root/synapse/rest/client/room.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-10-14 08:30:05 -0400
committerGitHub <noreply@github.com>2022-10-14 12:30:05 +0000
commit126a15794c95002560709283640ad412636b29b8 (patch)
treedca3e2380f4bec49b5dcff4407bc6405eef05692 /synapse/rest/client/room.py
parentSet LD_PRELOAD to load jemalloc in Dockerfile-workers. (#14182) (diff)
downloadsynapse-126a15794c95002560709283640ad412636b29b8.tar.xz
Do not allow a None-limit on PaginationConfig. (#14146)
The callers either set a default limit or manually handle a None-limit
later on (by setting a default value).

Update the callers to always instantiate PaginationConfig with a default
limit and then assume the limit is non-None.
Diffstat (limited to 'synapse/rest/client/room.py')
-rw-r--r--synapse/rest/client/room.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/rest/client/room.py b/synapse/rest/client/room.py
index b6dedbed04..01e5079963 100644
--- a/synapse/rest/client/room.py
+++ b/synapse/rest/client/room.py
@@ -729,7 +729,9 @@ class RoomInitialSyncRestServlet(RestServlet):
         self, request: SynapseRequest, room_id: str
     ) -> Tuple[int, JsonDict]:
         requester = await self.auth.get_user_by_req(request, allow_guest=True)
-        pagination_config = await PaginationConfig.from_request(self.store, request)
+        pagination_config = await PaginationConfig.from_request(
+            self.store, request, default_limit=10
+        )
         content = await self.initial_sync_handler.room_initial_sync(
             room_id=room_id, requester=requester, pagin_config=pagination_config
         )