runar-rkmedia / gotally

0 stars 1 forks source link

Game crashes for user. #11

Closed runar-rkmedia closed 1 year ago

runar-rkmedia commented 1 year ago

What the user sees

The UI does not show an error-message, or anything. Simply a blank screen with the games background-color.

What I did to cause the error

I was really just testing the Main Menu within the game, hitting every button Reset, New Challenge, New Infinite Game.

There might be more information in Tracing and Logs for what I actually did.

It looks like the database does not have an entry for which ruleset the user should use for the current game. Note that this was working for the same user previously.

Proposed solution

  1. Ensure the user gets an error-message or status if something goes wrong.
  2. Make a test for this and replicate. Either as a unit-test, or perhaps Playwright or even Pact.
  3. Fix the bug.
runar-rkmedia commented 1 year ago

The crash occured because Game.SnapShotAtStart was used, from an earlier stage. This should no longer happen, as call was removed in 69fc689d2d62c1d23ba9b5a1db1d2aba6cb3bb4c . There are tests for this case in https://github.com/runar-rkmedia/gotally/blob/69fc689d2d62c1d23ba9b5a1db1d2aba6cb3bb4c/api/api_test.go#L21-L120 .

The RestartGame-functionality will be reimplemented shortly, with looks directly from the database.

runar-rkmedia commented 1 year ago

Should be fixed now, with e2e-tests and api-tests