Skip to content

Handle reverted transactions in wallet transfer flow#2055

Merged
MusabShakeel576 merged 1 commit into
qafrom
claude/wallet-pending-activity-VfZbm
May 7, 2026
Merged

Handle reverted transactions in wallet transfer flow#2055
MusabShakeel576 merged 1 commit into
qafrom
claude/wallet-pending-activity-VfZbm

Conversation

@MusabShakeel576
Copy link
Copy Markdown
Contributor

Summary

Fixed a bug in the wallet transfer flow where reverted on-chain transactions were incorrectly marked as successful. The code now properly checks the transaction receipt status and marks transactions as failed when they revert on-chain.

Key Changes

  • Modified useTransferToWallet hook to inspect the transaction receipt status returned by waitForTransactionReceipt
  • Added validation to check if receipt.status !== 'success' before marking transaction as successful
  • When a transaction is reverted on-chain, the activity is now correctly updated with TransactionStatus.FAILED status and includes error metadata with the failure reason and timestamp
  • Early return prevents the success status update from being applied to failed transactions

Implementation Details

  • The viem library's waitForTransactionReceipt resolves with the receipt regardless of execution outcome, so explicit status checking is required
  • Reverted transactions have status: 'reverted' in the receipt object
  • Error metadata includes both the failure reason and a timestamp for debugging purposes

https://claude.ai/code/session_01RxjZ6dUk9zmVbuPEXcvqaX

useTransferToWallet's background receipt watcher fed the resolved
waitForTransactionReceipt promise straight to TransactionStatus.SUCCESS,
but viem resolves with the receipt regardless of execution outcome — a
reverted on-chain tx returns receipt.status === 'reverted' rather than
throwing.  Connect-wallet add-funds activities therefore flipped to
SUCCESS even when the user's transfer reverted on-chain, masking the
failure in the activity list / detail page.

Inspect receipt.status before promoting to SUCCESS; reverted receipts
go through the same FAILED + error-metadata path the .catch() branch
already uses, matching the contract pattern used in
useTransactionReceiptPolling and other deposit hooks.

https://claude.ai/code/session_01RxjZ6dUk9zmVbuPEXcvqaX
@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored May 7, 2026 0:16am
solid-app-staging Ignored Ignored May 7, 2026 0:16am

Request Review

@MusabShakeel576 MusabShakeel576 merged commit 67618de into qa May 7, 2026
4 of 5 checks passed
@MusabShakeel576 MusabShakeel576 deleted the claude/wallet-pending-activity-VfZbm branch May 7, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants