Skip to content

fix(carddav): make paginated contact searches deterministic - #62287

Open
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-carddav-searches-prod-and-tests
Open

fix(carddav): make paginated contact searches deterministic#62287
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-carddav-searches-prod-and-tests

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Jul 17, 2026

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Make CardDAV contact search results deterministic when limit or offset is 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/offset pagination 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

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

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 joshtrichards added bug 2. developing Work in progress feature: carddav Related to CardDAV internals labels Jul 17, 2026
@joshtrichards joshtrichards added this to the Nextcloud 35 milestone Jul 17, 2026
@joshtrichards
joshtrichards marked this pull request as ready for review July 17, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress bug feature: carddav Related to CardDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants