something about draw api
Contains sponsored content, affiliate links or commercial advertisement
A bug about draw-apii found a bug about draw-api;
When Player A plays as White and Player B plays as Black, if Player B initiates a draw request while Player A is making a move, Player A receives a message like this:
{"type":"gameState","moves":"h2h4 e7e5 g2g4 b7b5","wtime":86386000,"btime":86400000,"winc":0,"binc":0,"status":"started","bdraw":true}
After Player A makes their move f2f4, Player A receives another message like this:
{"type":"gameState","moves":"h2h4 e7e5 g2g4 b7b5 f2f4","wtime":86400000,"btime":86400000,"winc":0,"binc":0,"status":"started","bdraw":true}
Since bdraw is true, Player A assumes that Player B has initiated a draw request. Player A agrees to the draw, but a strange issue occurs. Player A receives the following message:
{"type":"gameState","moves":"h2h4 e7e5 g2g4 b7b5 f2f4","wtime":86400000,"btime":86397000,"winc":0,"binc":0,"status":"started","wdraw":true}
This means that while Player A was making their move, Player B's draw request was already canceled. However, bdraw is still true.