Skip to content

fix: serialize Bluetooth operations - #32

Merged
pantafive merged 1 commit into
mainfrom
fix/bluetooth-single-flight
Sep 1, 2026
Merged

fix: serialize Bluetooth operations#32
pantafive merged 1 commit into
mainfrom
fix/bluetooth-single-flight

Conversation

@pantafive

Copy link
Copy Markdown
Owner

Summary

  • replace one detached task per refresh with a single-flight coalescing loop
  • serialize paired-device enumeration, connect, and disconnect on one dedicated IOBluetooth queue
  • keep passive enumeration at utility QoS while allowing user actions to request higher QoS
  • pass only Sendable values back into Swift concurrency

Why

HAL device churn, popover openings, and delayed refreshes could start overlapping blocking IOBluetooth calls. Generation checks prevented stale publication but did not prevent the discarded work or contention in the Bluetooth daemon.

Verification

  • make test: 52 tests passed
  • Swift 6 strict-concurrency application build passed
  • SwiftLint passed

@pantafive
pantafive merged commit a95018b into main Sep 1, 2026
1 check passed
@pantafive
pantafive deleted the fix/bluetooth-single-flight branch September 1, 2026 13:01
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