Repository navigation
fix(cache): always treat zero-lifetime entries as stale - #5980
Merged
Merged
Conversation
Milo was vendored as lib/milo/{simd,no-simd}.js in #5954, but #5935
was written against the previous lib/milo/src/*/index.js layout, so the
'ordinary esbuild bundles retain experimental Milo' test fails on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xf8iHe9HroHgZuP6UXGZnx
Signed-off-by: Matteo Collina <hello@matteocollina.com>
The vendored Milo layout from #5954 has no binary/ or src/ directories. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xf8iHe9HroHgZuP6UXGZnx Signed-off-by: Matteo Collina <hello@matteocollina.com>
Responses stored with a zero freshness lifetime (e.g. max-age=0 with an etag) get staleAt === cachedAt. isStale() used `now > staleAt`, so a reuse in the same millisecond as the store (or after the clock stepped back) served the entry as fresh without revalidation. This made 'stores response with max-age=0 and etag, revalidates it on reuse' flaky on CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xf8iHe9HroHgZuP6UXGZnx Signed-off-by: Matteo Collina <hello@matteocollina.com>
mcollina
force-pushed
the
fix/cache-max-age-0-same-ms
branch
from
October 8, 2026 14:34
340a0f1 to
d76f50e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/bundle-parser-milo-paths #5980 +/- ##
================================================================
+ Coverage 91.52% 91.54% +0.01%
================================================================
Files 113 113
Lines 43594 43597 +3
================================================================
+ Hits 39901 39911 +10
+ Misses 3693 3686 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ronag
approved these changes
Oct 8, 2026
4 of 5 tasks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a flaky failure of
stores response with max-age=0 and etag, revalidates it on reuse(e.g. https://github.com/nodejs/undici/actions/runs/37791061280/job/113358249444?pr=5979), which is a real bug rather than a test issue.Responses stored with a zero freshness lifetime (e.g.
max-age=0with an etag) getstaleAt === cachedAt.isStale()usednow > result.staleAt, so a reuse within the same millisecond as the store (when theDateheader contributes no apparent age), or after the clock stepped back, served the entry as fresh without revalidation.isStale()now also treatsstaleAt <= cachedAtas stale. This only affects zero-lifetime entries; the existing millisecond boundary for other entries (covered bycache-revalidate-stale.js) is unchanged.Added a deterministic regression test that freezes
Dateso both requests observenow === staleAt; it fails without the fix and passes with it.