Repository navigation
Players get updates straight away (fresh files and a quick switch) - #41
Merged
Merged
Conversation
After an update, the saved copy of the game started first, so a player's first visit still ran the old version (no insights, and still the iPhone Bit freeze). - When the new version takes over while the player is still on the start menu with no panel open, the page reloads into it. Otherwise a toast says it loads next time, so nothing in progress is lost. - The service worker fetches files with cache: 'reload' when installing and 'no-cache' when refreshing, so it never stores the browser's old copies (our server lets browsers keep files for 4 hours). - sw.js -> v30. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
After an update, players' first visit still ran the old version of the game. The service worker serves the saved copy first and only downloads the new one in the background, and the new one only started on the next visit. So the insights and the iPhone Bit fix from #40 reached nobody on their first visit.
Changes
controllerchange) and the player is still on the start menu, with no panel open and not typing, the page reloads into it. Otherwise a toast says "A new version of MiniCrafter is ready. It loads next time you open the game." First visits (no earlier version) never reload.cache: 'reload'and refreshes withcache: 'no-cache'. Our server lets browsers keep.jsfiles for 4 hours, and without this the offline copy could pick up those old files. I couldn't reproduce that in Chrome, so this is a safeguard; revalidating costs only a small "not changed" reply.sw.js→minicrafter-v30.Testing
SMOKE_CHANNEL=chrome node tests/smoke.mjs: all checks pass, including the offline reload.sw.jsisminicrafter-v30.Players who already have v29 run code without the auto-switch, so they get v30 on their next visit and the quick switch from then on.
🤖 Generated with Claude Code