From 862714982e34999a21fe64a7edf0f5cdb8bf74cd Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Thu, 14 May 2026 13:55:35 +0200 Subject: [PATCH] fix: reset _ping_ack_seen on detail view enter and exit Stale _ping_ack_seen=true from a previous ping attempt could cause an immediate PING_OK (with wrong RTT) on the next ping if the new ACK entry hadn't appeared in the table yet. Reset the flag everywhere _ping_state is set to PING_IDLE. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/NearbyScreen.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/companion_radio/ui-new/NearbyScreen.h b/examples/companion_radio/ui-new/NearbyScreen.h index d8251a11..72526ba1 100644 --- a/examples/companion_radio/ui-new/NearbyScreen.h +++ b/examples/companion_radio/ui-new/NearbyScreen.h @@ -284,8 +284,9 @@ public: // ── detail view input ──────────────────────────────────────────────────── if (_detail) { if (c == KEY_CANCEL || c == KEY_CONTEXT_MENU) { - _detail = false; - _ping_state = PING_IDLE; + _detail = false; + _ping_state = PING_IDLE; + _ping_ack_seen = false; return true; } if (c == KEY_ENTER && _ping_state == PING_IDLE) { @@ -337,8 +338,9 @@ public: return true; } if (c == KEY_ENTER && _count > 0) { - _detail = true; - _ping_state = PING_IDLE; + _detail = true; + _ping_state = PING_IDLE; + _ping_ack_seen = false; return true; } if (c == KEY_LEFT) {