Skip to content

LocalJam v2026.09.108

Choose a tag to compare

@github-actions github-actions released this 21 Sep 22:52
Immutable release. Only release title and notes can be modified.

LocalJam v2026.09.108

Live Deployment & App Access

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.