Skip to content

Prevent PWA version skew from disabling the UI - #6

Merged
aliorhun merged 4 commits into
mainfrom
fix/pwa-version-skew
Sep 28, 2026
Merged

aliorhun merged 4 commits into
mainfrom
fix/pwa-version-skew

Conversation

@aliorhun

Copy link
Copy Markdown
Contributor

Summary

Fixes the case where the page renders but all controls appear dead after a deploy.

Root cause

During a PWA update, an older cached HTML shell can briefly run with a newer JavaScript bundle. The newer bundle treated newly-added controls such as examples-btn / backup controls as mandatory and called .addEventListener() or updated text on a null element. That runtime exception stops the bundle before the rest of the UI finishes wiring.

Changes

  • make newly-added Examples and Backup controls null-safe
  • keep the rest of the app usable if an older cached HTML shell is paired with newer JS
  • stop the service worker from using skipWaiting() / clients.claim(), so it no longer takes over an already-open page mid-session
  • fetch mutable core assets network-first with cache: 'no-store'
  • keep offline fallback and precaching
  • extend verification to catch unsafe optional UI bindings and eager service-worker takeover

This is a compatibility hotfix for GitHub Pages/PWA deploy transitions.

@aliorhun
aliorhun merged commit df0653d into main Sep 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant