fix(carddav): make paginated contact searches deterministic - #62287
Open
joshtrichards wants to merge 2 commits into
Open
fix(carddav): make paginated contact searches deterministic#62287joshtrichards wants to merge 2 commits into
joshtrichards wants to merge 2 commits into
Conversation
Order matching card IDs before applying limit and offset so paginated CardDAV searches return stable result sets across database backends. Signed-off-by: Josh <josh.t.richards@gmail.com>
Extract the shared CardDAV search fixture and verify stable ordering for limited and offset contact-search results. Keep the existing general search test as-is (order-agnostic): unlimited searches do not promise an order, while pagination requires a stable result order. Signed-off-by: Josh <josh.t.richards@gmail.com>
joshtrichards
marked this pull request as ready for review
July 17, 2026 19:08
joshtrichards
requested review from
SebastianKrupinski and
hamza221
as code owners
July 17, 2026 19:08
CarlSchwan
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Make CardDAV contact search results deterministic when
limitoroffsetis used.The search query now orders matching card IDs before pagination and preserves that order when loading the matching cards. This avoids unstable limited search results across database backends.
Also add test coverage for stable
limit/offsetpagination results and extract the shared CardDAV search fixture.The existing general search test remains order-agnostic because unlimited searches do not promise a result order.
This was identified while investigating a failing PHPUnit MySQL job:
https://github.com/nextcloud/server/actions/runs/29437750990/job/87428653205?pr=62200
This change does not itself explain or fix the empty result from that job, but it fixes an independent issue with paginated search results.
Checklist
3. to review, feature component)stable32)AI (if applicable)