Repository navigation
Harden BLE connection recovery - #98
Merged
Merged
Conversation
Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved BLE state and connection-lifecycle issues can hide password controls, retain failed setup connections, and allow delayed teardown to disconnect a replacement connection.
3 open issues
What changed in this PR
This PR addresses #97 by improving BLE connection recovery in the companion app and avoiding authentication routing based on stale device state.
Changes:
- Invalidate matching cached connections after selected command failures and firmware reconnect probe failures.
- Track authentication requirements in BLE connection state and scanner snapshots, and serialize BLE firmware writes.
- Clear previous connection errors when opening a device and return to the device list if connection fails.
| File | Description |
|---|---|
companion/src/App.tsx |
Clears stale errors and returns failed connections to the device list. |
companion/src-tauri/src/constants.rs |
Limits BLE firmware writes to one outstanding request. |
companion/src-tauri/src/ble/state.rs |
Adds authentication metadata and identity-checked connection removal. |
companion/src-tauri/src/ble/scanner.rs |
Includes cached authentication requirements in scan snapshots. |
companion/src-tauri/src/ble/commands.rs |
Adds failure invalidation and records authentication requirements from status responses. |
Review effort: Balanced
Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes stale BLE connection reuse and incorrect connection routing after command failures. Failed status, authentication, OTA, and reconnect probes now invalidate the matching cached connection so retries establish a fresh connection. BLE snapshots also retain the latest authentication requirement, while connection failures clear stale UI errors and return to the device list instead of guessing an auth screen.
Component
Closes Issues
#97