Skip to content

fix(withdraw): stop success receipt showing 'Sent to undefined' - #2572

Merged
jjramirezn merged 1 commit into
mainfrom
hotfix/withdraw-receipt-undefined-recipient
Jul 29, 2026
Merged

fix(withdraw): stop success receipt showing 'Sent to undefined'#2572
jjramirezn merged 1 commit into
mainfrom
hotfix/withdraw-receipt-undefined-recipient

Conversation

@kushagrasarathe

@kushagrasarathe kushagrasarathe commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Reported by Kush while verifying the ENS hotfix: withdrawing to an external crypto wallet shows "Sent to undefined" in the success receipt drawer.

Root cause (pre-existing since May 2025, exposed by the crypto-withdraw path): PaymentSuccessView builds the drawer's userName as user?.username || parsedPaymentData?.recipient?.identifier — both undefined for an external-wallet withdrawal — while recipientName a few lines up already has a proper address fallback. getTitle then renders Sent to ${undefined}.

Fix: fall back to chargeDetails.requestLink?.recipientAddress (shortened by printableUserHandle at render), then recipientName.

Risks / breaking changes

  • Minimal: only changes the previously-undefined case; username/identifier paths unchanged.
  • Hotfix to main → back-merge debt (main→dev).

QA

  • typecheck ✅ · feature tests ✅ · prettier ✅
  • Repro: crypto withdraw to external wallet → success receipt now shows "Sent to 0x554a…54ab" instead of "Sent to undefined".

Screenshots: N/A capture (state requires a live withdraw); before-image in the report thread.

Summary by CodeRabbit

  • Bug Fixes
    • Improved transaction receipt details for external-wallet withdrawals.
    • Receipts now display the recipient’s available name or address instead of showing “Sent to undefined.”

external-wallet withdrawals have no recipient username or parsed
identifier, so the drawer's userName was undefined and the header
rendered the literal string. fall back to the recipient address
(shortened by printableUserHandle) like recipientName already does.
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jul 29, 2026 2:26pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The payment success view expands the transaction drawer’s recipient-name fallback chain to include request-link recipient addresses and recipient names after existing username and recipient-identifier values.

Changes

Payment receipt display

Layer / File(s) Summary
Transaction drawer recipient fallback
src/features/payments/shared/components/PaymentSuccessView.tsx
transactionForDrawer.extraDataForDrawer.userName now falls back through the user name, payment recipient identifier, request-link recipient address, and recipient name.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: 0xkkonrad

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main fix: preventing withdrawal success receipts from showing "Sent to undefined".
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/withdraw-receipt-undefined-recipient

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6310.83 → 6311.08 (+0.25)
Findings: 0 net (+3 new, -3 resolved)

🆕 New findings (3)

  • critical complexity — src/features/payments/shared/components/PaymentSuccessView.tsx — CC 58, MI 56.65, SLOC 159
  • medium high-mdd — src/features/payments/shared/components/PaymentSuccessView.tsx:82 — PaymentSuccessView: MDD 79.1 (uses across many lines from declarations)
  • medium high-mdd — src/features/payments/shared/components/PaymentSuccessView.tsx:145 — : MDD 25.3 (uses across many lines from declarations)

✅ Resolved (3)

  • src/features/payments/shared/components/PaymentSuccessView.tsx — CC 56, MI 56.71, SLOC 159
  • src/features/payments/shared/components/PaymentSuccessView.tsx:82 — PaymentSuccessView: MDD 76.7 (uses across many lines from declarations)
  • src/features/payments/shared/components/PaymentSuccessView.tsx:145 — : MDD 22.3 (uses across many lines from declarations)

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 2235 ran, 0 failed, 0 skipped, 38.3s

📊 Coverage (unit)

metric %
statements 61.7%
branches 45.1%
functions 51.0%
lines 62.1%
⏱ 10 slowest test cases
time test
3.9s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
1.0s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.5s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in validateInviteCode
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in validateInviteCode body
0.2s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › keeps stickers off the username pill (final pass respects the keep-out)
0.2s src/utils/__tests__/demo-balance.test.ts › starts at the full balance on a fresh install and stamps a timestamp
0.2s src/utils/__tests__/url.utils.test.ts › uses the public BASE_URL in Capacitor, not the localhost WebView origin
0.2s src/utils/__tests__/demo-balance.test.ts › resetDemoBalance refills and restarts the TTL window
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@kushagrasarathe

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kushagrasarathe
kushagrasarathe marked this pull request as ready for review July 29, 2026 15:06
@kushagrasarathe
kushagrasarathe requested a review from Hugo0 July 29, 2026 15:06
@jjramirezn
jjramirezn merged commit ff5bb72 into main Jul 29, 2026
26 of 28 checks passed
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