Two related dev-quality fixes that compose to remove a footgun.
1. Stale service worker self-cleanup (src/lib/dev-sw-cleanup.ts)
Even with VitePWA's devOptions.enabled now false (commit 613a925),
service workers registered during earlier dev sessions linger in
the browser and intercept navigations, often serving cached bundles
from the broken-config period. Manifested as: castle/chat/wallet
not redirecting to /login despite the new auth guard, forum/market
showing "Failed to Start: Cannot read properties of undefined" for
modules that aren't even in their standalone config, hub redirecting
to /market on refresh.
The new helper runs at app boot in dev only:
- enumerates navigator.serviceWorker.getRegistrations()
- unregisters every one of them
- clears caches.keys()
- reloads once (gated by sessionStorage to avoid loops)
In production builds it's a no-op — the legitimate SW registered
by virtual:pwa-register survives.
Wired into all 8 main.ts entry points (hub + 7 standalones).
2. Apple-mobile-web-app-capable deprecation (.html)
Browsers now warn that <meta name="apple-mobile-web-app-capable">
should be paired with the standardized <meta name="mobile-web-app-capable">.
Adding the standardized tag alongside (kept the apple variant for
older iOS Safari) on all 8 HTML entry points.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
901 B
HTML
20 lines
901 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
<link rel="icon" href="/favicon.ico" />
|
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180">
|
|
<link rel="mask-icon" href="/mask-icon.svg" color="#FFFFFF">
|
|
<title>Tasks — Work Orders</title>
|
|
<meta name="apple-mobile-web-app-title" content="Tasks">
|
|
<meta name="description" content="Decentralized task management on Nostr">
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<script type="module" src="/src/tasks-app/main.ts"></script>
|
|
</body>
|
|
</html>
|