fix(cache): compare tag revalidation timestamps - #2916
Conversation
|
/bigbonk |
commit: |
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dab5b34173
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/bigbonk |
|
CI follow-up: fixed the integration failure by separating high-resolution mutation ordering (lastModified) from wall-clock TTL policy (writtenAt) in both Memory and KV handlers. Existing KV entries remain compatible via the lastModified fallback. Local verification: exact failed sequence 2/2, full features file 355/355, related 8-file matrix 1,903/1,903, scoped checks/diff-check, and independent Standards + blast-radius reviews pass. Waiting for CI; not requesting re-review yet. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbd28c1de2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@james-elicx I think this is ready for another look now. I fixed the latest ISR review comments, and CI is green. Thanks! |
|
I think we should generate the timestamp and pass it through the adapter, then have it persist and return that instead |
Summary
use cache,unstable_cache, and tagged fetch entries only when they predate the latest matching revalidationThis follows the behavior introduced by vercel/next.js#96726 and commit 5da1c1ae03d2ee39c27a2d6d8807c573c46b37f9.
The separate JSON tag header is a deliberate vinext protocol extension: Next.js''s comma-delimited wire format cannot represent a legal tag containing a comma. New vinext peers prefer the authenticated JSON header; the standard header remains available to older peers for ordinary tags. Older peers cannot preserve comma-containing tags.
Closes #2819
Tests
tests/shims.test.ts,tests/fetch-cache.test.ts,tests/unified-request-context.test.ts,tests/revalidated-tags.test.ts,tests/app-server-action-execution.test.ts,tests/app-rsc-handler.test.ts,tests/features.test.ts,tests/isr-cache.test.ts, andtests/kv-cache-handler.test.tsvp checkscoped to all changed product/test files (format, lint, and types clean)git diff --checkAdversarial coverage includes repeated same-tag invalidation, fills straddling invalidation for all three public cache APIs, two-read Server Action dedupe before and after
updateTag, custom-handler old/new timestamps, authenticated redirect forwarding, comma-containing and JSON-looking legacy tags, protocol-header filtering, soft/hard tag handler behavior, and Memory/KV strict timestamp boundaries.