Description:
hooks/use-dashboard-metrics.ts catch block (lines 55–63) sets error state but also assigns hardcoded zero metrics (totalPayments: 0, successRate: "0.0%", etc.). components/dashboard/overview-metrics.tsx may render these as real zeros rather than an error state.
This masks Horizon outages, invalid keys, and 500 responses as “you have no activity” instead of “metrics unavailable.” It is a data-fetching anti-pattern distinct from mock RecentBatchesTable defaults.
Proposed Solution:
On error, keep metrics null and let UI show <Alert> or skeleton with retry. Only use zero defaults when wallet disconnected. Pass error to overview cards.
Description:
hooks/use-dashboard-metrics.tscatch block (lines 55–63) setserrorstate but also assigns hardcoded zero metrics (totalPayments: 0,successRate: "0.0%", etc.).components/dashboard/overview-metrics.tsxmay render these as real zeros rather than an error state.This masks Horizon outages, invalid keys, and 500 responses as “you have no activity” instead of “metrics unavailable.” It is a data-fetching anti-pattern distinct from mock
RecentBatchesTabledefaults.Proposed Solution:
On error, keep
metricsnull and let UI show<Alert>or skeleton with retry. Only use zero defaults when wallet disconnected. Passerrorto overview cards.