Skip to content

Commit

Permalink
Request a handful more when filtering ACLs so that we can try to avoi…
Browse files Browse the repository at this point in the history
…d shortchanging the requester
  • Loading branch information
reivilibre committed Dec 20, 2023
1 parent 8862c6c commit 7693ec9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions synapse/handlers/room_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7693ec9

Please sign in to comment.