fix: clear recipient check loading state on RPC timeout - #301
Open
Bellamzy wants to merge 1 commit into
Open
Conversation
- checkRecipientExists now accepts { signal?, timeoutMs? } and wraps
getAccount() in withTimeout (default 10s) so a hung RPC provider
never leaves the promise unsettled indefinitely
- Re-throws OperationAbortedError so callers can skip stale state updates
- useEffect in CreatePage creates an AbortController per run; cleanup
aborts in-flight checks and resets status to idle immediately
- A hard 10s setTimeout inside the debounce callback aborts if the RPC
never responds, guaranteeing the spinner is always cleared
- Stale result race (address changed mid-flight) eliminated by checking
signal.aborted before calling setRecipientStatus
Fixes: stuck 'Verifying recipient…' button state on RPC timeout
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.
fix: clear recipient check loading state on RPC timeout
Problem
When the RPC provider timed out or hung during the on-chain recipient existence check, the
recipientStatus state was left at 'checking' indefinitely. This kept the submit button stuck
showing "Verifying recipient…" with no way for the user to proceed or recover — they had to
reload the page.
Two secondary issues existed alongside it:
land after the new check started, incorrectly flipping the status.
an unmounted component.
Changes
lib/soroban.ts
s), so a hung RPC provider always causes a rejection rather than an eternal pending promise.
genuine network failure and skip stale state updates.
app/create/page.tsx
both address-change and component-unmount cases.
responds, ensuring the spinner is always cleared regardless of network behaviour.
superseded check from landing.
Testing
transitions to 'error' after 10 s and the button becomes usable again.
Bug: Token Selector hangs infinitely #123