You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a492a14
Browse filesBrowse the repository at this point in the historyBrowse files
fix(pwa,landing): survive deploys in the service worker; restore per-format create entries
Production broke after deploy for returning visitors: the SW-cached stale
index.html referenced hashed assets that no longer exist, and the 404's HTML
body was handed to the CSS parser ("Refused to apply style… text/html") —
layout collapsed (body height 100% gone → editor iframe at 0px) while the
still-cached JS kept working.
sw.js rewrite:
- HTML navigations fetch with cache: 'no-cache' (revalidate with the server;
a stale HTTP-cache HTML is exactly what pinned old asset hashes)
- Split core (precached shell + HTML, never trimmed) from runtime cache
(SWR, 600-item cap — the old single 100-cap cache was evicted constantly
by OnlyOffice's hundreds of assets, including its own shell)
- /assets/* 404s return Response.error() instead of an HTML body, and
re-fetch a fresh shell so the next navigation self-heals
- activate() clears every previous version's caches
Guards & gaps:
- lang-select change handler only navigates on a real locale switch — a
same-locale (or init-time) change no longer reloads the page and wipes
?new=/?locale= deep links
- Homepage regained create entries for every format: a quiet mono
"start blank: Word · Excel · PowerPoint" row under the CTAs (EN + zh-CN),
using the existing ?new= deep links (the FAB menu only exists once a
document is open, so xlsx/pptx creation had no homepage entry at all)
Verified: ?new=xlsx boots the spreadsheet editor at full height; clean-env
production check confirms current deploy is intact (the breakage is the old
SW's cache state, which this sw.js version replaces on next visit);
format/lint/240 tests/build green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments