From 8518a5d1b34a366afec7cc09e31bf8e46bbc5eb3 Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Sat, 14 Mar 2026 10:58:34 -0400 Subject: [PATCH] Fix map markers not clearing on cease and add telemetry RX logging Clear peer markers when locations list is empty (e.g. after cease signal) instead of returning early, which left stale markers on the map. Add debug logging around COLUMBA_META field handling to trace cease signal flow. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/tdeck_ui/UI/LXMF/UIManager.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/tdeck_ui/UI/LXMF/UIManager.cpp b/lib/tdeck_ui/UI/LXMF/UIManager.cpp index 44a9022c..6555e0d4 100644 --- a/lib/tdeck_ui/UI/LXMF/UIManager.cpp +++ b/lib/tdeck_ui/UI/LXMF/UIManager.cpp @@ -860,12 +860,31 @@ void UIManager::on_message_received(::LXMF::LXMessage& message) { const Bytes* meta_field = message.fields_get(Bytes(&meta_key, 1)); if (meta_field) { has_cease = true; + char log_buf[128]; + snprintf(log_buf, sizeof(log_buf), "[TELEM-RX] Got COLUMBA_META from %s (%d bytes)", + source_hex.c_str(), (int)meta_field->size()); + pyxis_log(log_buf); if (Telemetry::decode_columba_cease(*meta_field)) { + pyxis_log("[TELEM-RX] Cease signal decoded — removing peer location"); _telemetry_manager.on_cease_received(message.source_hash()); + snprintf(log_buf, sizeof(log_buf), "[TELEM-RX] Remaining locations: %d", + (int)_telemetry_manager.get_received_locations().size()); + pyxis_log(log_buf); if (_current_screen == SCREEN_MAP) { + pyxis_log("[TELEM-RX] Updating map markers after cease"); update_map_peer_markers(); + } else { + pyxis_log("[TELEM-RX] Not on map screen, markers will update on next view"); } + } else { + pyxis_log("[TELEM-RX] COLUMBA_META present but not a cease signal"); } + } else { + // Log all field keys we DO have for debugging + char log_buf[128]; + snprintf(log_buf, sizeof(log_buf), "[TELEM-RX] No COLUMBA_META (0x70) field found in message from %s", + source_hex.c_str()); + pyxis_log(log_buf); } } @@ -1096,7 +1115,11 @@ void UIManager::update_map_peer_markers() { if (!_map_screen) return; const auto& locs = _telemetry_manager.get_received_locations(); - if (locs.empty()) return; + if (locs.empty()) { + // Clear all markers (e.g. after cease) + _map_screen->update_peer_locations(nullptr, 0); + return; + } // Convert to MapScreen::PeerLocation array with display names std::vector peer_locs;