feat: make auto-reconnect prompt and recover stranded peripherals - #43
Merged
Conversation
The auto-reconnect watcher now probes on a constant 5s cadence (was 15s) over a 10-minute window (was 1 hour): a stuck peripheral is something the user notices and power-cycles, and the reconnect only succeeds within a brief window, so a prompt-but-bounded poll fits better than a long, slow one. The probe timer gains a small leeway for wakeup coalescing, and a peripheral that macOS reconnects on its own is now adopted event-driven via the global connect observer rather than waiting for the next tick. Per-peripheral handoffs no longer strand a device on neither Mac: a failed send rolls it back onto this Mac (immediately when the peer was unreachable, otherwise via the HOLDS_ONE-gated watcher), and both send and take arm the watcher on failure so a device that needs a power-cycle is recovered once it reappears — only ever reclaiming one the peer isn't holding. Also fixes a latent bug where a deliberate release whose disconnect notification never arrived left a stale flag that suppressed the next genuine drop's reconnect; intentional-release flags are now timestamped and honored only within a short grace window.
|
🎉 This PR is included in version 2.13.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
What
The auto-reconnect watcher is now prompt and bounded, and per-peripheral handoffs no longer strand a device on neither Mac.
Test plan