From 60c0221a3798ab93f5667fd53cc7231c3f9018d2 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 21 Dec 2025 12:27:53 +0000 Subject: [PATCH] fix(ui): make anomalies fetch resilient to failures Separate anomalies API call from Promise.all so that a failure in the anomalies endpoint doesn't break the entire AI Overview. This fixes 'Failed to load AI overview data' error when the anomalies endpoint isn't available (e.g., patrol not started). --- .../src/components/shared/AIOverviewTable.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend-modern/src/components/shared/AIOverviewTable.tsx b/frontend-modern/src/components/shared/AIOverviewTable.tsx index cb997e7..8418572 100644 --- a/frontend-modern/src/components/shared/AIOverviewTable.tsx +++ b/frontend-modern/src/components/shared/AIOverviewTable.tsx @@ -58,16 +58,23 @@ export const AIOverviewTable: Component<{ showWhenEmpty?: boolean }> = (props) = setLoading(true); setError(''); try { - const [predResp, corrResp, remResp, changesResp, anomalyResp] = await Promise.all([ + // Fetch all Pro features together + const [predResp, corrResp, remResp, changesResp] = await Promise.all([ AIAPI.getPredictions(), AIAPI.getCorrelations(), AIAPI.getRemediations({ hours: 168, limit: 6 }), AIAPI.getRecentChanges(24), - AIAPI.getAnomalies(), ]); - // Handle anomalies (FREE - no license required) - setAnomalies(anomalyResp.anomalies || []); + // Fetch anomalies separately (FREE feature - don't let failures break Pro features) + try { + const anomalyResp = await AIAPI.getAnomalies(); + setAnomalies(anomalyResp.anomalies || []); + } catch { + // Anomalies endpoint may fail if patrol not initialized - that's OK + setAnomalies([]); + } + // Handle insights lock const insightsLockedState = Boolean(predResp.license_required || corrResp.license_required);