Skip to content

Stop an outdated tab from saving over newer progress (v0.11.2) - #54

Merged
weevilgenius merged 2 commits into
mainfrom
claude/project-thread-tkfohz
Oct 31, 2026
Merged

weevilgenius merged 2 commits into
mainfrom
claude/project-thread-tkfohz

Conversation

@weevilgenius

Copy link
Copy Markdown
Owner

Requested by Barry · project thread

Fixes item 4 from the Ponytail repo audit.

Each open copy of the game loads the save once and writes all of it back on every change and whenever it is hidden. Two copies (two tabs, or the installed app and a browser tab) overwrite each other: solve a puzzle in one, switch to the other and away, and the best time, stats and solve log entry are gone.

  • src/controller.ts: savedElsewhere() stops all saving, both the save and the solve log, and shows a notice in the existing storage banner.
  • src/index.ts: a storage event for the save key calls it. When an outdated copy comes back into view, it reloads and picks up the newer save. A copy left visible beside the other one keeps the notice instead of reloading, because reloading would save again and make the other copy reload in turn, in a loop.
  • src/controller.test.ts: two controllers share one store. One wins, and the outdated one retries and hides without overwriting the win.
  • v0.11.2 with a changelog line.

Checks: pnpm run check passes (324 tests). In Chromium with two tabs on the dev server, starting a puzzle in tab A showed the notice in tab B, and a visibility change made B reload into A's puzzle.


Generated by Claude Code

Each open copy of the game kept the save in memory and wrote all of it
back on every change and whenever it was hidden. With two tabs open, a
win in one was lost when the other was next hidden. Now a copy stops
saving as soon as another tab or window saves, shows a notice, and
reloads the newer save when it comes back into view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGfak3CRUUVwG8x6w8D3gr
@weevilgenius weevilgenius self-assigned this Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit ff7f13f):

https://stumped-game--pr54-claude-project-threa-0riqdxb9.web.app

(expires Sat, 07 Nov 2026 02:38:52 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: dfc2bf844eeac82ebd1846d84aacfdcd42e42a2f

@weevilgenius
weevilgenius merged commit 29e3a90 into main Oct 31, 2026
1 check passed
@weevilgenius
weevilgenius deleted the claude/project-thread-tkfohz branch October 31, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants