Skip to content

Commit 3d0b1e1

Browse files
fix(logs): drop stray leading newline from SSE log event messages
Five broadcast('log', ...) calls in pipeline.js prefixed their message with a literal \n (terminal-era vertical spacing). On the dashboard live log each line is its own DOM entry, so the leading newline rendered as a stray blank line at the start of the message. Removed the prefix from the Phase 2 / Phase 3 / batch-paying / internet-down / internet-retest lines. File-only logLine() audit-log separators are untouched (not event messages — they write to disk for readability, not the SSE stream).
1 parent 458540d commit 3d0b1e1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

audit/pipeline.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async function waitForInternet(broadcast, state) {
123123
state.status = 'paused_internet';
124124
state.pauseReason = 'Internet down — checking with backoff';
125125
broadcast('state', { state });
126-
broadcast('log', { msg: `\n🌐 Internet appears down. Pausing audit...` });
126+
broadcast('log', { msg: `🌐 Internet appears down. Pausing audit...` });
127127

128128
const BACKOFF_MS = [30_000, 60_000, 120_000, 300_000, 600_000, INTERNET_POLL_MS];
129129
let attempt = 0;
@@ -754,7 +754,7 @@ export async function runAudit(resume, state, broadcast, preloadedNodes = null,
754754
broadcast('state', { state });
755755

756756
// ── Phase 2: Parallel online scan ──
757-
broadcast('log', { msg: `\n🔍 Phase 2: Scanning ${nodesToTest.length} nodes in parallel (30 concurrent)...` });
757+
broadcast('log', { msg: `🔍 Phase 2: Scanning ${nodesToTest.length} nodes in parallel (30 concurrent)...` });
758758
const onlineNodes = await scanNodesParallel(nodesToTest, 30, broadcast, state);
759759
broadcast('log', { msg: `Scan complete: ${onlineNodes.length}/${nodesToTest.length} online.` });
760760

@@ -809,7 +809,7 @@ export async function runAudit(resume, state, broadcast, preloadedNodes = null,
809809
for (let i = 0; i < viableNodes.length; i += BATCH_SIZE) {
810810
batches.push(viableNodes.slice(i, i + BATCH_SIZE));
811811
}
812-
broadcast('log', { msg: `\n💳 Phase 3: ${batches.length} payment batches × ${BATCH_SIZE} nodes.` });
812+
broadcast('log', { msg: `💳 Phase 3: ${batches.length} payment batches × ${BATCH_SIZE} nodes.` });
813813

814814
let _lastBalanceRefresh = Date.now();
815815
const BALANCE_REFRESH_INTERVAL = 5 * 60_000; // Refresh real balance every 5 minutes
@@ -839,7 +839,7 @@ export async function runAudit(resume, state, broadcast, preloadedNodes = null,
839839
batchSessionMap = new Map();
840840
} else {
841841
try {
842-
broadcast('log', { msg: `\n💳 Batch ${b + 1}/${batches.length} (${batch.length} nodes) — paying...` });
842+
broadcast('log', { msg: `💳 Batch ${b + 1}/${batches.length} (${batch.length} nodes) — paying...` });
843843
batchSessionMap = await submitBatchPayment(client, account, DENOM, GIGS, batch, state, broadcast);
844844
} catch (payErr) {
845845
// Insufficient funds from chain — pause instead of failing
@@ -1121,7 +1121,7 @@ export async function runAudit(resume, state, broadcast, preloadedNodes = null,
11211121
// ─── Auto-retest internet-failure nodes ─────────────────────────────────
11221122
const internetFailAddrs = state._internetFailAddrs;
11231123
if (internetFailAddrs && internetFailAddrs.size > 0 && !state.stopRequested) {
1124-
broadcast('log', { msg: `\n🌐 Retesting ${internetFailAddrs.size} nodes that failed during internet outage...` });
1124+
broadcast('log', { msg: `🌐 Retesting ${internetFailAddrs.size} nodes that failed during internet outage...` });
11251125
state.retestMode = true;
11261126
clearPoisonedSessions();
11271127
// Do NOT clearPaidNodes() here — these nodes were paid in the main pass and

0 commit comments

Comments
 (0)