Skip to content

fix(ui): reset the streamer when the connection mode changes - #195

Open
ID-VerNe wants to merge 1 commit into
teamclouday:mainfrom
ID-VerNe:fix/mode-switch-reset
Open

ID-VerNe wants to merge 1 commit into
teamclouday:mainfrom
ID-VerNe:fix/mode-switch-reset

Conversation

@ID-VerNe

@ID-VerNe ID-VerNe commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

AppMsg::ChangeConnectionMode only writes config.connection_mode. If a streamer is already Listening, Connected or WaitingOnStatus, the old streamer keeps running: ADB mode keeps its 127.0.0.1 listener and adb reverse tunnel, and no listener exists for the newly selected Wi-Fi/TCP mode. The UI still shows Listening... for the old mode, so the phone cannot connect until the user clicks the active button (Stop) and then Connect again.

Changes

  • Selecting the already active mode is a no-op.
  • Persist the new mode.
  • If the current state is Listening, Connected or WaitingOnStatus, stop the old streamer and reset the UI to Default (clear the audio stream / waveform and sync the tray).
  • If auto_connect is enabled, immediately start the newly selected mode; otherwise leave the normal Connect button available.
  • Manual Stop → Connect and same-mode selection are unchanged.

Verification

  • cargo fmt --all -- --check
  • cargo check --all-targets
  • cargo test --lib — 12 passed
  • cargo clippy --all-targets — only the 5 pre-existing warnings
  • cargo build
  • CI run 44646378255: ubuntu / windows / macOS / Android all green.
  • Windows 11, normal use on the installed build from this fork main (d8274f9): switching between USB Adb and WIFI / LAN (TCP) no longer leaves the stale-listener / Stop-then-Connect symptom. No dedicated log capture was kept for this switch (the app's default log level is warn, so info-level mode-change lines are not persisted).

Scope: RustApp/src/ui/app.rs, +27 / −0.

FIX:
- reset an active streamer when `ChangeConnectionMode` selects a different mode
- stop the old ADB listener before switching to Wi-Fi/TCP instead of leaving the UI in `Listening`
- reconnect in the new mode when `auto_connect` is enabled; otherwise leave `Connect` available

The same-mode selection remains a no-op, and the manual Stop -> Connect path is unchanged.
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