From 1166ea8ddeb50548c59e281664d7f97d70f97dcb Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Fri, 2 Oct 2026 11:25:58 +0200 Subject: [PATCH] fix(core): a flood DM's ACK folded into the return path reaches the UI The base class matched an ACK carried in a PATH packet without going through onAckRecv(), so the device UI's delivery marker never saw it and kept resending the DM until a plain ACK arrived. MyMesh now passes it on to the listener as well. Co-Authored-By: Claude Opus 5.5 --- examples/companion_radio/MyMesh.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 37847fab..531074b0 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -1360,7 +1360,17 @@ bool MyMesh::onContactPathRecv(ContactInfo& contact, uint8_t* in_path, uint8_t i } } // let base class handle received path and data - return BaseChatMesh::onContactPathRecv(contact, in_path, in_path_len, out_path, out_path_len, extra_type, extra, extra_len); + bool r = BaseChatMesh::onContactPathRecv(contact, in_path, in_path_len, out_path, out_path_len, extra_type, extra, extra_len); + // A flood DM's ACK comes back folded into the return path, which the base + // class matches without going through onAckRecv() -- so the UI's delivery + // marker never heard of it and kept resending. Tell it here too; it only + // acts on a crc matching one of its own pending DMs. + if (extra_type == PAYLOAD_TYPE_ACK && extra_len >= 4 && _listener) { + uint32_t ack_crc; + memcpy(&ack_crc, extra, 4); + _listener->onACKRecv(ack_crc); + } + return r; } #define CTL_TYPE_NODE_DISCOVER_REQ 0x80