Skip to content

fix(pwa): automatically recover offline screen when connectivity returns - #536

Merged
hoangsvit merged 5 commits into
stagingfrom
fix/pwa-offline-auto-reconnect-20261120
Nov 20, 2026
Merged

hoangsvit merged 5 commits into
stagingfrom
fix/pwa-offline-auto-reconnect-20261120

Conversation

@hoangsvit

Copy link
Copy Markdown
Member

Problem

The cached PWA offline.html screen only exposed a manual reload button. Restoring Wi-Fi/mobile data left listeners on the offline page until they clicked Retry, even though the player already has a separate autoReconnect stream recovery setting.

Changes

  • Add connection recovery on the offline page: immediate online event handling, a lightweight same-origin manifest probe on entry / foreground, and a 3–15 s bounded exponential retry interval in case online is not dispatched.
  • Verify a valid fresh response before navigating, use the current service-worker scope (including PR preview paths), and keep the existing page URL on reload.
  • Suspend polling while hidden and prevent concurrent probes / reload loops. Preserve a manual Retry button and all 7 existing translations, with an accessible connection state.
  • Bump the offline cache version so existing installed PWAs eventually receive the new fallback page without replacing active sessions.
  • Add regression tests for online/manual recovery, invalid response, retry backoff, preview scope and foreground behavior; update PWA QA documentation.

Safety

  • Do not cache/play audio while offline; no stream/source URL is exposed.
  • No changes to the player lifecycle or autoReconnect preference.
  • No autoplay on page reload. No SEO / canonical / GA4 changes.

Validation

  • Added Node test coverage in tests/pwa-reconnect.test.mjs and updated tests/pwa-install-shell.test.mjs.
  • GitHub CI to validate before moving out of draft. Real-device Android/iOS checks still needed.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

ePlus OnAir — PR Preview

🗃️ Preview expired. This PR is closed; the Preview link is hidden.

View build status

Preview is noindex; the full catalog is available on Staging after merge.

@hoangsvit
hoangsvit marked this pull request as ready for review November 20, 2026 06:24
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

This branch was successfully deployed

1 active deployment
preview — 024ea915 Deployed Nov 20, 2026 by hoangsvit via Remove closed PR Preview #545
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