Make the relay acknowledge all received commands
All checks were successful
Alpine 3.21 Success
Arch Linux AUR Success
OpenBSD 7.6 Success

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.
This commit is contained in:
2025-05-09 22:34:25 +02:00
parent 4cf8c394b9
commit 7ba17a0161
10 changed files with 158 additions and 68 deletions

View File

@@ -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.