fix(dashboard): remove lastSeen from metrics useMemo deps to break render loop

lastSeen tracked workspacesQ.dataUpdatedAt which updates on every background
refetch, creating a new metrics object reference each cycle. The useEffect
dep on metrics then fired unconditionally, calling onMetrics → setMetricsById
→ Dashboard re-render → another refetch → infinite loop.

computeFleetAggregates never reads lastSeen, so reporting it upward was
pointless. Hardcode null and drop it from the dep array entirely.
This commit is contained in:
Offending Commit
2026-06-03 17:27:42 -05:00
parent 36fb6ee519
commit f79cdafba7

View File

@@ -88,10 +88,10 @@ export function ServerWorkspaceRows({ instance, onOpenWorkspace, onMetrics }: Pr
conclusionCount,
queueActive,
queuePending,
lastSeen,
lastSeen: null,
health,
}),
[totalWorkspaces, conclusionCount, queueActive, queuePending, lastSeen, health],
[totalWorkspaces, conclusionCount, queueActive, queuePending, health],
);
const lastReported = useRef<FleetRowMetrics | null>(null);