Skip to content

frontend: Stop NetworkSpeedTest reconnect interval multiply - #4045

Open
joaoantoniocardoso wants to merge 1 commit into
bluerobotics:masterfrom
joaoantoniocardoso:pr/network-speedtest-interval
Open

frontend: Stop NetworkSpeedTest reconnect interval multiply#4045
joaoantoniocardoso wants to merge 1 commit into
bluerobotics:masterfrom
joaoantoniocardoso:pr/network-speedtest-interval

Conversation

@joaoantoniocardoso

@joaoantoniocardoso joaoantoniocardoso commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Keep a single 200ms ping interval for the page lifetime.
  • On disconnect, only recreate the WebSocket (do not nest another setInterval).

Test plan

  • Open Tools → Network test, leave the page open with a flaky WS: interval count stays at one
  • Latency updates while connected; reconnect recovers without runaway timers
  • Leave the page: interval cleared, socket closed

Supersedes #4032 (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 a compounding-interval bug in NetworkSpeedTest.vue: the previous openWebSocket() both created a WebSocket and installed a 200 ms setInterval, and when that interval detected a closed socket it re-called openWebSocket() — nesting another interval on every reconnect. The PR moves the single setInterval into mounted(), renames the socket-only helper to connectWebSocket() (which now closes any prior socket first), and adds an early return after reconnect so a send isn't attempted on the freshly-created (still CONNECTING) socket. Existing beforeDestroy() cleanup remains valid.

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
Keep a single ping interval for the page lifetime and only recreate
the WebSocket on disconnect.
@joaoantoniocardoso
joaoantoniocardoso force-pushed the pr/network-speedtest-interval branch from 89319b9 to f215f64 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