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. --- xA/xA.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xA/xA.go') diff --git a/xA/xA.go b/xA/xA.go index 707a280..b4f796c 100644 --- a/xA/xA.go +++ b/xA/xA.go @@ -337,9 +337,14 @@ func relaySend(data RelayCommandData, callback callback) bool { CommandSeq: commandSeq, Data: data, } - if callback != nil { - commandCallbacks[m.CommandSeq] = callback + if callback == nil { + callback = func(err string, response *RelayResponseData) { + if response == nil { + showErrorMessage(err) + } + } } + commandCallbacks[m.CommandSeq] = callback commandSeq++ // TODO(p): Handle errors better. -- cgit v1.2.3-70-g09d2