fix(web): break metricsEqual lastSeen dep-loop; add staleTime to test

Remove lastSeen from metricsEqual in ServerWorkspaceRows: computeFleetAggregates
never reads lastSeen, so comparing it in metricsEqual causes background TanStack
Query refetches (dataUpdatedAt changes) to trigger spurious onMetrics callbacks,
cascading into a Dashboard → ServerWorkspaceRows render loop that hits React's
100-render limit in CI.

Add staleTime: Infinity to the test QueryClient to prevent background refetches
from interfering with test assertions.
This commit is contained in:
Offending Commit
2026-06-03 17:01:19 -05:00
parent 1c28cae3f2
commit 173f096e33
2 changed files with 3 additions and 2 deletions

View File

@@ -34,7 +34,6 @@ function metricsEqual(a: FleetRowMetrics, b: FleetRowMetrics): boolean {
a.conclusionCount === b.conclusionCount &&
a.queueActive === b.queueActive &&
a.queuePending === b.queuePending &&
a.lastSeen === b.lastSeen &&
a.health === b.health
);
}

View File

@@ -41,7 +41,9 @@ function renderDashboard() {
routeTree,
history: createMemoryHistory({ initialEntries: ["/"] }),
});
const qc = new QueryClient({ defaultOptions: { queries: { retry: false } } });
const qc = new QueryClient({
defaultOptions: { queries: { retry: false, staleTime: Infinity } },
});
return render(
<QueryClientProvider client={qc}>
<DemoProvider>