Repository navigation
Clear the game's service worker from the manual's host - #2347
Conversation
help.verticopolis.com served the game for a few minutes when its domain moved to Production before 4.5.0 deployed. A browser that opened it then installed the game's service worker on that host, and the worker kept answering every manual page, and every /help redirect that lands there, with the game's title screen until a hard reload. Every build now writes dist/help/sw.js, served as help.verticopolis.com/sw.js, with the same self-removing worker previews use: the browser's next update check installs it, it deletes Workbox's caches, unregisters, and reloads the page from the network, which now gets the manual. It carries its own first line, so the production worker check, which refuses the preview marker in dist/sw.js, is unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trYsinXUbmcSQZ3d6N7
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Focused review of
|
check-production-worker now also reads dist/help/sw.js and stops the deploy unless it is exactly the manual host's self-removing worker, so help.verticopolis.com can never go live without the file that clears a game worker a browser left there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trYsinXUbmcSQZ3d6N7
Re-review of
|
📸 Screenshot drift checkNo drift: the committed screenshots already match a fresh deterministic generation. ✅ |
Requested by Naftali · project thread
What & why
Urgent fix for 4.5.0, to ship as 4.5.1 right after merge.
help.verticopolis.com served the game for a few minutes after its domain moved to Production and before 4.5.0 (#2339) deployed. A browser that opened it in that window installed the game's service worker on the help host. That worker answers every manual page with the game's title screen (and the game then tidies the address, dropping the slash and
?from=game), until a hard reload. verticopolis.com/help links 308 to the same host, so they show the game too. The server itself is right:curl https://help.verticopolis.com/roomsreturns the manual.The help host never served a
sw.js(it was a 404), so the browser kept the stale worker. Every build now writesdist/help/sw.js, served as help.verticopolis.com/sw.js, with the same self-removing worker previews already use (src/build/previewDeploy.ts). The browser's next update check, after any navigation or the stale game page's own check, installs it, and it deletes Workbox's caches, unregisters and reloads the page from the network, which now gets the manual. The manual never registers a worker, so nothing reinstalls one.HELP_HOST_SERVICE_WORKERshares its lifecycle code withRETIRING_SERVICE_WORKERand has its own first line, so the production check that refuses the preview marker indist/sw.jsis unaffected.applyHelpHostWorkerwrites it fromscripts/preview-service-worker.ts, whichscripts/vercel-build.shalready runs after the help build, and fails if the help site wasn't built./sw.jswithmax-age=0, must-revalidate, and the help host's rewrite maps it to/help/sw.js.Type of change
Game mode impact
n/a: the manual's host only. The game's own worker and its origin are unchanged.
Quality gates
npm run typechecknpm run lintnpm test(CI.src/build/previewDeploy.test.tspasses locally, 22 tests, now running every lifecycle test against both workers.)npm run build(CI.node scripts/preview-service-worker.tsran locally and wrotedist/help/sw.js.)Versioning
.changesnote with the rightapp:andcrate:levels, or this PR changes no deployed pathpackages/verticopolis-engine/README.mdand/orengine-rs/CRATE_README.md, or read both and putreadmes: unchangedin the note, or this PR changes no engine sourceComplexity
n/a: no hot path. One build step writes one small file; the worker runs once per affected browser and removes itself.
Hot-path record (section 6): no hot-path surface
Screenshots / recordings
n/a: Naftali's report in the project thread shows the game's title screen at help.verticopolis.com/rooms. After deploy, help.verticopolis.com/sw.js should return the worker starting
// Verticopolis manual host.Notes for reviewers
Generated by Claude Code