Skip to content

useDashboardMetrics replaces API failures with fake zero metrics #461

Description

@jahrulezfrancis

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.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programimprovementCode quality, refactoring, and technical debt

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions