Bug: auto-withdraw retries after successful Terra submit, shows FAILED #87
Labels
No labels
agent:implement
agent:ready
backend
bug
cannot-reproduce
confirmed
desktop
docs
documentation
duplicate
enhancement
feature
frontend
good first issue
help wanted
high-risk
in-review
invalid
mobile
needs-triage
P0-critical
P1-high
P2-medium
P3-low
qa
QA
question
ready
report
responsive
security
security-escalate
smart-contract
solana
tablet
test-pass
ux
wallet-issue
wallet:keplr
wallet:metamask
wallet:station
wallet:walletconnect
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-bridge-monorepo#87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Anvil->LocalTerra E2E: auto-withdraw submits withdraw_submit to Terra successfully (txHash D668A506..., 'Transaction confirmed successfully' in console). But useAutoWithdrawSubmit fires again immediately, gets 'Withdrawal already submitted' rejection from Terra bridge, and TransferStatusPage shows HASH SUBMISSION FAILED from the retry error — hiding the successful first submission.
Console shows:
The transfer actually succeeded on-chain but the user sees a failure. Found on v0.1.197/84cf7e4, Anvil->LocalTerra 99.50 TKNA nonce 5.
mentioned in issue #67
mentioned in commit
19299b8d84Fix (landed on
feat/solana-integration)Cause: The Terra contract returns Withdrawal already submitted (with “withdrawal”), but the frontend only matched withdraw already submitted, so the duplicate-submit path was classified as a generic contract error. That skipped the recovery branch and surfaced Hash Submission Failed even when the first tx had succeeded.
What we changed:
WITHDRAW_ALREADY_SUBMITTED, including inside the generic “execute wasm contract failed” handler.useAutoWithdrawSubmitwhen aCONTRACT_ERRORstill clearly indicates duplicate withdraw.Tests:
packages/frontend/src/services/terra/transaction.test.tscovers the contract wording and wasm-wrapped case.@Brouie — could you re-run Anvil → LocalTerra auto-withdraw on a build that includes this commit and confirm you no longer see FAILED after a successful first submit? If anything still flakes, paste console + lifecycle steps. Thanks!
Implemented fix in
useAutoWithdrawSubmit: per-transfer async lock (survives Strict Mode / double effects), early exit when localStorage already has a successful hash submit, and broader duplicate-withdraw error recovery (plainErrormessages with the same wording).Pushed on
feat/solana-integration(commit7d21f4c).@Brouie could you review when you have a chance?
mentioned in commit
7d21f4cfa3verified -- no duplicate auto-withdraw observed on today's session. Terra->EVM auto-withdraw fires once, 'Withdrawal already submitted' correctly caught on retry. duplicate prevention commit
7d21f4cconfirmed working.