fix: eight small fixes from an adversarial bug sweep - #99
Merged
Conversation
Discard racing the ~0.5s PBKDF2 save could interleave delete-then-add and leave the Mac paired with the discarded code; a transient keychain read failure at launch read as unpaired for the whole session.
The window is ordered out, not torn down, so onDisappear never fires and every hotkey stayed unregistered for the rest of the session.
A refused TCP connect parks NWConnection in .waiting and never reaches .failed, burning the full timeout and reporting "didn't respond"; and a wrong pairing code fails AEAD-open before the MAC compare, so it surfaced as "possible tampering" while the codes-don't-match message was unreachable.
Blocks record handshake failures against the old key — most commonly the legitimate peer mid-typo — and persisted up to 15 minutes past the fix.
A handed-off peripheral leaves the local paired snapshot, so type-based matching (menu icons, URL-scheme selectors) fell back to name-only exactly when a cross-Mac take needs it; and a stale attempt's devicePairingFinished could free a newer in-flight IOBluetoothDevicePair for the same address.
|
🎉 This PR is included in version 2.25.3 🎉 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.
Findings from a multi-agent review sweep (every finding independently re-traced against the code before fixing). One commit per concern; all are small and standalone.
pair()/unpair()ran unserialized on the global concurrent queue, so Discard during the ~0.5s PBKDF2 save deleted first and the save then resurrected the discarded code — the Mac stayed paired to a key the user threw away. Now serialized on one queue. Settings-open also re-reads pairing state, healing a transient keychain read failure that otherwise reads as "unpaired" all session.onDisappear(the window is ordered out, not torn down), leaving them unregistered all session. AwillCloseNotificationobserver now cancels the recording.NWConnectionin.waitingand never reaches.failed, so it burned the 5s timeout and reported "didn't respond". Both dialers now fail fast onECONNREFUSED.decryptionFailednow maps to the codes-don't-match message.deviceClasseswas rebuilt from the live paired snapshot, so a handed-off peripheral lost its Class of Device and type-based matching (menu icons,peripheral=<type>URL selectors) degraded to name-only exactly when a cross-Mactakeneeds it. Now persisted and merged. Plus an identity guard so a staledevicePairingFinishedcan't free a newer in-flight pair.Confirmed-but-deferred (need hardware testing, happy to file issues): connect-attempt bookkeeping lacks attempt identity (stale failures can clobber a newer attempt), wake reclaim with auto-reconnect off no-ops against sleep-released devices, and
unregisterFromPC/disconnectPeripheralrun blocking IOBluetooth calls on the main thread.Not built in Xcode here, but
swiftc -typecheckagainst the macOS SDK passes — please build before merging.