Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Bump service-worker cache name v4 → v5 — root cause of why none of the speaker-modal scroll fixes appeared to work; sw.js caches /static/js/app.modular.js and /static/css/styles.css under CACHE_NAME, and the SW only invalidates its cache when CACHE_NAME changes; v4 was set months ago and never bumped through the entire v0.9.0 development cycle, so every browser that had visited the app once was serving the OLD cached app.modular.js regardless of how many git pulls happened on the dev server — that's why my edits looked like no-ops to the user; bumped to v5, also added a comment block above the constant pointing at the lesson; bump this whenever cached assets change going forward; users currently on v4 will pick up v5 on next visit, the SW activate event will delete the old cache and fetch the new asset list

Murtaza Nasira3f48a19352d
diff --git a/static/sw.js b/static/sw.js
index a15f7a4f..33a5e68d 100644
--- a/static/sw.js
+++ b/static/sw.js
@@ -1,4 +1,10 @@
-const CACHE_NAME = 'Speakr-cache-v4';
+// Bump this version whenever any cached asset (app.modular.js, styles.css,
+// vendor JS, the i18n module, the offline page) changes — otherwise the
+// service worker keeps serving the previously-cached copy and users see
+// stale code even after a hard refresh. Forgetting to bump this was what
+// made the speaker-modal scroll fixes appear to do nothing: the SW kept
+// serving the broken pre-fix app.modular.js.
+const CACHE_NAME = 'Speakr-cache-v5';
const ASSETS_TO_CACHE = [
'/',
'/static/offline.html',