Fix a couple bugs causing missing search results
Another pair of related bugs that are not very frequent currently but will become much more severe once filtering is implemented. Right now it's only possible to trigger these with history visibility set to "joined" or "invited", but with filtering support they will be triggered by almost any filter that rejects some of the search results.
0cdf0328)
Steps to reproduce the next_batch bug (fixed by- Create a room with history-visibility=joined as user A
- Join the room as user B
- Send some messages as user A
- Leave
- Send some messages as user A (these will be invisible to user B)
- Join the room again as user B
- Make a search request for this room that will match all of the sent messages, with
limit
set to some value lower than the number of events created in step 3.
Expected result
Response contains a subset of visible events, and a next_batch
value that can be used to fetch the remaining results.
Actual result
Response contains a subset of visible events, but no next_batch
.
On element web, this shows up as "No more results" when there are more results that you would expect to be displayed.
3551a6ef)
Steps to reproduce the dropped events bug (fixed by- Create a room with history-visibility=joined as user A
- Join the room as user B
- Send some messages as user A
- Leave
- Send some messages as user A
- Join the room again as user B
- Send some messages as user A
- Make a search request for this room that will match all of the sent messages, with
limit
set to some value larger than the number of events created in step 7. - Continue making paginated search calls until you stop getting
next_batch
.
Expected result
All visible events (i.e. not including the ones from step 5) can be seen by paginating through several search requests using next_batch
.
Actual result
Every search call except the first one is missing several events.