Skip to content

Update the service worker when retrying startup failures - #4430

Draft
akirk wants to merge 1 commit into
trunkfrom
fix/service-worker-startup-recovery
Draft

akirk wants to merge 1 commit into
trunkfrom
fix/service-worker-startup-recovery

Conversation

@akirk

@akirk akirk commented Oct 14, 2026

Copy link
Copy Markdown
Member

Users in #4419 recovered from startup failures by updating the service worker in DevTools and reloading. The “Try again” buttons on the remote hiccup screen and the website's application-load fallback now request that update, wait for the replacement worker to activate and control the page, and reload. A shared Vite plugin inlines the recovery function into both HTML pages so it remains available when application assets fail to load.

Recovery is user initiated and bounded to 15 seconds. Failed updates display the error and leave the button available for another attempt; successful recovery preserves the URL and browser storage. If there is no existing registration, the button reloads normally. This improves recovery and does not establish or fix the cause of the reported HTTP 403 responses.

Validation:

  • npm exec nx -- test playground-website --testFile=service-worker-recovery.spec.ts — six passing tests, including activation/control ordering, update rejection followed by retry, and timeout handling.
  • npm exec nx -- run-many -t typecheck -p playground-website playground-remote
  • npm exec nx -- run-many -t lint -p playground-website playground-remote
  • Real Chromium upgrade check: installed worker A, served worker B with a forced 403, verified the failure stayed visible without reloading, restored the response, and retried. Worker B took control, the page reloaded once, and the URL and an OPFS file were preserved.
  • Verified Vite injects the recovery function into both development HTML pages.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant