Skip to content

frontend: Clean up MAVLink refresh rates on leave (store + vehicle setup) - #4031

Closed
joaoantoniocardoso wants to merge 2 commits into
masterfrom
pr/mavlink-rate-cleanup
Closed

frontend: Clean up MAVLink refresh rates on leave (store + vehicle setup)#4031
joaoantoniocardoso wants to merge 2 commits into
masterfrom
pr/mavlink-rate-cleanup

Conversation

@joaoantoniocardoso

@joaoantoniocardoso joaoantoniocardoso commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Allow setMessageRefreshRate to lower rates (not only raise), replacing the listener when the rate changes.
  • Vehicle setup / MainView / compass: ratchet rates down on destroy, discard position listeners, clear CompassDisplay render interval + GSAP tweens.

Test plan

  • Visit Home (ATTITUDE 10 Hz) then leave: rate drops to 1 Hz
  • Open compass configure, leave: render interval stops; IMU/ATTITUDE rates ratchet down
  • Gyro calib mount/unmount does not leave 10 Hz streams forever
  • Level horizon dialog open/close does not fight CompassDisplay ATTITUDE rate while both tabs are alive

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: LGTM :shipit:

Tightens the MAVLink refresh-rate lifecycle across the vehicle-setup components. In store/mavlink.ts, negative rates now short-circuit early, and the store honors any rate change (previously a lower-rate request was silently rejected while the underlying wire request still went out, leaving the store's listener frequency out of sync with the wire). Adds beforeDestroy cleanup that discards leaked setInterval/GSAP tweens (CompassDisplay) and ratchets ATTITUDE/IMU/GPS rates back down to 1 Hz on leave (MainView, CompassDisplay, GyroCalib). AutoCoordinateDetector now markRaws its GLOBAL_POSITION_INT listener (correct — Endpoint.latestData must not be deep-observed by Vue) and discards it on destroy. LevelHorizonCalibration gains an explanatory comment justifying why it deliberately does not ratchet ATTITUDE down on dialog close (sibling CompassDisplay may still be mounted in another kept-alive tab). Vue 2.7.14 is locked in yarn.lock, so markRaw is available.

No further comments, nice job 👍

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

Replace listeners when the requested rate changes in either direction
so pages can ratchet streams down on destroy instead of only up.
…leave

Ratchet message rates down on destroy, discard position listeners, and
clear the CompassDisplay render interval plus GSAP tweens.
@joaoantoniocardoso
joaoantoniocardoso force-pushed the pr/mavlink-rate-cleanup branch from 754f2c7 to e54d12b Compare July 25, 2026 14:44
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as draft July 25, 2026 15:51
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as ready for review July 25, 2026 15:51
@joaoantoniocardoso joaoantoniocardoso added the move-to-stable Needs to be cherry-picked and move to stable label Jul 25, 2026
@joaoantoniocardoso

Copy link
Copy Markdown
Member Author

Superseded by #4047 (same changes, head moved to fork joaoantoniocardoso/BlueOS-docker).

@joaoantoniocardoso

Copy link
Copy Markdown
Member Author

Closed in favor of #4047.

@joaoantoniocardoso
joaoantoniocardoso deleted the pr/mavlink-rate-cleanup branch July 27, 2026 21:03
@joaoantoniocardoso joaoantoniocardoso removed the move-to-stable Needs to be cherry-picked and move to stable label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant