Handling package drop caused by bad connections in turn based game

We’ve built a turn-based game using the TypeScript client and server for authoritative matches. The game is somewhat comparable to tic-tac-toe; it’s turn-based, and every move is checked by the server to ensure its validity.

Lately, we have been experiencing issues with players getting stuck in the game. It seems like moves are being sent to the server but not received. This mainly occurs on poor cellular connections. Currently, we rely on the sendMatchState function to reject or throw an error if it is unsuccessful, but this may not be 100% reliable.

What are the best practices here? Should we send a message back to the client to confirm its receipt by the server? Should we incorporate a timer in the game to consider the message failed after a certain time? Does Nakama offer any out-of-the-box solutions to handle these cases?

What we are currently doing:

  • Sending moves via sendMatchState. If it fails (rejected/thrown), we send another OpCode to retrieve the entire game state from the server and refresh the client.

What we believe we should do:

  • Send moves via sendMatchState and wait for a package from the server confirming its receipt. If it is not received within a certain amount of time, we consider the package failed and request a game state update from the server to refresh the client.

Another issue we are experiencing is packages sent from the server to the client not being received.

Thanks in advance!