From 1467fd1cf316a52b72d82e7f164d9e3e02484d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Sat, 25 Jul 2026 11:25:15 -0300 Subject: [PATCH 1/2] frontend: store: mavlink: Allow lowering message refresh rates Replace listeners when the requested rate changes in either direction so pages can ratchet streams down on destroy instead of only up. --- core/frontend/src/store/mavlink.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/frontend/src/store/mavlink.ts b/core/frontend/src/store/mavlink.ts index 007d920594..729ee3e4d2 100644 --- a/core/frontend/src/store/mavlink.ts +++ b/core/frontend/src/store/mavlink.ts @@ -33,21 +33,20 @@ class MavlinkStore extends VuexModule { const { messageName, refreshRate } = rate if (refreshRate < 0) { console.warn(`Invalid request rate requested for message ${messageName}@${refreshRate}Hz`) + return } - mavlink2rest.requestMessageRate(messageName, refreshRate, autopilot_data.system_id) - // Remove any listener that has a lower frequency than requested + // Equal rate: keep existing listener and skip the wire request. + // Any other rate change discards the listener and creates a replacement. if (messageName in this.message_listeners) { - const currentRate = this.message_listeners[messageName].frequency - if (currentRate > refreshRate) { - console.warn( - `Request with higher rate already registered for message ${messageName}@${currentRate}Hz vs ${refreshRate}Hz`, - ) + if (this.message_listeners[messageName].frequency === refreshRate) { return } this.message_listeners[messageName].discard() } + mavlink2rest.requestMessageRate(messageName, refreshRate, autopilot_data.system_id) + // Create a new listener this.message_listeners[messageName] = mavlink2rest.startListening(messageName).setCallback((receivedMessage) => { this.updateMessage({ From e54d12b359cd9fe386ec411f2772776ea77a4ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Sat, 25 Jul 2026 11:25:15 -0300 Subject: [PATCH 2/2] frontend: vehiclesetup: Clean up MAVLink rates and compass timers on leave Ratchet message rates down on destroy, discard position listeners, and clear the CompassDisplay render interval plus GSAP tweens. --- .../compass/AutoCoordinateDetector.vue | 18 +++++++++++++----- .../configuration/compass/CompassDisplay.vue | 14 ++++++++++++-- .../compass/LevelHorizonCalibration.vue | 2 ++ .../vehiclesetup/overview/GyroCalib.vue | 9 ++++++++- core/frontend/src/views/MainView.vue | 1 + 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/core/frontend/src/components/vehiclesetup/configuration/compass/AutoCoordinateDetector.vue b/core/frontend/src/components/vehiclesetup/configuration/compass/AutoCoordinateDetector.vue index 2085362e7b..ffc064d4ba 100644 --- a/core/frontend/src/components/vehiclesetup/configuration/compass/AutoCoordinateDetector.vue +++ b/core/frontend/src/components/vehiclesetup/configuration/compass/AutoCoordinateDetector.vue @@ -61,9 +61,10 @@