Skip to content

fix(dav): ignore paginated pages with evicted cache entries - #66113

Open
lazerg wants to merge 1 commit into
nextcloud:masterfrom
lazerg:fix/issue-65080-paginate-evicted-entries
Open

lazerg wants to merge 1 commit into
nextcloud:masterfrom
lazerg:fix/issue-65080-paginate-evicted-entries

Conversation

@lazerg

@lazerg lazerg commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

When the pagination cache loses individual entries but keeps the count key, PaginatePlugin::onMethod() passed null to XMLWriter::writeRaw() and the request failed with a 500. The loop now stops at the first missing entry, and the request is handled like one without a pagination token.

AI disclosure: this change was prepared with Claude (claude-opus-5-5) and reviewed by me.

Fixes #65080

@lazerg
lazerg requested a review from a team as a code owner October 31, 2026 08:08
@lazerg
lazerg requested review from CarlSchwan, come-nc, provokateurin and sorbaugh and removed request for a team October 31, 2026 08:08
Comment on lines +129 to +132
$items = iterator_to_array($this->cache->get($url, $token, $offset, $count), false);
if (in_array(null, $items, true)) {
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loads all items in memory instead of streaming using the generator.
Can you explain better what you are trying to fix?
When is null yielded by the cache?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The null comes from PaginateCache::get() when the count key is still there but one of the row entries was evicted (typical with APCu as the only cache, see #62538), so writeRaw(null) throws and the request 500s. It streams from the generator again now and just stops at the first missing entry, then falls back to the normal response.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: lazerg <lazerg2@gmail.com>
@lazerg
lazerg force-pushed the fix/issue-65080-paginate-evicted-entries branch from 793b0fa to 92066ee Compare November 9, 2026 16:56

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: F-23 Paginated PROPFIND/SEARCH crashes when cached pages were evicted

2 participants