From b3251e924432a4d16f047df6b06a8df6512a7602 Mon Sep 17 00:00:00 2001 From: DanS Date: Mon, 15 Jun 2026 22:59:34 -0500 Subject: [PATCH] feat(lite): mirror errors into the lite Console (copyable), not just toasts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lite send/shield, unlock, and key-import failures were shown only as transient toasts — impossible to copy. Route them through liteLog() so they also appear in the lite Console (which has a Copy button), alongside the lifecycle/open/sync errors the controller already logs: - send/shield broadcast failures (App broadcast-result delivery) - wallet unlock failure - key import failure (controller; logs the error text only, never the key) Co-Authored-By: Claude Opus 4.8 --- src/app.cpp | 9 ++++++++- src/wallet/lite_wallet_controller.cpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app.cpp b/src/app.cpp index 51713c9..45eaadf 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -532,6 +532,10 @@ void App::update() // Deliver a completed async send/shield result to the waiting send_tab callback. wallet::LiteBroadcastResult broadcast; if (lite_wallet_->takeBroadcastResult(broadcast)) { + // Mirror failures into the lite Console (copyable) in addition to the toast the send UI + // shows — transient toasts are easy to miss and impossible to copy. + if (!broadcast.ok) + wallet::liteLog("Send/shield failed: " + broadcast.error); if (lite_send_callback_) { lite_send_callback_(broadcast.ok, broadcast.ok ? broadcast.txid : broadcast.error); lite_send_callback_ = nullptr; @@ -2243,7 +2247,10 @@ void App::renderLiteUnlockPrompt() const bool ok = lite_wallet_->unlockWallet(pass); sodium_memzero(pass, sizeof(pass)); if (ok) ui::Notifications::instance().success(TR("lite_unlock_ok"), 5.0f); - else ui::Notifications::instance().error(TR("lite_unlock_failed")); + else { + wallet::liteLog(std::string("Unlock failed: ") + TR("lite_unlock_failed")); + ui::Notifications::instance().error(TR("lite_unlock_failed")); + } lite_unlock_prompt_ = false; ImGui::CloseCurrentPopup(); } diff --git a/src/wallet/lite_wallet_controller.cpp b/src/wallet/lite_wallet_controller.cpp index ee32d0f..bf79817 100644 --- a/src/wallet/lite_wallet_controller.cpp +++ b/src/wallet/lite_wallet_controller.cpp @@ -896,6 +896,7 @@ LiteImportResult LiteWalletController::importKey(std::string spendingOrViewingKe LiteImportResult alt = runImport(transparentFirst ? "import" : "timport"); if (alt.ok) out = alt; } + if (!out.ok) liteLog("Key import failed: " + out.error); // error text only — never the key secureWipeLiteSecret(spendingOrViewingKey); // wipe our copy after both attempts return out; }