Skip to content

Commit c136dba

Browse files
fix(eta): show 'Scanning…' during Phase-2 online scan instead of 'Calculating…'
During the parallel online scan, state.totalNodes is 0 (set only post-scan, pipeline.js ~802) and no node-test completions feed the ETA window, so the ETA is genuinely incomputable. The bare 'Calculating…' (admin) / 'ETA —' (live) read as frozen for the whole scan — minutes when many nodes are offline. Now both surfaces show 'Scanning…' while totalNodes<=0 and running, then fall through to 'Calculating…' (population known, <2 completions) and the live countdown. No change to the ETA math, ring, server, or TEST RUN paths.
1 parent ed4ef5f commit c136dba

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

admin.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,15 @@ <h1 style="margin:0;flex:0 0 auto">SENTINEL NODE TEST</h1>
15151515
const rem = Math.max(0, _etaAnchor.remainingMs - (Date.now() - _etaAnchor.at));
15161516
const h = Math.floor(rem / 3600000), m = Math.floor((rem % 3600000) / 60000), s = Math.floor((rem % 60000) / 1000);
15171517
el.textContent = `${String(h).padStart(2,'0')}:${String(m).padStart(2,'0')}:${String(s).padStart(2,'0')}`;
1518+
} else if (!Number.isFinite(state.totalNodes) || state.totalNodes <= 0) {
1519+
// No testable population established yet → we're still in the Phase-2
1520+
// online scan (totalNodes is only set post-scan, pipeline.js ~line 802).
1521+
// ETA is genuinely incomputable here (no completions to measure), so say
1522+
// "Scanning…" rather than "Calculating…" so it doesn't read as frozen.
1523+
el.textContent = 'Scanning…';
15181524
} else {
1525+
// Population known but <2 fresh completions in the ETA window → a real
1526+
// rate can't be derived yet. This clears after the first couple nodes.
15191527
el.textContent = 'Calculating...';
15201528
}
15211529
}

live.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,13 @@ <h1 class="live-page-title">
17391739
const m = Math.floor((rem % 3600000) / 60000);
17401740
const s = Math.floor((rem % 60000) / 1000);
17411741
etaEl.textContent = `ETA ${String(h).padStart(2,'0')}:${String(m).padStart(2,'0')}:${String(s).padStart(2,'0')}`;
1742+
} else if (_liveState && _liveState.status === 'running'
1743+
&& (!Number.isFinite(Number(_liveState.totalNodes)) || Number(_liveState.totalNodes) <= 0)) {
1744+
// Running but no testable population yet → still in the Phase-2 online
1745+
// scan (totalNodes is only set post-scan, pipeline.js ~line 802). ETA is
1746+
// genuinely incomputable (no completions to measure), so show "Scanning…"
1747+
// rather than a frozen-looking "ETA —". Parity with admin.html updateETA.
1748+
etaEl.textContent = 'ETA Scanning…';
17421749
} else {
17431750
etaEl.textContent = 'ETA —';
17441751
}

0 commit comments

Comments
 (0)