Skip to content

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

Open
joaoantoniocardoso wants to merge 2 commits into
bluerobotics:masterfrom
joaoantoniocardoso:pr/mavlink-rate-cleanup
Open

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

Conversation

@joaoantoniocardoso

@joaoantoniocardoso joaoantoniocardoso commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Track per-message rate claims in the mavlink store and apply max(claims) (idle 1 Hz) so one consumer can leave without overriding another.
  • Vehicle setup / MainView / compass: release rate claims 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 drop when no other claimant remains
  • 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
  • Gyro calib + CompassDisplay overlapping: tearing down Gyro keeps IMU at 10 Hz while CompassDisplay is mounted

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

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

@review.md

@joaoantoniocardoso joaoantoniocardoso added the move-to-stable Needs to be cherry-picked and move to stable label Jul 27, 2026
@joaoantoniocardoso
joaoantoniocardoso force-pushed the pr/mavlink-rate-cleanup branch from e54d12b to f0da846 Compare July 28, 2026 01:34
@Williangalvani

Copy link
Copy Markdown
Member
  • 1.1 [minor] core/frontend/src/store/mavlink.ts:34-49 — the store still has no reference counting: beforeDestroy in one component can lower a rate that another live component depends on. The PR papers over one instance in LevelHorizonCalibration.vue, but the same class of bug remains latent — for example, GyroCalib.beforeDestroy ratchets RAW_IMU/SCALED_IMU2/SCALED_IMU3 down to 1 Hz, and those exact three messages are also requested by CompassDisplay at 10 Hz. If a caller ever has both mounted concurrently (Vuetify's v-tabs-items cache, a dashboard widget, etc.) the surviving component silently drops to 1 Hz. Not a blocker for this PR, but worth tracking — a real fix would keep a per-message subscriber map and pick max(rate).

Could we do this instead? that would take some more code, but we wouldnt override other's rates

Track per-message rate claims and apply max(claims) so consumers can
lower streams on destroy without overriding other live subscribers.
@joaoantoniocardoso
joaoantoniocardoso force-pushed the pr/mavlink-rate-cleanup branch from f0da846 to fbfd87e Compare July 30, 2026 23:01
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as draft July 30, 2026 23:01
…leave

Release message rate claims 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 fbfd87e to a55d013 Compare July 31, 2026 00:41
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as ready for review July 31, 2026 22:32
@joaoantoniocardoso

Copy link
Copy Markdown
Member Author
  • 1.1 [minor] core/frontend/src/store/mavlink.ts:34-49 — the store still has no reference counting: beforeDestroy in one component can lower a rate that another live component depends on. The PR papers over one instance in LevelHorizonCalibration.vue, but the same class of bug remains latent — for example, GyroCalib.beforeDestroy ratchets RAW_IMU/SCALED_IMU2/SCALED_IMU3 down to 1 Hz, and those exact three messages are also requested by CompassDisplay at 10 Hz. If a caller ever has both mounted concurrently (Vuetify's v-tabs-items cache, a dashboard widget, etc.) the surviving component silently drops to 1 Hz. Not a blocker for this PR, but worth tracking — a real fix would keep a per-message subscriber map and pick max(rate).

Could we do this instead? that would take some more code, but we wouldnt override other's rates

Done; that's indeed a better approach, thanks.

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.

2 participants