Skip to content

Fix Bluetooth worker panic when picking Ambient mode on devices without ambient controls - #5

Open
alfiyansys wants to merge 2 commits into
d7omdev:mainfrom
alfiyansys:fix/ambient-panic
Open

alfiyansys wants to merge 2 commits into
d7omdev:mainfrom
alfiyansys:fix/ambient-panic

Conversation

@alfiyansys

Copy link
Copy Markdown

Summary

openscq30-lib panics (rather than returning an error) when asked to write a setting the device model has not registered. The tray's Ambient mode menu was always enabled, so choosing an entry on earbuds without ambient modes killed the Bluetooth worker thread and the app lost its connection.

  • Device worker: ambient writes are now dropped for devices that expose no ambient modes, instead of reaching openscq30-lib.
  • Tray: the Ambient mode submenu is disabled when the connected device has no ambient controls. Tray state carries this flag from the app.

Test plan

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --all-targets
  • Devices with ambient modes (e.g. Liberty 4 Pro): behavior is unchanged by design; not re-tested on hardware

alfiyansys and others added 2 commits November 24, 2026 21:50
openscq30-lib panics instead of returning an error when asked to write a
setting the model does not register. The tray's Ambient mode menu is
always enabled while connected, so picking it on earbuds without
ambient modes (e.g. K20i) crashed the Bluetooth worker. Drop
SetListeningMode and SetAmbientLevel when AmbientSoundMode is absent.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…controls

TrayState now carries has_ambient (manual ranges or at least one listening
mode), computed in the GUI and in --tray-only mode, and the submenu is
enabled only when connected and has_ambient is true.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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