Asset stamps become content hashes — version stamps bust nothing

Eric's screenshot showed week-old CSS again, straight through the
cache-buster: the stamp was the app VERSION, unchanged at 1.0.0 since
release, so every stylesheet change shipped at the same ?v= URL and
browsers rightly kept their copies. The stamp is now an 8-char hash
over the static bundle's bytes — it changes exactly when the files do,
releases or not. The test now pins that property instead of the
version equality it used to celebrate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g
This commit is contained in:
Eric Wagoner
2026-08-09 14:10:54 -04:00
co-authored by Claude Fable 5
parent 708883313f
commit 446579e96c
2 changed files with 27 additions and 8 deletions
+8 -3
View File
@@ -689,9 +689,14 @@ def test_pipeline_counts_pending_work_not_queue_rows(tmp_path):
def test_assets_are_version_stamped(tmp_path):
"""A cached stylesheet from last week must not survive an upgrade:
asset URLs carry the app version."""
from bggpipe import __version__
import re
html = _app(_cfg(tmp_path)).get("/").text
assert f"/static/app.css?v={__version__}" in html
assert f"/static/app.js?v={__version__}" in html
(stamp,) = set(re.findall(r'/static/app\.css\?v=([0-9a-f]{8})"', html))
assert f"/static/app.js?v={stamp}" in html
assert "__ASSET_V__" not in html
# the stamp is a CONTENT hash: it must change when the css changes,
# not when the release version does — that was the original sin
from bggpipe import webreview
assert stamp == webreview._asset_stamp()