From 900b2259e0f8e2693fefcd7a3fb5d3c3167ad6ec Mon Sep 17 00:00:00 2001 From: david Date: Tue, 16 Jun 2026 11:32:16 +0200 Subject: [PATCH] fix(wallet-monitor): honest log when wallets are low-but-deduped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The no-post branch logged "all wallets healthy" even when wallets were below threshold but simply already alerted within the reminder window — confusing in the cron log. Now distinguish: report the low-but-deduped count vs genuinely all-healthy. Co-Authored-By: Claude Opus 4.8 (1M context) --- wallet-monitor/src/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wallet-monitor/src/index.ts b/wallet-monitor/src/index.ts index de899b6..5dd8566 100644 --- a/wallet-monitor/src/index.ts +++ b/wallet-monitor/src/index.ts @@ -195,7 +195,14 @@ async function main(): Promise { `[wallet-monitor] posted roster: ${low.length} low, ${ok.length} ok, ${failed.length} failed`, ); } else { - console.log("[wallet-monitor] all wallets healthy — no Slack post"); + const lowCount = checked.filter( + (c) => c.error === null && c.lovelace !== null && c.lovelace < c.minLovelace, + ).length; + console.log( + lowCount > 0 + ? `[wallet-monitor] ${lowCount} wallet(s) low but already alerted within the reminder window — no Slack post` + : "[wallet-monitor] all wallets healthy — no Slack post", + ); } // Persist the new state (records ok/low statuses + advanced reminder stamps).