Skip to content

fix now it saves skip state immediately in Puzzle Streak#2887

Merged
veloce merged 2 commits into
lichess-org:mainfrom
glitchfl:fix-persist-streak-skip-state
Apr 3, 2026
Merged

fix now it saves skip state immediately in Puzzle Streak#2887
veloce merged 2 commits into
lichess-org:mainfrom
glitchfl:fix-persist-streak-skip-state

Conversation

@glitchfl

@glitchfl glitchfl commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

The "skip this move" button state was only stored in memory and not persisted to local storage. This allowed users to use the skip than exit to the main menu and resume the streak with the skip button available again and by that enabling unlimited skips. The fix persists the hasSkipped flag to local storage immediately when the skip is used, matching the same save pattern already used when going to the next puzzle.

Fixes #2886 - "Puzzle Streak: Infinite "Skip This Move" Exploit"

@tom-anders

tom-anders commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the quick fix! I think it would be nice to have a regression test for this. We already have a widget test that tests saving the streak to storage, so you should be able to extend that one.

@glitchfl

glitchfl commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

Done! I added a regression test that works like the existing "Score is saved when exiting screen" test. it solves a puzzle, taps "Skip This Move", exits via the back button, re-enters the streak and verifies the skip button is still disabled. needless to say that all existing tests continue to pass.

@veloce veloce left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix, many thanks!

@veloce veloce merged commit 30db4c1 into lichess-org:main Apr 3, 2026
1 check passed
@glitchfl glitchfl deleted the fix-persist-streak-skip-state branch April 3, 2026 13:47
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.

Puzzle Streak: Infinite "Skip This Move" Exploit

3 participants