Conversation
refetchBalance() was called in onFinish, which fires as soon as the wallet broadcasts the transaction. At this point the transaction has not been mined yet, so the API returns the same (stale) balance. This could mislead users into thinking the tip was not processed or that they have more funds available than they actually do. Refs #243
Move the balance refresh into handleTxConfirmed, which is called by the TxStatus component only after the Stacks API reports the transaction as 'success'. The balance now reflects the actual on-chain state. Closes #243
When a transaction is aborted, the balance might have changed due to fees or if another transaction was processed concurrently. Refreshing after failure ensures accuracy.
When a transaction has been broadcast but not yet confirmed, display a subtle 'Pending confirmation' note below the balance. This sets the user's expectation that the shown balance may be stale.
Records when the balance was last successfully fetched so consumers can determine staleness.
Set MAX_RETRIES=2 and RETRY_DELAY_MS=1500 for balance fetch retries on transient network failures.
The balance fetch now retries up to MAX_RETRIES times with a RETRY_DELAY_MS delay between attempts. This handles transient network errors and brief API unavailability without surfacing errors to the user on the first failure.
Tests can now assert the transaction status without parsing CSS classes or label text.
Screen readers will announce the element as busy while the transaction is pending, then announce the final status when it changes.
Displays a subtle (n/60) counter so users can see the component is actively checking. Reduces anxiety about whether the status is being monitored.
Inform users that Stacks blocks typically take 10-30 minutes. This sets proper expectations and reduces premature 'is it stuck' concerns.
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.
Closes #243