Skip to content

fix(cache): await development cache replacement - #3846

Open
onmax wants to merge 1 commit into
nuxt:mainfrom
onmax:local/content-cache-order
Open

fix(cache): await development cache replacement#3846
onmax wants to merge 1 commit into
nuxt:mainfrom
onmax:local/content-cache-order

Conversation

@onmax

@onmaxonmax commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🔗 Linked issue

No linked issue.

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Await development-cache deletion before inserting replacement rows, and await callers before initialization or HMR continues. Async db0 connectors could otherwise execute the delete after the insert, leaving a cold cache on the next startup; the HMR caller also stored its value and checksum in reverse order.

DescriptionGitHub
BeforeSecond initialization reparses all 30 documents.Source
AfterSecond initialization loads all 30 documents from cache.Source

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel

vercelBot commented Sep 5, 2026

Copy link
Copy Markdown

@onmax is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-newBot commented Sep 5, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/content@3846

commit: bd33b5f

@coderabbitai

coderabbitaiBot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 46a5e5ce-9f27-47e5-945f-4a51626ba02f

📥 Commits

Reviewing files that changed from the base of the PR and between 649d933 and c96b98b.

📒 Files selected for processing (4)
  • src/module.ts
  • src/types/database.ts
  • src/utils/dev.ts
  • test/unit/developmentCacheOrdering.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

insertDevelopmentCache now waits for deleteDevelopmentCache and its database delete operation before inserting replacement data. New tests verify write ordering, deletion error propagation, preservation of existing data after failure, both SQLite connectors, checksums, and values split across multiple rows.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk:⚪ Minimal · up to bd33b

Development-cache replacement now completes deletion before writing replacement rows, preventing stale deletion from removing newly written cache data. The updated asynchronous contract and cache behavior are covered without an identified remaining merge risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Title check✅ PassedThe title clearly and concisely describes the primary change: awaiting development cache replacement operations.
Description check✅ PassedThe description directly explains the cache ordering bug, the asynchronous database behavior, the caller updates, and the expected fix outcome.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@onmax
onmaxforce-pushed the local/content-cache-order branch from c96b98b to 57c8150CompareSeptember 5, 2026 08:49
@onmax
onmaxforce-pushed the local/content-cache-order branch from 57c8150 to bd33b5fCompareSeptember 5, 2026 08:50
Sign up for freeto 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

@onmax