Repository navigation
Fix: fail the cache-busting check on a stale stamp - #92
Merged
Merged
Conversation
--check computed the correct hash for every reference and noticed the file differed, but only counted it. Only a reference with no ?v= at all failed the check, so an edited stylesheet or module shipped behind a stamp naming content it no longer had, and browsers kept serving the cached copy. Report those references and fail on them, naming the reference and the hash its content now has. Cover it with a test that copies the tree, breaks one stamp and asserts the check exits non-zero.
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.
Summary
--checkcomputed the correct hash for every asset reference and detected that the file differed, but only added it to a counter. The single failure condition was a reference with no?v=at all, so a stale stamp passed.ui/andscripts/to a temporary tree, breaks one stamp and asserts the check exits non-zero.Effect of the bug: editing a stylesheet or module without restamping produced a reference naming content the file no longer had. Browsers kept serving the cached copy, leaving a page running a mix of versions after an upgrade. This is the same failure the unstamped-reference check already existed to prevent.
Testing
All green: 1184 backend tests, 802 frontend, lint, format, both typechecks and the cache-busting check. The new test was confirmed to fail with the fix reverted and pass with it, so it is not vacuous. Verified separately that the stricter check passes against the current
maintree, so it does not fail CI on existing content.Checklist