fix(hub): drop hub PWA install to unblock standalone PWAs (#41) #44
No reviewers
Labels
No labels
app:activities
app:chat
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp!44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-41-drop-hub-pwa"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #41. The hub's manifest had
scope: '/', which claimed the entireapp.${domain}origin and made Chrome treat the path-mounted standalones (/libra/,/market/,/sortir/, …) as sub-areas of the already-installed hub PWA — suppressing the install affordance on each standalone.Drop the hub's PWA install entirely. The hub is a tile-grid launcher; users install the standalones they actually use. The libra/market/sortir/etc. PWAs at deeper scopes are unaffected and remain independently installable.
Changes
vite.config.ts— removed theVitePWA(...)plugin block (and its import). No more manifest, no more SW registration, no more<link rel="manifest">injection on the hub.src/main.ts— droppedregisterSWfromvirtual:pwa-register. AddeddecommissionHubServiceWorker()to clean up legacy SW registrations on existing-user upgrades.src/lib/decommission-hub-sw.ts(new) — idempotent helper that unregisters any SW with scope ===${origin}/. Standalone SWs at deeper scopes (/libra/,/market/, …) are left alone. Safe to leave in place permanently.public/sw.js— deleted. It was the source for a deprecatedinjectManifeststrategy that hadn't been wired up; copied verbatim todist/by Vite but never referenced.Verification
Built locally and confirmed the dist no longer contains
sw.js,manifest.webmanifest, or<link rel="manifest">inindex.html.Headed Chromium (Playwright MCP) at iPhone-13 viewport against the dev hub:
End-to-end browser verification of the production-side scope conflict is captured in #41 comment.
What this does NOT do
apple-mobile-web-app-*meta tags are independent of manifest install). Removing them is a separate decision; left in place to keep the diff focused on the Chrome scope-conflict bug.Test plan
npm run build— nosw.js, nomanifest.webmanifestindist/.app.${domain}on a Chrome desktop instance that previously had the hub PWA installed: console shows[decommission-hub-sw] Unregistering 1 legacy hub service worker(s).andgetRegistrations()is empty after.libra.${domain}(which 301s toapp.${domain}/libra/): Chrome offers PWA install. Repeat for market/sortir/wallet/chat/forum/tasks.app.${domain}/libra/etc. still register their own SWs (scope =/libra/, etc.) and are unaffected.🤖 Generated with Claude Code