element-hq / element-hq/synapse
List Room API is not returning as many rooms as one would expect
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#12080](https://github.com/matrix-org/synapse/issues/12080).
---
The [List Rooms API](https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#list-room-api), called without any query params, is not returning the default 100 rooms as advertised.
I have a reproducible test case for a current Synapse.
The response advertises that there are 119 `total_rooms` but it only returns 19. It advertises `next_batch` as 100, but calling the API again with `?offset=100` returns no rooms.
Some rooms have recently been deleted using (I believe) the new [Delete Room API](https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#version-2-new-version)
Contributor guide
Research direction
Start with the List Rooms API documentation and reproduce the request without query parameters, then repeat it with offset=100. Compare the advertised total_rooms and next_batch values with the returned rooms, including after rooms have been deleted through the Delete Room API. Done means pagination returns the expected rooms and metadata remains consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100