boardgameio / boardgame.io

State Management and Multiplayer Networking for Turn-Based Games
https://boardgame.io
MIT License
10k stars 706 forks source link

Server getting into a bad state in Chess example #370

Closed vdfdev closed 5 years ago

vdfdev commented 5 years ago

We have noticed that after launching FreeBoardGame.org (former Turnato), the server is getting into a bad state while playing chess (see this bug).

It seems like if both players are not connected at the same time and one does a move, the other player can't fetch the correct state back. This also happens if the player that did the move reloads the page.

This seems to be an issue with boardgame.io, as I could minimally reproduce the same exact issue in the examples. See this video. Just need to do one move in chess, and no user can do any other move if you reload the page.

I am thinking this was a regression, as this was not a problem before. I am going to have a look and see in what commit this behavior starts.

PS: If you read the original bug, I was suspecting of networking issues before and saw some errors on the server log, but I think they are unrelated. The server is also not logging anything when I reproduce it as described.

vdfdev commented 5 years ago

I tracked down and the example was working as expected until release 0.29.5 (Jan 9) but not after release 0.30.0 (Jan 11). I will try to investigate why now.

vdfdev commented 5 years ago

Behaves as expected: https://github.com/nicolodavis/boardgame.io/commit/c552abe79537c78c64157e847944f7628f9246e6

Does not behave as expected: https://github.com/nicolodavis/boardgame.io/commit/4921a65cd6ddb8e6b7343c86d66170e3637a340e

vdfdev commented 5 years ago

This is the commit that broke it: https://github.com/nicolodavis/boardgame.io/commit/8d08381df929bf8516c774dfea089a254807b022