mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-18 23:08:25 -05:00
The status stream read the websocket synchronously. Beast's expires_after() only applies to async operations, so when a printer stopped sending, ws.read() blocked forever, and stop_status_stream() joined that thread when the app closed. On Windows the stuck process also froze the next launch through the shared WebView2 browser. Run the whole stream on one io_context owned by the stream thread, and have stop_status_stream() post an abort to it. A stop on an open websocket sends a close frame and waits up to 1 s for the answer. Keep-alive pings detect a dead printer, and the stream reconnects until stopped, with the backoff capped at 32 s. When a quiet printer still answers pings, its last status is sent again. The stream starts under connect_mutex after a staleness check, and a stop from the stream's own callback no longer joins its own thread. The Moonraker tests move into test_moonraker_printer_agent.cpp.
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: