fix(dashboard): surface analytics overview timeouts instead of empty stats - #421
Open
santhiprakash wants to merge 1 commit into
Open
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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