From 86b317b5c6b0e5fe2de821bc1bbd6aa9171069a0 Mon Sep 17 00:00:00 2001 From: jedarden Date: Sat, 4 Jul 2026 04:38:15 -0400 Subject: [PATCH] fix(dashboard): populate active link count in calibration_complete event (bf-5ba) The calibration_complete WebSocket event sent to the guided-troubleshooting dashboard hardcoded links: 0. Read the actual count of active links from the ingestion server via GetAllLinksInfo() (the same source the dashboard snapshot uses for its links list) so the post-calibration display reflects reality. Co-Authored-By: Claude --- mothership/cmd/mothership/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mothership/cmd/mothership/main.go b/mothership/cmd/mothership/main.go index 296e2a8..11baf8d 100644 --- a/mothership/cmd/mothership/main.go +++ b/mothership/cmd/mothership/main.go @@ -1509,13 +1509,19 @@ func main() { } }) guidedMgr.SetOnCalibrationComplete(func(zoneID int, qualityBefore, qualityAfter float64) { - // Send WebSocket event to dashboard + // Send WebSocket event to dashboard. Populate the active link count + // from the ingestion server so the guided-troubleshooting dashboard + // reflects how many links participated in the re-baseline. + linkCount := 0 + if ingestSrv != nil { + linkCount = len(ingestSrv.GetAllLinksInfo()) + } msg := map[string]interface{}{ "type": "calibration_complete", "zone_id": zoneID, "quality_before": qualityBefore, "quality_after": qualityAfter, - "links": 0, // TODO: get actual link count + "links": linkCount, } data, _ := json.Marshal(msg) if dashboardHub != nil {