Description: When the Stellar Horizon API is temporarily unavailable or rate-limited, the app should retry with exponential backoff instead of immediately showing an error. This is especially important for balance refresh and transaction history.
Requirements:
- Add a retry utility with exponential backoff (1s, 2s, 4s, 8s, max 30s)
- Apply to Horizon API calls in the wallet store and any transaction fetching
- Show a "Reconnecting..." indicator during retries
- After 3 failed retries, show the error with a manual "Retry" button
- Log retry attempts for debugging
Suggested execution steps:
- Create
lib/utils/retry.ts with a generic retryWithBackoff(fn, options) function
- In
lib/store/walletStore.ts, wrap the refreshBalances Horizon call with retry
- Add a
isReconnecting state to the store
- In the wallet page, show a subtle "Reconnecting..." banner when
isReconnecting is true
- After max retries, show the error with a manual "Retry" button
Example commit message:
feat(stellar): add exponential backoff retry for Horizon API calls
Created retryWithBackoff utility with 1s→2s→4s→8s→max 30s backoff.
Applied to wallet balance refresh and all Horizon API calls. Shows
"Reconnecting..." indicator during retries, manual "Retry" on failure.
Description: When the Stellar Horizon API is temporarily unavailable or rate-limited, the app should retry with exponential backoff instead of immediately showing an error. This is especially important for balance refresh and transaction history.
Requirements:
Suggested execution steps:
lib/utils/retry.tswith a genericretryWithBackoff(fn, options)functionlib/store/walletStore.ts, wrap therefreshBalancesHorizon call with retryisReconnectingstate to the storeisReconnectingis trueExample commit message: