mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 19:20:16 +00:00
4fea813adc
Container restart / in-place upgrade left the previous service worker still controlling open tabs. Its fetch handler intercepted 'static/style.css', matched the unversioned URL exactly against its old shell cache, and returned the OLD CSS — while the JS files (which already carry ?v=__WEBUI_VERSION__) hit the cache as misses and loaded fresh from network. New JS + old CSS broke the layout until a force refresh bypassed the SW. Fix is a 1-line attribute change plus aligning the SW pre-cache list: * static/index.html: add ?v=__WEBUI_VERSION__ to the style.css link, matching the pattern already in use for every JS file in the page. * static/sw.js: add the same ?v=__CACHE_VERSION__ suffix to every versioned entry in SHELL_ASSETS so that pre-cache URLs match what the page actually requests. Unversioned entries (root, manifest, favicons) stay unversioned. Tests: * New regression test_index_versions_stylesheet (lock the href) and test_sw_shell_assets_match_versioned_asset_urls in test_pwa_manifest_sw.py. * test_workspace_panel_preload_marker_restored_in_head in test_sprint37.py loosened to match the css link prefix (preserves the ordering invariant). Verified live on port 8789: served HTML carries 'static/style.css?v=v0.50.275-dirty' and SW SHELL_ASSETS receive the matching VQ at request time. Closes #1507.