Skip to content

fix(appstore): store the payload cache as lazy app config - #511

Merged
rubenvdlinde merged 2 commits into
developmentfrom
fix/appstore-payload-cache-lazy
Oct 7, 2026
Merged

rubenvdlinde merged 2 commits into
developmentfrom
fix/appstore-payload-cache-lazy

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What

The App Store payload cache (appstore.payload.* and appstore.payload_ts.*) is now lazy app config, on read and on write. A new repair step, MarkPayloadCacheLazy, marks the rows already stored as lazy, on upgrade and on install.

Why

Nextcloud loads every non-lazy app-config row of every app on every request. The cache holds one payload per managed app (about 4 MB for mail alone), so on the dev instance it put 1,660 rows and 36 MB into that preload. Measured on 2026-10-06:

before after flipping the rows to lazy
eager preload query 280 to 370 ms 5 ms
status.php about 450 ms about 55 ms

That made every page of the instance slow, not only this app's.

Verified

  • New testPayloadCacheIsReadAndWrittenLazy fails against the old source ("must be written lazy") and passes with the fix.
  • MarkPayloadCacheLazyTest: flips only payload keys, and one failing key does not abort the step.
  • Full unit suite: 755 tests green. composer check:strict: lint and psalm green.

Inherited

cs:check flags @param alignment in RemoveRetiredCronJobs.php and its test. Neither file is touched here.

🤖 Generated with Claude Code

Nextcloud preloads every eager app-config row on every request. The App
Store payload cache (one row per managed app, ~4 MB for mail) was eager,
so a dev instance carried 1,660 rows / 36 MB in that preload and paid
~300 ms on every request of every app. Read and write the keys lazy, and
add a repair step that flips the rows already stored.
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/versioniq @ 811f699

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
composer ✅ ✅ 32/32
npm ✅ ✅ 302/302
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ✅
Newman ⏭️
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-10-06 13:28 UTC

Download the full PDF report from the workflow artifacts.

…eLazy

A repair step only runs when <version> moves; without it occ upgrade answers
"No upgrade required" and the payload rows stay eager (gate-110).
@rubenvdlinde
rubenvdlinde merged commit 33427d9 into development Oct 7, 2026
32 of 34 checks passed
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.

1 participant