Skip to content

Add exponential-backoff retry to useWalletBalance on network error #636

Description

@Kingsman-99

Description

useWalletBalance makes a single balance fetch and immediately shows an error state if the network request fails. Transient network issues cause the balance to show as failed for the entire session. Adding automatic retry with exponential backoff (up to 3 retries) makes the hook resilient to brief outages.

Acceptance Criteria

  • On a failed fetch the hook retries up to 3 times with delays of 1 s, 2 s, and 4 s
  • A "Retrying..." indicator is shown during retry attempts
  • After all retries are exhausted the error state is shown as before
  • A successful retry clears the error state and shows the balance
  • Existing tests continue to pass

Context

  • Target file: src/hooks/useWalletBalance.ts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions