From 4e1f379d946305cd61530d3c8cec5a3e994cc2cb Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Mon, 23 Feb 2026 13:17:28 -0500 Subject: [PATCH] Persist only contacts to flash, mark on send/receive Only destinations that have exchanged messages are written to SPIFFS. UIManager marks destinations as persistent on send_message() and on_message_received(). Reduces persist time from 40-50s to <1s. Co-Authored-By: Claude Opus 4.6 --- deps/microReticulum | 2 +- lib/tdeck_ui/UI/LXMF/UIManager.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/deps/microReticulum b/deps/microReticulum index 12ef1ae..8532c0d 160000 --- a/deps/microReticulum +++ b/deps/microReticulum @@ -1 +1 @@ -Subproject commit 12ef1ae89447c0c36d286f82c9f2a434bd848e90 +Subproject commit 8532c0df1a52922bcf12a97c57b89eb613f62b56 diff --git a/lib/tdeck_ui/UI/LXMF/UIManager.cpp b/lib/tdeck_ui/UI/LXMF/UIManager.cpp index 3a65a72..8109990 100644 --- a/lib/tdeck_ui/UI/LXMF/UIManager.cpp +++ b/lib/tdeck_ui/UI/LXMF/UIManager.cpp @@ -593,6 +593,9 @@ void UIManager::send_message(const Bytes& dest_hash, const String& content) { std::string msg = "Sending message to " + hash_hex + "..."; INFO(msg.c_str()); + // Mark recipient as a persistent contact (survives reboot) + Identity::mark_persistent(dest_hash); + // Get our source destination (needed for signing) Destination source = _router.delivery_destination(); @@ -645,6 +648,9 @@ void UIManager::on_message_received(::LXMF::LXMessage& message) { std::string msg = "Message received from " + source_hex + "..."; INFO(msg.c_str()); + // Mark sender as a persistent contact (survives reboot) + RNS::Identity::mark_persistent(message.source_hash()); + // Save to store _store.save_message(message);