Skip to content

AI generated issue-ticket: Post Electron/Forge merge follow-up — CLI master fixes, sensor polling rate, branch squash #546

@nerdCopter

Description

@nerdCopter

Context

These tasks are identified as follow-up work after merging the Electron/Forge migration PR (nerdCopter/EmuConfigurator_nerdRepo rethink-WM branch). They were intentionally deferred to keep the migration PR focused and mergeable.


Tasks

1. Cherry-pick pre-existing master bugs to a standalone PR

Two bugs fixed in rethink-WM were pre-existing in master (confirmed by CodeRabbit review). They should be submitted as a separate, minimal PR targeting master so all users benefit — not only those on the Electron/Forge build.

File: src/js/tabs/cli.jsTABS.cli.cleanup()

Bug A — MSP.callbacks_cleanup() never called on CLI exit

Stale MSP retransmit timers accumulate while in CLI mode and fire on the next tab, causing MSP queue confusion and request timeouts.

Fix (1 line before sending exit\r):

MSP.callbacks_cleanup();

Bug B — callback() fires before FC exits CLI mode

The tab-switch callback fires immediately after writing exit\r, before the FC has rebooted and re-enumerated. The next tab initializes against a port that is about to disappear.

Minimum acceptable master fix (NW.js / non-Electron):

this.send(getCliCommand('exit\r', this.cliBuffer), function (writeInfo) {
    MSP.callbacks_cleanup();
    setTimeout(function() {
        if (callback) { callback(); }
        CONFIGURATOR.cliActive = false;
        CONFIGURATOR.cliValid = false;
    }, 500);
});

The GUI.pendingAfterReconnect / finishOpen() approach used in the Electron branch is the deterministic solution but requires the Electron IPC reconnect model. A 500ms settle is acceptable for the NW.js master build.


2. Evaluate sensors tab MSP polling rate / post-reconnect delay

The firmware CDC_Send_DATA blocking bug (tracked in emuflight/EmuFlight#1107) is triggered by immediate high-frequency MSP polling when the sensors tab enters after a CLI exit reconnect. A configurator-side mitigation:

  • Add 200–500ms delay before starting live sensor polls after a fresh reconnect
  • Or reduce sensors polling rate from ~100Hz to ~30Hz during the first few seconds

3. Rebase / squash rethink-WM before or after merge

The branch has 18 commits from the PR baseline. Collapsing to ~8 clean commits is recommended before merge (interactive rebase + force-push, requires explicit user action — do not do automatically).


Related


Generated: 2026-04-04 during Electron/Forge migration review

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions