fix(dashboard): surface analytics overview timeouts instead of empty stats - #421
fix(dashboard): surface analytics overview timeouts instead of empty stats#421santhiprakash wants to merge 3 commits into
Conversation
…stats - Problem: /analytics/overview can exceed the 15s client default for high-traffic projects; the abort left Overview/Monitoring tabs showing 0/N/A with no error. - Fix: request a 60s timeout for the overview fetch and render a retryable error state when analytics.error is set. - Verification: bun run test src/i18n/i18n-parity.test.ts (pass); preflight_ship.py clear for oblien#396.
5b393ad to
170c306
Compare
|
MonitoringTab blanks the whole tab (should-fix) geo map + top paths → useAnalyticsGeo (separate cache) |
…itoringView Address maintainer review on oblien#421: an /analytics/overview timeout was replacing the entire MonitoringTab via an early return, hiding the independent geo, usage, and history blocks. Move the error card into MonitoringView and scope it to the stats strip / traffic chart block (mirroring OverviewTab), so the rest of the tab still renders.
|
Pushed a follow-up commit to address the feedback. The early return in What changed:
Local verification:
Please take another look when you have a moment. |
Summary
Raise the
/analytics/overviewclient timeout and show a retryable error in Overview/Monitoring when the fetch fails, instead of silently rendering 0/N/A empty states.Motivation
Fixes #396. High-traffic projects can exceed the dashboard API client's 15s default while aggregating analytics. The abort was caught by
useAnalyticsDatabutOverviewTab/MonitoringTabignorederror, so users saw zeros and "No traffic data yet" even though the endpoint returns real data when called directly.Related issue
Closes #396
Changes
apps/dashboard/src/hooks/useProjectEndpoints.ts— use a 60s timeout forfetchOverview(same order of magnitude as other slow dashboard calls like deploy trigger).apps/dashboard/src/app/(dashboard)/projects/[id]/components/OverviewTab.tsx— render error card with retry (invalidateProjectCaches) whenanalytics.erroris set.apps/dashboard/src/app/(dashboard)/projects/[id]/components/MonitoringTab.tsx— same error surface.apps/dashboard/src/i18n/locales/*/projects.json—analytics.loadFailedstring in all locales.Verification
Notes / Risks
network-error-handlerstill toasts on abort; this adds an inline, tab-local error so the empty-state widgets are not misleading.Checklist
bun run test,bun run --cwd <workspace> lint, andbun formatall pass locally