Compare commits

...

2 Commits

Author SHA1 Message Date
03597d37f0 fix(release): keep index.html's cache-busting version tags in sync
Some checks are pending
Test and SonarQube / quality (push) Waiting to run
static/index.html hardcodes ?v= query strings on style.css, the per-page
CSS files and loader.js, plus an app-version meta tag. Nothing kept them
in sync with VERSION, so they'd silently drifted to different stale
versions each (found live: style.css one release behind, loader.js
sixteen releases behind). The static-file middleware marks any CSS/JS
request with a ?v= query as max-age=31536000 immutable, so a browser
that had ever loaded e.g. magazine.js?v=1.26.10 kept serving that exact
response for a year no matter how many times the file changed on disk
or how hard the page was force-reloaded.

release.py now rewrites every ?v=X.Y.Z and the app-version meta tag to
the new version on every release, so a release is what invalidates the
cache rather than a manual, easy-to-forget edit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 20:28:46 +02:00
dd19ce1e5d Release v1.43.1 2026-09-22 20:28:36 +02:00
4 changed files with 45 additions and 11 deletions

View File

@ -7,6 +7,13 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
## [Unreleased]
---
## [1.43.1] — 2026-09-22
### Fixed
- **Front-end changes could appear to never take effect, no matter how hard the page was reloaded.** `static/index.html` hardcodes `?v=` cache-busting query strings on `style.css`, the per-page CSS files and `loader.js`, plus an `<meta name="app-version">` tag — nothing kept these in sync with `VERSION`, so they had silently drifted to different stale versions each (found live: `style.css` one release behind, `loader.js` sixteen releases behind). The server's static-file middleware marks any CSS/JS request *with* a `?v=` query as `Cache-Control: public, max-age=31536000, immutable` — a reasonable rule for genuinely fingerprinted assets, but since these tags never changed, a browser that had ever loaded e.g. `magazine.js?v=1.26.10` kept serving that exact response for a year, regardless of how many times the file changed on disk or how hard the page was force-reloaded. `scripts/release.py` now rewrites every `?v=X.Y.Z` and the `app-version` meta tag to the new version on every release, so a release is what actually invalidates the cache — not a manual, easy-to-forget edit.
## [1.43.0] — 2026-09-22
### Added
@ -4314,7 +4321,8 @@ Initial feature-complete release.
---
[Unreleased]: https://github.com/mARTin-B78/tts-voice-creator-clone-and-design-2/compare/v1.26.10...HEAD
[Unreleased]: https://github.com/mARTin-B78/tts-voice-creator-clone-and-design-2/compare/v1.43.1...HEAD
[1.43.1]: https://github.com/mARTin-B78/tts-voice-creator-clone-and-design-2/compare/v1.43.0...v1.43.1
[1.26.10]: https://github.com/mARTin-B78/tts-voice-creator-clone-and-design-2/compare/v1.26.9...v1.26.10
[1.26.9]: https://github.com/mARTin-B78/tts-voice-creator-clone-and-design-2/compare/v1.26.8...v1.26.9
[1.26.1]: https://github.com/mARTin-B78/tts-voice-creator-clone-and-design-2/compare/v1.26.0...v1.26.1

View File

@ -1 +1 @@
1.43.0
1.43.1

View File

@ -32,9 +32,31 @@ from pathlib import Path
REPO_ROOT = Path(__file__).parent.parent
VERSION_FILE = REPO_ROOT / "VERSION"
CHANGELOG_FILE = REPO_ROOT / "CHANGELOG.md"
INDEX_HTML_FILE = REPO_ROOT / "static" / "index.html"
GITHUB_REPO = "mARTin-B78/tts-voice-creator-clone-and-design-2"
GITHUB_BASE = f"https://github.com/{GITHUB_REPO}"
# static/index.html hardcodes ?v= cache-busting query strings on style.css,
# the per-page CSS files and loader.js, plus an <meta name="app-version">
# tag. Nothing previously kept these in sync with VERSION, so they silently
# drifted to different stale versions each (seen live: style.css one release
# behind, loader.js sixteen releases behind) -- StaticCacheHeadersMiddleware
# in server.py marks any *.css/js request WITH a ?v= query
# "Cache-Control: public, max-age=31536000, immutable", so once a browser
# had fetched e.g. magazine.js?v=1.26.10 it kept serving that exact response
# for a year regardless of how many times the file changed on disk or how
# hard the page was reloaded. Rewriting every ?v=X.Y.Z to the new version on
# every release is what actually invalidates that cache.
_VERSION_QUERY_RE = re.compile(r"(\?v=)\d+\.\d+\.\d+")
_APP_VERSION_META_RE = re.compile(r'(<meta name="app-version" content=")[^"]*(")')
def bump_index_html(new_str: str) -> str:
html = INDEX_HTML_FILE.read_text()
html = _VERSION_QUERY_RE.sub(rf"\g<1>{new_str}", html)
html = _APP_VERSION_META_RE.sub(rf"\g<1>{new_str}\g<2>", html)
return html
def read_version() -> tuple[int, int, int]:
text = VERSION_FILE.read_text().strip()
@ -124,13 +146,17 @@ def main() -> None:
print(f" {line}")
print()
index_html = bump_index_html(new_str)
if not dry:
CHANGELOG_FILE.write_text(changelog)
VERSION_FILE.write_text(new_str + "\n")
INDEX_HTML_FILE.write_text(index_html)
print(f" ✓ Wrote VERSION → {new_str}")
print(f" ✓ Wrote CHANGELOG.md")
print(f" ✓ Wrote static/index.html cache-busting tags → {new_str}")
git("add", "VERSION", "CHANGELOG.md")
git("add", "VERSION", "CHANGELOG.md", "static/index.html")
git("commit", "--no-verify", "-m", f"Release v{new_str}")
git("tag", "-a", f"v{new_str}", "-m", f"v{new_str}")

View File

@ -10,7 +10,7 @@
<meta name="format-detection" content="telephone=no">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#2563EB">
<meta name="app-version" content="1.34.1">
<meta name="app-version" content="1.43.1">
<link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="/static/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/static/icon.svg">
@ -27,12 +27,12 @@
<!-- ── Core styles (local — no CDN dependency for first paint) ────────── -->
<link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css">
<link rel="stylesheet" href="/static/style.css?v=1.42.3">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.42.3">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.42.3">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.42.3">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.42.3">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.42.3">
<link rel="stylesheet" href="/static/style.css?v=1.43.1">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.43.1">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.43.1">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.43.1">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.43.1">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.43.1">
<!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── -->
@ -403,7 +403,7 @@ window.toggleNavTree = function(treeId, chevronId) {
</script>
<!-- loader.js: fetches sections → loads JS modules → removes skeleton -->
<script src="/static/loader.js?v=1.26.10"></script>
<script src="/static/loader.js?v=1.43.1"></script>
</body>
</html>