From 0e2e149e184903d99755b02e671bead3885aa797 Mon Sep 17 00:00:00 2001 From: MarekZegare4 Date: Sun, 14 Jun 2026 14:34:58 +0200 Subject: [PATCH] =?UTF-8?q?fix(ui):=20DM=20marker=20stuck=20at=20=E2=9C=97?= =?UTF-8?q?=20for=20on-device=20sends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit isAckPending() only tracks app/serial-initiated DMs (expected_ack_table); a DM composed on the device UI registers in BaseChatMesh's own ack table, so gating the UI notification on that table left every on-device DM timing out to ✗. Notify the UI on every ACK and let it match the crc against its own pending tag; APC SNR sampling stays gated on isAckPending(). Co-Authored-By: Claude Opus 4.8 --- examples/companion_radio/MyMesh.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 5052fd2f..e6f5d5f1 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -1186,7 +1186,12 @@ void MyMesh::onAckRecv(mesh::Packet* packet, uint32_t ack_crc) { bool mine = isAckPending(ack_crc); BaseChatMesh::onAckRecv(packet, ack_crc); if (mine && _prefs.tx_apc) apcSampleSnr(radio_driver.getLastSNR()); - if (mine && _ui) _ui->onMsgAck(ack_crc); // drive DM delivery-status marker + // Drive the DM delivery-status marker. Note isAckPending() only covers + // app/serial-initiated sends (expected_ack_table); a DM composed on the + // device UI registers in BaseChatMesh's own ack table instead, so gating on + // `mine` here would leave every on-device DM stuck at ✗. The UI matches the + // crc against its own pending tag, so an unrelated/overheard ACK is ignored. + if (_ui) _ui->onMsgAck(ack_crc); } MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMeshTables &tables, DataStore& store, AbstractUITask* ui)