LocalJam v2026.09.108
Immutable
release. Only release title and notes can be modified.
LocalJam v2026.09.108
Live Deployment & App Access
- π Web App: https://varun.khaneja.org/LocalJam/
- π·οΈ Release Tag: v2026.09.108
- π¦ Repository Commit: c5931c37e10a072b11b79e2eac1a10e498eceea2
Commit Details
Subject: fix(pwa): resolve cold-boot service worker registration timing drop
Date: 2026-09-21 15:51:41 -0700
Commit Message
Root Cause:
initApp() in src/main.js deferred ServiceWorker registration and update
checker initialization exclusively to window.addEventListener('load').
Because initApp() is an async function that awaits IndexedDB initialization
(await db.init()) and playback state hydration (await hydratePlaybackState()),
the window 'load' event fired in standalone PWAs and mobile browsers before
the listener was attached. Because DOM events are not replayed for late listeners,
the 'load' callback was never dispatched, causing ServiceWorker registration
to be permanently dropped and update checking to remain inactive.
Remediation:
- In src/main.js: Check document.readyState === 'complete' to register the
ServiceWorker immediately, attach a { once: true } 'load' event listener
when loading, and provide a 2000ms fallback safety timer cancelled upon
registration execution. - In src/main.js: Instantiate initUpdateChecker synchronously during bootstrap
so periodic version polling and focus/visibility listeners start immediately. - In test/helpers/mock-dom.js: Add configurable document.readyState support.
- In test/ui/shell.test.js: Add automated tests verifying immediate registration
on 'complete' readyState and event-driven registration on 'loading' readyState.