api
api copied to clipboard
Board api stream not returning gameState response when user resigns the game
Continuation of discord... When the other user resigns, there is no gameState response. Only gameFinish is received. Whereas the API documentation shows a final gameState with status and winner fields (which is what we need) this: https://lichess.org/api#operation/boardGameStream Looks like the final gameState response is indeed received for 'checkmate' scenarios. But no final gameState with winner/status is received when the lichess user resigns (on the web)
I just tried, and saw this:
{"type":"gameState","moves":"e2e4 e7e6 b1c3 d7d5 d2d3 c7c5 f1e2 f8e7 g1f3 g8f6 e4d5 e6d5 c1d2 b8c6 e1g1 e8g8 h2h3 c8f5 a2a3 d5d4 d1e1 d4c3 d2c3 f6d5","wtime":5460,"btime":6450,"winc":1000,"binc":1000,"wdraw":false,"bdraw":false,"status":"resign","winner":"black"}
it has "status":"resign","winner":"black"
Looks like a weird issue. If the lichess user resigns when it is the opponent's turn to play, I only get the gameFinish and dont get the gameState response. Opponent in this case is the user of the board API.
Example game: {"type":"gameFinish","game":{"id":"XU2wWbhi"}}
But if the lichess user resigns when its his turn, I get the gameFinish followed by the gameState response as expected!
I tried that too and still got the gameState event.
Strange, I will triple-check this. Thanks for your time.