Fix false Ground Station activation during Blackbox download - #2689
Fix false Ground Station activation during Blackbox download#2689mart1npetroff wants to merge 4 commits into
Conversation
cliTab.initialize() flushed the MSP queue synchronously but only set CONFIGURATOR.cliActive true inside the async cli.html import callback, leaving a window where periodicStatusUpdater's 300ms poll still saw cliActive as false and queued status requests that never got flushed again. Those requests went out over the wire and corrupted the FC's CLI output (visible as leaked MSP2 frame bytes). Move the flag to the first line of initialize() so no interval tick can land in the gap. Also guard the tab-click handler's cliTab.exit() call with cliValid in addition to cliActive, since cliActive can now be true before the FC has confirmed CLI mode was actually entered.
MSP.send_message()'s queue-put can be rejected as a duplicate when the same MSP code is still awaiting a response (routine on a slow/loaded serial link where round-trip exceeds the poll interval). The rejected message retried every 150ms for up to 25 attempts without ever re-checking CONFIGURATOR.cliActive, so a status poll deferred right before switching to the CLI tab could still land several seconds later, once the FC was already echoing raw bytes in CLI mode. Found by reproducing the original bug's exact symptom live after the first fix landed. Check cliActive before every attempt, not just the one made at send_message() time.
…-polling-leak Fix MSP status polls leaking into CLI session on tab entry
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
|



What changed
Root cause
The serial connection fed every received byte to both MSP and LTM decoders. Raw
MSP_DATAFLASH_READpayloads contain arbitrary Blackbox bytes, so they could accidentally form a valid LTM frame and switch the UI into Ground Station mode.Validation
yarn test— passed.