Skip to content

fix: unstick taking peripherals from an absent peer - #108

Open
MegaManSec wants to merge 1 commit into
mainfrom
fix/takeover-stuck-pairing
Open

fix: unstick taking peripherals from an absent peer#108
MegaManSec wants to merge 1 commit into
mainfrom
fix/takeover-stuck-pairing

Conversation

@MegaManSec

Copy link
Copy Markdown
Owner

Taking peripherals from a locked or sleeping Mac could sit at "Pairing…" for minutes with no way out, while a manual connect from System Settings worked immediately.

  • Take-from-peer connects now try openConnection() on the existing bond first (the same cheap connect System Settings does) and only remove + re-pair when the open is refused; the fresh pair pages continuously instead of gating on an RSSI probe an idle Magic device doesn't answer.
  • A "Pairing…" row in the dropdown is clickable to cancel the attempt: the attempt token is superseded (in-flight side effects re-check it before doing anything destructive), the pending pair is stopped, and the auto-reconnect watcher is stood down. Cancel is refused while a take's release round trip is still on the wire, so a released peripheral can't be stranded unclaimed.
  • A live snapshot now adopts a connect made outside the app while a row shows "Pairing…", instead of holding the stale state until the 60s watchdog fires.

Also fixes a shadowed window check in MenuRowControl.mouseDown that made its stale-row guard a no-op.

Take-from-peer connects open the existing bond first (the connect System
Settings performs) and only remove + re-pair when that open is refused;
the fresh pair pages continuously instead of gating on an RSSI probe an
idle Magic device doesn't answer. A "Pairing…" dropdown row is clickable
to cancel the attempt. Live snapshots adopt a connect made outside the
app instead of holding "Pairing…" until the watchdog fires.
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