Skip to content

Commit 42f22f2

Browse files
leogdionclaude
andcommitted
fix(connectivity): auto-ack dictionary messages to avoid reply timeout
didReceiveMessage now calls replyHandler([:]) after forwarding, mirroring the binary didReceiveMessageData path. Without it, every reply-expecting sendMessage times out with WCErrorDomain 7012. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4723746 commit 42f22f2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Sources/SundialKitConnectivity/WatchConnectivitySession+WCSessionDelegate.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@
102102
let sendableMessage = ConnectivityMessage(forceCasting: message)
103103
let handler = unsafeBitCast(replyHandler, to: ConnectivityHandler.self)
104104
delegate?.session(self, didReceiveMessage: sendableMessage, replyHandler: handler)
105+
// Auto-acknowledge so the sender's reply-expecting `sendMessage` completes
106+
// immediately instead of timing out (WCErrorDomain 7012). Mirrors the binary
107+
// `didReceiveMessageData` path's `replyHandler(Data())`. Consumers needing to
108+
// send a real reply are not supported on this path.
109+
replyHandler([:])
105110
}
106111

107112
internal func session(

0 commit comments

Comments
 (0)