Skip to content

Fix two silent state-loss bugs - #67

Merged
flee135 merged 3 commits into
wafo:masterfrom
tanjo3:fix-state-loss-bugs
Aug 24, 2026
Merged

flee135 merged 3 commits into
wafo:masterfrom
tanjo3:fix-state-loss-bugs

Conversation

@tanjo3

@tanjo3 tanjo3 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

In a review, Claude identified two minor issues where the tracker quietly forgets the user's choices. These are minor bugs, but we may as well deal with them now before they become a problem.

The first bug is the launcher page forgetting the settings string. When you initially visit the Welcome page, the cached localStorage settings_string gets saved into the local settingsString state. The mount effect then fires and sets the localStorage string to "". Since the string is still saved in local state, it loads when you toggle check tracking on. However, this means there's a window where the only copy of the string exists purely in local state.
You can reproduce this by enabling check tracking and typing a string in the settings string field, say "ABC". If you reload the page and toggle check tracking on, "ABC" is still there. However, if you toggle it back off, open a new tab with another tracker, and enable check tracking there, the field will be blank. Now, if you close the first tab, the string is lost forever. This PR removes writing "" to localStorage while preserving the auto-save-while-typing behavior.

The second bug involves layout elements that use the "Starting Index" property. This property lets the user specify which icon the element should start at, but the tracker previously always snapped back to the first icon. For testing, use the attached layout file, which is a modified HashFrog layout with an added Iron-Hover Boots element beside the Skulltula Counter. The starting index of this added element is 3, meaning it should start on the combined Iron+Hovers icon. If you view this layout in either Check Tracking or Editor mode, you'll currently see it start on the initial black-and-white icon.
If you test it with these changes, it will actually start at index 3. In addition, the logic will consider the player as having both boots. I consider this a minor bug because I can't imagine a scenario where one would actually use the starting index property. With check tracking, starting items should be handled via the settings string, so it might only be used with check tracking off. But even then, I'm not sure when you'd use it. Regardless, if people do use it, it should work as expected now.

PR-67.json

@flee135
flee135 merged commit 016dbaa into wafo:master Aug 24, 2026
1 check passed
@tanjo3
tanjo3 deleted the fix-state-loss-bugs branch August 24, 2026 20:09
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