Skip to content

Improve crash handling - #66

Merged
flee135 merged 7 commits into
wafo:masterfrom
tanjo3:improve-crash-handling
Aug 17, 2026
Merged

flee135 merged 7 commits into
wafo:masterfrom
tanjo3:improve-crash-handling

Conversation

@tanjo3

@tanjo3 tanjo3 commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

If the browser's saved layout gets corrupted or isn't a valid layout file, the tracker shows a blank page every time it opens until the user manually clears browser storage. This is bad because there's no obvious indicator of what's wrong or how to fix it. Similarly, if a tracker issue occurs, the tracker page is also blank. This PR improves crash handling to prevent breakage and, if it happens, tell the user what occurred and how to fix it.

For layouts, malformed layouts now produce an error and fall back to the default layout. For the tracker, if an error occurs, an error message explaining what to check and a "Try again" button will now appear. If a saved session cannot be resumed for some reason, the button will now be turned off with an explanation. If a fatal crash occurs, a recovery screen will now appear with buttons to reload the page or reset saved data (the latter requires a double-click to confirm).

Additionally, dragging something outside the tracker onto it (such as a file from File Explorer onto one of the HashFrog icons) used to cause an error. Now, it is just ignored.

A few ways to test things:

  • Run localStorage.setItem("layout", JSON.stringify({ layoutConfig: { name: "Broken", width: 325, height: 650 }, components: [{ type: "table", elements: 42 }], })); in the browser console and then navigate to http://localhost:3000/tracker manually. You should get the crash screen which provides the error message, a button to reload (which doesn't help in this case) and a button to reset saved data (which will reset everything to default values and fix the error).
  • On the launcher page, run localStorage.setItem("layout", "{corrupt") in the browser console and reload. The page should open with the default layout loaded instead of blank page.
  • Import a non-layout .json or a .txt renamed to .json in launcher. The app should produce a red alert and leave the current layout untouched.
  • Point REACT_APP_API_URL to any bogus host and launch the tracker with check tracking. You should get an error screen with a "Try again" button.
  • Hand-edit tracker_session to set "mq_dungeons_specific": 3 and try to resume the session. The session should restore without that field instead of crashing.
  • Drag selected text from another window onto a receiver element. Nothing should happen rather than a console crash.

@flee135
flee135 merged commit 4849381 into wafo:master Aug 17, 2026
1 check passed
@tanjo3
tanjo3 deleted the improve-crash-handling branch August 17, 2026 18:50
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