Repository navigation
Fix Stellar wallet refresh error handling and transaction history mapping - #135
Merged
memplethee-lab merged 5 commits intoOct 12, 2026
Conversation
getTransactionHistory() requested /accounts/{id}/transactions, whose
records do not embed operations. The wallet then read
tx.operations?.records?.[0], so every row fell back to 'unknown / 0 XLM'
and the Recent Transactions list was effectively broken.
- Query /accounts/{id}/payments, which returns the counterparty and amount
inline, instead of fetching operations per transaction
- Add TransactionHistoryEntry and mapPaymentToHistoryEntry() to normalize
payment, create_account, account_merge and path-payment records
- Label non-payment operations instead of inventing a destination
Related to LintError#16
loadAccountData() caught every error, logged it, and returned, so a failed
refresh left stale balances on screen with no signal to the user.
- Keep the previous balances but expose the failure via refreshError state
- Show toastError('Failed to refresh balances') once per outage so the 30s
poll does not stack identical toasts on every tick
- Re-throw so useAccountPolling() can report the failure, and only show the
'Balances refreshed' toast in handleRefresh() when it actually succeeded
- Stop a failed post-creation refresh from turning account creation into a
'Failed to create account' error
Closes LintError#17
Users had no way to tell whether the balance on screen was fresh. Add a small status line under the balance: - 'Last updated <time>' after a successful load - 'Stale data - refresh failed' (with an icon, aria-live polite) when the most recent refresh failed Refs LintError#17
…states The Recent Transactions list now renders the normalized history entries: - Payment rows show the real amount plus asset (e.g. '2.5 XLM' or '10 USDC') and the destination instead of the previous 'unknown / 0 XLM' - Non-payment operations (account created/merged, path payments) render a readable label - The section is always shown with an explicit 'No transactions yet.' empty state, or 'Could not load transactions.' when the last refresh failed, so stale rows are never presented as live data Closes LintError#16
Document the failure-path checks the issues ask for, since there is no component-test harness yet: - Refresh failure with DevTools offline: error toast, stale indicator, previous balance retained, no toast spam - Transaction history shows real destination/amount and empty/error states Refs LintError#16 Refs LintError#17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stellar Wallet: refresh errors & transaction history
Summary
Two Stellar wallet bugs, both rooted in
StellarWallet.tsxandutils/stellar.ts.#17 - Failed refreshes were silent, leaving stale balances
loadAccountData()caught every error,console.error'd it and returned. The 30s poll and the manual Refresh button both swallowed failures, so users saw old balances with no indication anything went wrong - andhandleRefresh()always showed aBalances refreshedsuccess toast even when nothing was refreshed.refreshErrorstate and a once-per-outagetoastError('Failed to refresh balances'), so a persistent outage does not stack identical toasts.Stale data - refresh failed; after a good refresh it showsLast updated <time>.useAccountPolling()reports failure andhandleRefresh()only shows success when it truly succeeded.Failed to create account.#16 - Every history row showed "unknown / 0 XLM"
getTransactionHistory()fetched/accounts/{id}/transactions, whose records do not embed operations. The wallet then readtx.operations?.records?.[0], which was always undefined, defaulting tounknown/0./accounts/{id}/payments, which returns the counterparty and amount inline (no per-transaction operations round-trip).mapPaymentToHistoryEntry()normalizespayment,create_account,account_mergeandpath_payment_*records into a flatTransactionHistoryEntry.No transactions yet./Could not load transactions.states instead of stale rows.Files changed
src/utils/stellar.ts- payments endpoint +TransactionHistoryEntry/mapPaymentToHistoryEntry()src/components/stellar/StellarWallet.tsx- error/stale state, toasts, history renderingdocs/stellar-wallet-qa.md- manual QA notes for the failure pathTesting
Manual QA steps are documented in
docs/stellar-wallet-qa.md(refresh failure via DevTools offline, history mapping). This repo has no component test harness yet.Notes
HORIZON_URLremains the existing constant (extracting network config is tracked separately).Closes #16
Closes #17