Skip to content

Recover BLE after system sleep and resume - #670

Merged
enaboapps merged 5 commits into
mainfrom
codex/669-ble-resume-recovery
Aug 30, 2026
Merged

Recover BLE after system sleep and resume#670
enaboapps merged 5 commits into
mainfrom
codex/669-ble-resume-recovery

Conversation

@enaboapps

@enaboapps enaboapps commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes #669

What changed

  • Listens for native Windows and macOS suspend and resume notifications.
  • Clears stale transport, pairing, input, repeat, dwell, and overlay state on suspend.
  • Rebuilds the platform GATT provider and advertising state on absolute retry offsets of 0, 1, 2, 4, 8, and 15 seconds.
  • Monitors Windows Bluetooth radio state and recovers when Bluetooth is enabled again.
  • Rejects callbacks and deferred writes from superseded provider generations.
  • Preserves pairing tokens, timestamps, and replay protection during transport reset.

Validation

Passed locally on Windows:

  • npm run lint
  • npm test: 74 frontend tests and 5 updater-feed tests
  • npm run build
  • cargo fmt --manifest-path src-tauri/Cargo.toml --check
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo test --manifest-path src-tauri/Cargo.toml: 238 unit tests and 7 configuration tests
  • Startup launcher formatting, Clippy, and tests
  • Updater signature verifier formatting, Clippy, and tests
  • npm audit --audit-level=high
  • cargo-audit 0.22.2 for all lockfiles
  • Direct rustfmt check for modified vendored CoreBluetooth sources

Latest-head CI passed: frontend, dependency audit, CodeQL, Windows native/NSIS, and macOS native/app/DMG. Independent review of ee29f49 found no actionable issues.

Manual verification still required

  • Windows 11 sleep/resume while advertising and while connected
  • Apple Silicon macOS sleep/resume while advertising and while connected
  • Bluetooth disabled during sleep, then enabled after resume
  • Repeated cycles with the main window hidden
  • Held-input release and overlay cleanup across suspend

@enaboapps
enaboapps marked this pull request as ready for review August 30, 2026 13:08
@enaboapps
enaboapps merged commit 6b436ea into main Aug 30, 2026
6 checks passed
@enaboapps
enaboapps deleted the codex/669-ble-resume-recovery branch August 30, 2026 17:25
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.

Recover BLE advertising after system sleep and resume

2 participants