fix(rain): 120s timeout on collateral withdraw submit (was 10s default → duplicate sends)#2279
Merged
Merged
Conversation
POST /rain/cards/withdraw/submit is synchronous: it broadcasts AND awaits on-chain confirmation (waitForUserOperationReceipt + confirmIntentByTxHash) and, for a request/charge, settles the charge in the same call. The FE's submitWithdrawal sent it with no timeoutMs, so it used fetchWithSentry's default 10s budget. When confirmation exceeds 10s the FE aborts while the tx still lands and the charge settles: the payer sees "there was an issue with your request" on a payment that SUCCEEDED, retries, and double-sends (observed in prod: one payer -> same recipient x3). #2245 (73f73bc) routed request payments through this submit path for the first time, which is why request-pays only started timing out now. Match the 120s budget the verified-withdrawal path already uses for the same synchronous-confirm reason. Fixes PEANUT-UI-QP5 (rain/cards/withdraw/submit timed out after 10000ms).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
ChangesWithdrawal submission
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes ✨ Finishing Touches📝 Generate docstrings
Comment |
Contributor
Code-analysis diffPainscore total: 5745.8 → 5745.8 (0) |
Contributor
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
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.
Hotfix — request payments via Rain card collateral double-send
Symptom (prod, post-#2245)
Paying a request / direct-send via Rain card collateral shows the payer "there was an issue with your request" after they sign — even though the payment succeeds on-chain. The payer retries → the retry also lands → duplicate send.
Observed: one payer → same recipient ×3 ($1 each) for a single intended $1 payment (tx
0x0ce1…confirmed at 23:20:54 while the FE showed an error).Root cause
POST /rain/cards/withdraw/submitis synchronous: it broadcasts and awaits on-chain confirmation (waitForUserOperationReceipt+confirmIntentByTxHash), and for a request/charge it settles the charge in the same call. The FE'ssubmitWithdrawalsent it with notimeoutMs→fetchWithSentry's default 10s. When confirmation exceeds 10s the FE aborts while the tx still lands and the charge settles → false error → retry → duplicate.Why now:
#2245(73f73bc53) routed request payments through this submit path for the first time. Card withdrawals already used it; request-pays — much higher frequency — only started hitting the 10s cap at go-live. Direct Sentry fingerprint:PEANUT-UI-QP5: rain/cards/withdraw/submit timed out after 10000ms(first seen at deploy).Fix
Give
submitWithdrawala 120s budget — the same value the verified-withdrawal path (rain.ts:~525) already uses for this exact synchronous-confirm reason. One line + an explanatory comment.Scope / risk
src/services/rain.ts. No behavior change except the client wait budget on this one money-path call.main(prod) as a mini-hotfix.Verification
Not in this PR (follow-ups)
payChargeprimitive.devso the next release doesn't regress it.