Repository navigation
fix: recheck staleness on every call when the stale TTL is 0 - #138
Merged
Merged
Conversation
The snapshot provider reused its cached staleness result while now() - checkedAt > ttl. With staleTtlMs: 0 two calls in the same millisecond still shared the cache, so a file added in between was reported as stale:false. On a fast CI runner this made 'results flag a stale snapshot after the project changes' fail in the v0.9.0 publish run. The comparison is now >=, so a TTL of 0 never caches. Adds a frozen-clock regression test.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✅ Welcome ke DevMap!Terima kasih sudah buat PR. Pastikan checklist ini terpenuhi sebelum review:
CI akan jalan otomatis pada setiap update. Kalau gagal, akan muncul link run di komentar ini. Kalau DevMap membantu, tolong star ya: https://github.com/itsflaid/devmap Terima kasih kontribusinya! 🙏 |
This branch was previously deployed
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.
Problem
The v0.9.0 Publish run failed at "Test CLI" with 481/482 passing, so nothing was published to npm.
The failing test was a flake:
results flag a stale snapshot after the project changes(staleTtlMs: 0).snapshotProviderreused its cached staleness result whilenow() - checkedAt > ttl. With a TTL of 0, two calls in the same millisecond still shared the cache, so a file added between them was reported asstale: false. A fast runner makes that likely; it also failed about once in eight local runs.Fix
now() - staleCache.at >= ttl: a TTL of 0 never caches. The default 10s TTL behaves as before.Checks
pnpm test:cli: 483 pass, 0 failRelease
0.9.0 was never published to npm, so
package.jsonstays at 0.9.0. The existingv0.9.0tag points at the failed run's commit and needs to be moved to the merge of this PR before publishing again.Generated by Claude Code