Skip to content

Fix Apple Watch BLE reconnection reliability#40

Merged
dutkiewiczmaciej merged 1 commit into
mainfrom
fix/watch-reconnect
Mar 17, 2026
Merged

Fix Apple Watch BLE reconnection reliability#40
dutkiewiczmaciej merged 1 commit into
mainfrom
fix/watch-reconnect

Conversation

@dutkiewiczmaciej

Copy link
Copy Markdown
Owner

Summary

  • Watch BLE connection would silently drop and never recover, requiring manual disconnect/reconnect in settings
  • Focus/DND mode prevented lock state detection due to Apple Watch BLE address rotation
  • RSSI polling timer stalled during modal dialogs

Changes

  • Exponential backoff reconnect (1s → 2s → 4s → max 30s) on disconnect and failed connect
  • 15-second health check detects silently dropped connections
  • Accept Nearby Info "unlocked" from any Apple device (handles BLE address rotation), only trust "locked" from paired Watch UUID
  • Scan-based RSSI fallback when BLE connection is lost
  • RunLoop.common for RSSI timer (fixes stall during modals)
  • NSLog in release builds for production diagnostics

Test plan

  • Verify Watch auto-unlock works on app activation
  • Enable Focus/DND mode and verify Watch still unlocks
  • Wait for BLE disconnect and verify auto-reconnect
  • Check Console.app for [MakLock-Watch] logs

Watch connection would silently drop and never recover, requiring
manual disconnect/reconnect in settings. Also, Focus/DND mode
prevented lock state detection due to BLE address rotation.

- Add exponential backoff reconnect on disconnect and failed connect
- Add 15s health check to detect silently dropped connections
- Accept Nearby Info "unlocked" from any Apple device (BLE address rotation)
- Only trust "locked" from paired Watch UUID (prevents false locks)
- Fall back to scan-based RSSI when connection is lost
- Use RunLoop.common for RSSI timer (fixes stall during modals)
- Add NSLog in release builds for production diagnostics
- Keep last known lock state on disconnect instead of clearing to nil
@dutkiewiczmaciej dutkiewiczmaciej merged commit a7da486 into main Mar 17, 2026
1 check passed
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