fix: acknowledge duplicate commands to prevent sender retries
This commit is contained in:
@@ -673,6 +673,14 @@ local function main()
|
||||
|
||||
if isCommandDuplicate(message.commandId) then
|
||||
log.debug("NET", "Duplicate command skipped: %s", tostring(message.commandId))
|
||||
-- Still ACK so the sender stops retrying
|
||||
pcall(function()
|
||||
ctx.networkModem.transmit(replyChannel, cfg.ORDER_CHANNEL, {
|
||||
type = "command_ack",
|
||||
commandId = message.commandId,
|
||||
success = true,
|
||||
})
|
||||
end)
|
||||
else
|
||||
recordCommandId(message.commandId)
|
||||
cleanupCommandIds()
|
||||
|
||||
Reference in New Issue
Block a user