Skip to content

frontend: Fix MAVLink2Rest orphan WebSocket reconnects - #4044

Open
joaoantoniocardoso wants to merge 1 commit into
bluerobotics:masterfrom
joaoantoniocardoso:pr/mavlink2rest-orphan-reconnect
Open

frontend: Fix MAVLink2Rest orphan WebSocket reconnects#4044
joaoantoniocardoso wants to merge 1 commit into
bluerobotics:masterfrom
joaoantoniocardoso:pr/mavlink2rest-orphan-reconnect

Conversation

@joaoantoniocardoso

@joaoantoniocardoso joaoantoniocardoso commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • On intentional close, clear reconnect timeouts and detach onclose so dying sockets cannot resurrect.
  • setBaseUrl closes the previous send socket before opening a new one (probe can call setBaseUrl more than once).

Test plan

  • Load BlueOS, confirm MAVLink heartbeats / params still work
  • Reload / HMR: console should not accumulate reconnecting zombie WS over time
  • Vehicle reconnect after autopilot restart still recovers within a few seconds

Supersedes #4030 (recreated from fork joaoantoniocardoso/BlueOS-docker instead of same-repo head).

@github-actions

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: LGTM :shipit:

Fixes orphan WebSocket reconnects in core/frontend/src/libs/MAVLink2Rest/. Both Endpoint and Mavlink2RestManager now track an intentionalClose flag and the pending reconnect setTimeout handle, so intentional closes detach onclose/onmessage, cancel the queued 5 s reconnect, and gate the reconnect branch — preventing the previous behavior where updateUrl()/setBaseUrl() would leave the old socket's onclose alive and reconnecting to the stale URL.

No further comments, nice job 👍

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

@joaoantoniocardoso joaoantoniocardoso added the move-to-stable Needs to be cherry-picked and move to stable label Jul 27, 2026
Disable reconnect on intentional close and close the previous send
socket in setBaseUrl so probe/url changes cannot leave zombie sockets.
@joaoantoniocardoso
joaoantoniocardoso force-pushed the pr/mavlink2rest-orphan-reconnect branch from b4a39e2 to cfb78ac Compare July 28, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

move-to-stable Needs to be cherry-picked and move to stable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant