You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first word you submit to the word guessing game disppears.
This only happens in the production version of the app, not in testing.
Root Cause
The first time a game is created, the goal word is saved to the database, but this leads to a race condition when we try to read the previous state immediately after.
We fixed it in this commit where we fallback to the game instance's existing goal word, which handles the case where the game has just been created for the first time on any instance.
The API shows this error log when your guess disappears:
2022-08-07T00:28:46.341988+00:00 app[web.1]: 'NoneType' object is not subscriptable
2022-08-07T00:28:46.341996+00:00 app[web.1]: Traceback (most recent call last):
2022-08-07T00:28:46.341997+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/ninja/operation.py", line 99, in run
2022-08-07T00:28:46.341997+00:00 app[web.1]: result = self.view_func(request, **values)
2022-08-07T00:28:46.341998+00:00 app[web.1]: File "/app/backend/games/views/word_guesser.py", line 64, in post_guess
2022-08-07T00:28:46.341998+00:00 app[web.1]: next_state = get_next_game_state(game, guess.word, previous_state)
2022-08-07T00:28:46.341998+00:00 app[web.1]: File "/app/backend/games/word_guesser/state_management.py", line 14, in get_next_game_state
2022-08-07T00:28:46.341999+00:00 app[web.1]: next_guess = game.guess_word(word)
2022-08-07T00:28:46.341999+00:00 app[web.1]: File "/app/backend/games/word_guesser/WordGuesser.py", line 86, in guess_word
2022-08-07T00:28:46.342000+00:00 app[web.1]: if char is goal[i]:
2022-08-07T00:28:46.342001+00:00 app[web.1]: TypeError: 'NoneType' object is not subscriptable
2022-08-07T00:28:46.342452+00:00 app[web.1]: Internal Server Error: /games/wordguesser/default/guess
2022-08-07T00:28:46.343043+00:00 app[web.1]: 10.1.34.162 - - [07/Aug/2022:00:28:46 +0000] "POST /games/wordguesser/default/guess HTTP/1.1" 500 608
The text was updated successfully, but these errors were encountered:
Issue
Root Cause
The first time a game is created, the goal word is saved to the database, but this leads to a race condition when we try to read the previous state immediately after.
We fixed it in this commit where we fallback to the game instance's existing goal word, which handles the case where the game has just been created for the first time on any instance.
The API shows this error log when your guess disappears:
The text was updated successfully, but these errors were encountered: