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:
@@ -88,10 +88,10 @@ export function ServerWorkspaceRows({ instance, onOpenWorkspace, onMetrics }: Pr
|
|||||||
conclusionCount,
|
conclusionCount,
|
||||||
queueActive,
|
queueActive,
|
||||||
queuePending,
|
queuePending,
|
||||||
lastSeen,
|
lastSeen: null,
|
||||||
health,
|
health,
|
||||||
}),
|
}),
|
||||||
[totalWorkspaces, conclusionCount, queueActive, queuePending, lastSeen, health],
|
[totalWorkspaces, conclusionCount, queueActive, queuePending, health],
|
||||||
);
|
);
|
||||||
|
|
||||||
const lastReported = useRef<FleetRowMetrics | null>(null);
|
const lastReported = useRef<FleetRowMetrics | null>(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user