Skip to content

fix(dashboard): surface analytics overview timeouts instead of empty stats - #421

Open
santhiprakash wants to merge 1 commit into
oblien:mainfrom
santhiprakash:fix/analytics-overview-timeout-and-error-ui
Open

fix(dashboard): surface analytics overview timeouts instead of empty stats#421
santhiprakash wants to merge 1 commit into
oblien:mainfrom
santhiprakash:fix/analytics-overview-timeout-and-error-ui

Conversation

@santhiprakash

Copy link
Copy Markdown
Contributor

Summary

Raise the /analytics/overview client 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 useAnalyticsData but OverviewTab/MonitoringTab ignored error, 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 for fetchOverview (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) when analytics.error is set.
  • apps/dashboard/src/app/(dashboard)/projects/[id]/components/MonitoringTab.tsx — same error surface.
  • apps/dashboard/src/i18n/locales/*/projects.jsonanalytics.loadFailed string in all locales.

Verification

python3 ../scripts/preflight_ship.py --repo oblien/openship --local . --branch main \
  --file apps/dashboard/src/hooks/useProjectEndpoints.ts \
  --must-contain 'endpoints.analytics.overview' \
  --must-not-contain 'ANALYTICS_OVERVIEW_TIMEOUT_MS' --issue 396
# PREFLIGHT CLEAR

cd apps/dashboard && bun run test src/i18n/i18n-parity.test.ts
# 2 passed

Notes / Risks

  • Global network-error-handler still toasts on abort; this adds an inline, tab-local error so the empty-state widgets are not misleading.
  • 60s is a pragmatic ceiling; if aggregation routinely exceeds that, a follow-up could add server-side caching rather than raising the client timeout further.

Checklist

  • One change per PR — one bug, or one agreed feature, with nothing unrelated bundled in
  • The diff is scoped — no reformatting or lint fixes on lines I wasn't otherwise changing
  • A test fails without this change and passes with it (or I explained above why there isn't one)
  • bun run test, bun run --cwd <workspace> lint, and bun format all pass locally
  • I understand every line of this diff and can explain it in review

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overview page shows 0 requests / no traffic data on some projects (silent AbortError in root layout)

1 participant