Fix PWA install flow and offline support (#288)#301
Merged
MaryammAli merged 4 commits intoJul 16, 2026
Conversation
…nt PWAHandler in layout, fix broken manifest icons (icon.png was a JPEG mislabeled .png, blocking installability)- Add appleWebApp metadata and viewport export for iOS home-screen installs- Rewrite sw.js caching: network-first for navigations, cache-first for static assets and manifest, no caching for /api or cross-origin requests- Fix handleAsset to fail gracefully (408) instead of throwing when offline and asset isn't cached- Persist install banner dismissal for 7 days, add iOS standalone detection- Document PWA architecture, caching strategy, and offline testing in README
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.
Tested with Playwright offline after warming the cache hard nav and client-side nav between all main routes work fine offline now, no crashes, no ChunkLoadErrors. Install flow tested manually, works, DevTools shows no manifest/SW errors.
Heads up: offline console throws a decent amount of noise (RSC prefetch failures, background polling failing) but none of it actually breaks anything, just don't be alarmed if you see red in the console testing this yourself.
Two things I found but didn't touch since they're outside this issue:
get RustAcademyApiBaseinstead ofgetRustAcademyApiBase) that breaks tsc and next build entirely. Confirmed it's on clean main already, nothing to do with this PR.