feat: add bounded retry/backoff and clear failure states for claim redemption (#397) - #416
Open
waterWang wants to merge 1 commit into
Open
Conversation
…demption (bridgelet-org#397) - claim-redemption.ts: safeguarded submission that disables transport-layer retries for the non-idempotent sweep call, classifies failures, and polls claim status on ambiguous outcomes to prevent double-submits - claim-page-client.tsx: drives submitClaimRedemption outcomes into UI state - claim-status-card.tsx: pending-confirmation / failed-safe-to-retry / failed-needs-support panels with plain-language copy - tests: 43 passing (13 new claim-redemption unit tests + UI state coverage)
|
@waterWang is attempting to deploy a commit to the aminubabafatima8-gmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
4 tasks
Contributor
|
@waterWang Can you look into your CI checks? |
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.
Description
Adds bounded retry with backoff and clear failure states for claim redemption under Stellar network congestion.
Problem
The
/claim/[token]flow had no documented handling for slow or failed responses from the SDK during sweep submission. A naive fetch-and-hope approach risked the recipient seeing a stuck spinner, or worse, a false failure for a transaction that actually succeeded on-chain (potentially leading to a double-submit on retry).Solution
claim-redemption.ts— New safeguarded submission module that:redeemClaimwith retries disabled (maxRetries: 0) to prevent auto-retry of a non-idempotent sweepverifyClaimon ambiguous failures to determine whether the sweep actually landed before offering a retryconfirmed,pending-confirmation,failed-safe-to-retry,failed-needs-supportclaim-page-client.tsx— UsessubmitClaimRedemptioninstead of the rawclient.redeemClaim; manages submission state from the parentclaim-status-card.tsx— New UI states:pending-confirmation: Blue spinner with "Your claim was received — checking status"failed-safe-to-retry: Amber warning with "Nothing was sent — safe to retry" + "Try again" buttonfailed-needs-support: Red alert with "Do not submit again — check your wallet"Testing
claim-redemption.test.tscovers: success, partial sweep, 409/410/404 errors, rate limit, network timeout → poll still pending (safe to retry), network timeout → poll shows claimed (pending-confirmation), poll failure (needs-support)Closes #397