Skip to content

fix(interpose): non-blocking connect#21

Merged
0xnirapod merged 1 commit into
mainfrom
fix/async-connect
Jun 29, 2026
Merged

fix(interpose): non-blocking connect#21
0xnirapod merged 1 commit into
mainfrom
fix/async-connect

Conversation

@athexweb3

Copy link
Copy Markdown
Contributor

A central connect ran a synchronous loopback round-trip on the calling thread while the host blocked up to 9 seconds waiting for the link. On the main thread that froze the app past the system's 5-second termination watchdog, which SIGKILLed it.

Connect now returns as soon as the request is issued, matching a real CBCentralManager: the host acknowledges immediately and reports the outcome as a new CONNECTED or CONNECT_FAILED event, which the interposer turns into didConnectPeripheral or didFailToConnectPeripheral.

discoverServices, read, and setNotify keep the synchronous-latch pattern, which resolves quickly over an established connection.

A connect ran a synchronous round-trip on the calling thread while the
host blocked up to 9s for the link, freezing the app past the 5s
watchdog. Connect now returns at once; its outcome arrives as a
CONNECTED or CONNECT_FAILED event, like the real radio.
@athexweb3
athexweb3 requested a review from a team as a code owner June 29, 2026 16:42

@0xnirapod 0xnirapod left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking connect verified; full make test, docs, and fence green.

@0xnirapod
0xnirapod merged commit 8796665 into main Jun 29, 2026
3 checks passed
@0xnirapod
0xnirapod deleted the fix/async-connect branch June 29, 2026 16:47
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.

2 participants