From 7693ec9799677f8c39923b911c94be51c9a1798a Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Wed, 20 Dec 2023 16:37:10 +0000 Subject: [PATCH] Request a handful more when filtering ACLs so that we can try to avoid shortchanging the requester --- synapse/handlers/room_list.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py index fb3693c70f1..25d32432eae 100644 --- a/synapse/handlers/room_list.py +++ b/synapse/handlers/room_list.py @@ -176,8 +176,16 @@ async def _get_public_room_list( forwards = True has_batch_token = False - # we request one more than wanted to see if there are more pages to come - probing_limit = limit + 1 + if from_federation_origin is None: + # Client-Server API: + # we request one more than wanted to see if there are more pages to come + probing_limit = limit + 1 + else: + # Federation API: + # we request a handful more in case any get filtered out by ACLs + # as a best easy effort attempt to return the full number of entries + # specified by `limit`. + probing_limit = limit + 10 results = await self.store.get_largest_public_rooms( network_tuple,