stockfish.js icon indicating copy to clipboard operation
stockfish.js copied to clipboard

Stockfish 16 does not respond to the "quit" command

Open saynschuman opened this issue 1 year ago • 2 comments

It seems that the new 16th version of Stockfish does not respond to the "quit" command. When sending stockfish.postMessage("quit") - it continues to send analytics. Whereas the 15th version returns a status of 0 - successful termination of work - in the console.

saynschuman avatar Aug 03 '23 14:08 saynschuman

@saynschuman, can you confirm which flavor of the engine you are using? The multi-threaded engine seems to exit properly.

You may want to run the engine in a Web Worker so that you can terminate the Worker.

nmrugg avatar Aug 03 '23 17:08 nmrugg

I run it like this on the web - stockfish = new Worker(/js/sf15/stockfish.js); stockfish.onmessage = (event: MessageEvent) => {} then I listen for its responses. So, the response stockfish.postMessage("quit") does not work as expected in version 16. I also observe this in version 11. It works fine in version 15. Here's the archive with JS wrapper files of all the versions I use js.zip

saynschuman avatar Aug 04 '23 06:08 saynschuman