fix now it saves skip state immediately in Puzzle Streak#2887
Merged
Conversation
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. |
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. |
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.
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"