From 7ba17a016140f578bccca3ffd320c1663cf66c6c Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Fri, 9 May 2025 22:34:25 +0200 Subject: Make the relay acknowledge all received commands To that effect, bump liberty and the xC relay protocol version. Relay events have been reordered to improve forward compatibility. Also prevent use-after-free when serialization fails. xP now slightly throttles activity notifications, and indicates when there are unacknowledged commands. --- xM/main.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xM') diff --git a/xM/main.swift b/xM/main.swift index 48f26c4..39b66c5 100644 --- a/xM/main.swift +++ b/xM/main.swift @@ -173,8 +173,11 @@ class RelayRPC { func send(data: RelayCommandData, callback: Callback? = nil) { self.commandSeq += 1 let m = RelayCommandMessage(commandSeq: self.commandSeq, data: data) - if let callback = callback { - self.commandCallbacks[m.commandSeq] = callback + self.commandCallbacks[m.commandSeq] = callback ?? { error, data in + if data == nil { + NSSound.beep() + Logger().warning("\(error)") + } } var w = RelayWriter() -- cgit v1.2.3-70-g09d2