fix(pwa): re-enable Workbox precaching (remove injectionPoint override)#611
Merged
7w1 merged 3 commits intoSableClient:devfrom Apr 16, 2026
Merged
fix(pwa): re-enable Workbox precaching (remove injectionPoint override)#6117w1 merged 3 commits intoSableClient:devfrom
7w1 merged 3 commits intoSableClient:devfrom
Conversation
e0162bd to
58176a6
Compare
7w1
approved these changes
Apr 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Restores Workbox InjectManifest precaching so the PWA service worker correctly receives and routes the __WB_MANIFEST, fixing cold-start/offline behavior regressions introduced by disabling manifest injection.
Changes:
- Remove the extra
self.__WB_MANIFESTreference insrc/sw.tsby dropping theifguard, leaving a single injection point. - Remove the
injectionPoint: undefinedoverride invite.config.tsso Workbox injects the precache manifest again. - Add a changeset documenting the precaching fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
vite.config.ts |
Re-enables Workbox manifest injection (and adjusts precache options). |
src/sw.ts |
Ensures exactly one self.__WB_MANIFEST reference for Workbox InjectManifest. |
.changeset/workbox-precaching.md |
Adds release note entry for the precaching fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+179
to
+183
| // element-call is a self-contained embedded app; exclude its large assets | ||
| // from the SW precache manifest (they are not part of the Sable shell). | ||
| globIgnores: ['public/element-call/**'], | ||
| // The app's own crypto WASM and main bundle exceed the 2 MiB default. | ||
| maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, // 10 MiB |
7w1
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
injectionPoint: undefinedwas set invite.config.tsto silence a WorkboxAssertionErrorabout multipleself.__WB_MANIFESToccurrences (anifguard insw.tsplus theprecacheAndRoute()call = two matches; Workbox requires exactly one). The unintended consequence: Workbox never injected the precache manifest, so no assets were precached — every cold start hit the network instead of serving from cache, and offline use was broken entirely.Fix: remove the
ifguard insw.ts(leaving exactly oneself.__WB_MANIFESTreference) then removeinjectionPoint: undefinedfromvite.config.tsto restore normal precaching behaviour.Fixes #
Type of change
Checklist:
AI disclosure:
The root cause diagnosis (two
self.__WB_MANIFESTreferences causing Workbox to silently skip injection) was identified with AI assistance. I verified the fix by checking Workbox'sinjectionPointbehaviour and confirming precaching was restored.