Skip to content

Fix PWA offline precaching on fresh installs#49

Merged
wpgaurav merged 1 commit into
mainfrom
codex/fix-pwa-offline-cache
Jul 22, 2026
Merged

Fix PWA offline precaching on fresh installs#49
wpgaurav merged 1 commit into
mainfrom
codex/fix-pwa-offline-cache

Conversation

@wpgaurav

Copy link
Copy Markdown
Owner

Summary

  • return HTTP 200 for the cacheable PWA offline application shell
  • handle the first functionalities_pwa option save through added_option
  • add regression coverage for first-save hooks and the offline response
  • keep the fix in the 1.4.8 changelog

Root cause

The service worker precaches the offline URL with cache.addAll(), which rejects the previous HTTP 503 response. On a fresh installation, WordPress also fires added_option instead of updated_option, so the plugin did not register and flush the new PWA rewrites after the first settings save.

Validation

  • composer check: 19 tests, 69 assertions
  • distribution ZIP rebuild and integrity check
  • fresh WordPress Studio install on WordPress 7.0.2 / PHP 8.2
  • first PWA option creation produced working rewrites immediately
  • offline shell, manifest, and service worker each returned HTTP 200

@wpgaurav
wpgaurav marked this pull request as ready for review July 22, 2026 04:53
@wpgaurav
wpgaurav merged commit 7ec31cc into main Jul 22, 2026
9 checks passed
@wpgaurav
wpgaurav deleted the codex/fix-pwa-offline-cache branch July 22, 2026 04:53
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