Skip to content

Commit 846c6d3

Browse files
fix(admin): clear baselineMbps on delete/clear so Avg Baseline doesn't linger
The "Avg Baseline" header stat is computed from baselineHistory, falling back to state.baselineMbps when the history is empty. clearActiveRunView (delete-active) and /api/clear cleared baselineHistory/nodeSpeedHistory but NOT baselineMbps — so after deleting a run the stat fell back to the deleted run's baseline and kept showing it. Null baselineMbps in both wipe paths (mirrors the baselineHistory clearing already there). Test suite green (188/31/45/35).
1 parent c00bf2e commit 846c6d3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,10 @@ function clearActiveRunView() {
10061006
// activeBatchId/resumeHeadAddr could mis-target a later resume.
10071007
state.baselineHistory = [];
10081008
state.nodeSpeedHistory = [];
1009+
// Also clear the single current-baseline value — the "Avg Baseline" header
1010+
// stat falls back to baselineMbps when baselineHistory is empty, so without
1011+
// this the DELETED run's baseline keeps showing after a delete.
1012+
state.baselineMbps = null;
10091013
state.currentNode = null;
10101014
state.resumeHeadAddr = null;
10111015
state.activeBatchId = 0;
@@ -2738,6 +2742,7 @@ app.post('/api/clear', adminOnly, (req, res) => {
27382742
state.retryCount = 0;
27392743
state.baselineHistory = [];
27402744
state.nodeSpeedHistory = [];
2745+
state.baselineMbps = null; // else "Avg Baseline" falls back to the stale value
27412746
// /api/clear wipes the DISPLAYED rows but keeps the active-run identity
27422747
// (activeRunNumber / activeDbRunId / pipeline run dir stay attached — use
27432748
// clearActiveRunView()/deleteRun to drop the identity). The counters above

0 commit comments

Comments
 (0)