api icon indicating copy to clipboard operation
api copied to clipboard

Board api stream not returning gameState response when user resigns the game

Open mcaap opened this issue 5 years ago • 4 comments

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)

mcaap avatar Sep 24 '20 06:09 mcaap

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"

ornicar avatar Sep 24 '20 11:09 ornicar

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!

mcaap avatar Sep 24 '20 12:09 mcaap

I tried that too and still got the gameState event.

ornicar avatar Sep 24 '20 13:09 ornicar

Strange, I will triple-check this. Thanks for your time.

mcaap avatar Sep 24 '20 14:09 mcaap