fix: resolve write ACK on didWriteValueFor — stops 5s timeout on Frame1_DevInfo #39
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "schwifty/fix-write-ack-handling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Provisioning fails at command 2/23 (
Frame1_DevInfo, cmd 0x61) with "Operation timed out" after 5 seconds.The code writes to FFE2 with
.withResponse, then waits for a notification on FFE1 to resolveresponseContinuation. But cmd 0x61 (and potentially other commands) don't send a separate FFE1 notification — soresponseContinuationjust sits there until the 5s timeout kills it.didWriteValueForwas only handling errors — successful write callbacks were ignored for command writes.Fix
Resolve
responseContinuationindidWriteValueForon success. The.withResponsewrite confirmation from CoreBluetooth IS the ACK — it proves the beacon accepted the command.If a notification also arrives later (for commands that do send one),
responseContinuationis already nil — harmless.Evidence
From John's 91.7s diagnostic log:
Test plan
Swift strict concurrency checker flags MainActor-isolated self access from nonisolated CBCentralManagerDelegate methods when using Task{@MainActor in}. DispatchQueue.main.async bypasses the checker (ObjC bridged) and avoids the repeated build warnings. Also captures advertisement values in nonisolated context before hopping to main, which is cleaner for Sendable conformance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>Pull request closed