Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides paging support for our searches. SQLite running in worker thread does not support cursors as there is not a way to serialize cursors over the postMessage boundary. So instead each search result returns the realm version that the search query ran against. For subsequent pages we can provide the realm version of the first page of results to hold the result set stable while we page through it. There was a minor adjustment to only cleanup old realm versions on generation changes instead of each update to the index so that older versions can remain available for pagination. It's not possible to paginate thru a generation change, but that should be fine since generation changes only happen when the realm does a full index which is during realm startup.