frontend: Fix MAVLink2Rest orphan WebSocket reconnects - #4044
frontend: Fix MAVLink2Rest orphan WebSocket reconnects#4044joaoantoniocardoso wants to merge 1 commit into
Conversation
Automated PR Review0. Summary
Fixes orphan WebSocket reconnects in No further comments, nice job 👍 Generated by PR Review Bot. This is advisory, a human reviewer must still approve. |
cfb78ac to
3878bb5
Compare
|
Rebased; the image is now available on Docker Hub. |
Disable reconnect on intentional close and close the previous send socket in setBaseUrl so probe/url changes cannot leave zombie sockets.
3878bb5 to
a63c25c
Compare
|
Can you explain how the original error can be replicated ? |
Sorry for the lack of context. This one addresses an extra mavlink2rest WebSocket connection being created for each tracked topic a few seconds after reloading BlueOS, ending up with 1 dead + 2 active ones. The damage is controlled, as it doesn't pile indefinitely. To see it, open any reasonably quiet page of BlueOS, open the Network tab from the browser's developer tools, filter for connection type WebSocket and for HEARTBEAT (example). Reload the page, wait a few seconds, and inspect each connection by clicking on each of them. You'll see two active ones and one dead. With this patch, we'll only ever have 1 active in the same scenario. |


Summary
oncloseso dying sockets cannot resurrect.setBaseUrlcloses the previous send socket before opening a new one (probe can call setBaseUrl more than once).Test plan
Supersedes #4030 (recreated from fork
joaoantoniocardoso/BlueOS-dockerinstead of same-repo head).