Skip to content

fix(qr-pay): handle missing merchant destinations - #3218

Merged
innolope-dev merged 1 commit into
devfrom
innolope/qr-payment-destination-not-found
Sep 17, 2026
Merged

innolope-dev merged 1 commit into
devfrom
innolope/qr-payment-destination-not-found

Conversation

@innolope-dev

Copy link
Copy Markdown
Collaborator

Pair the API PAYMENT_DESTINATION_NOT_FOUND response with the QR client.

  • recognize the typed code as deterministic and non-retryable
  • show the existing unavailable-merchant copy
  • cover the classifier path in unit tests

Pairs with peanut-api-ts PR #1595.

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
peanut-wallet Ready Ready Preview Sep 16, 2026 11:05pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 67fb817f-88fe-4af2-a0e1-0f5decbcd5b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 7997.19 → 7997.42 (+0.23)
Findings: 0 net (+3 new, -3 resolved)

🆕 New findings (3)

  • medium high-mdd — src/features/payments/flows/qr-pay/useQrFailureCopy.ts:13 — useQrFailureCopy: MDD 31.4 (uses across many lines from declarations)
  • medium complexity — src/features/payments/flows/qr-pay/init-error-classifier.ts — CC 26, MI 52.36, SLOC 112
  • medium complexity — src/features/payments/flows/qr-pay/useQrFailureCopy.ts — CC 5, MI 57.19, SLOC 61

✅ Resolved (3)

  • src/features/payments/flows/qr-pay/useQrFailureCopy.ts:13 — useQrFailureCopy: MDD 30.9 (uses across many lines from declarations)
  • src/features/payments/flows/qr-pay/init-error-classifier.ts — CC 26, MI 52.67, SLOC 109
  • src/features/payments/flows/qr-pay/useQrFailureCopy.ts — CC 5, MI 57.62, SLOC 59

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 7617 ran, 0 failed, 0 skipped, 2.8m

📊 Coverage (unit)

metric %
statements 78.7%
branches 65.8%
functions 72.8%
lines 79.8%
⏱ 10 slowest test cases
time test
🐢 9.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Network failure keeps loading while retries remain, then shows the generic error
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_SOURCE_OVER_MONTHLY_CAP fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_MERCHANT_VOLUME_NEAR_CAP fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_USER_NOT_PROVISIONED fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_MERCHANT_RECENT_REFUND fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › routes the KYC rejection on its wire code, and does not retry it
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › a refused idempotency key tells the user to scan again, not to contact support
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › User KYC not approved fails fast with copy that names the real cause
3.1s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
3.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Going offline blames the connection, and reconnecting clears it for the recovered scan
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chip review — no blocking findings — this is not an approval

No findings. The new destination-not-found code is preserved by the QR init transport, classified as deterministic, mapped to existing localized merchant-unavailable copy, and covered by the exact-head unit suite.

Checked clean

  • Exact head and trusted PR metadata matched the supplied repository, author, base ref, and SHAs.
  • Reviewed the three-file merge-base diff across wire-code recognition, retry behavior, scan outcome classification, and localized failure copy.
  • Verified the paired peanut-api-ts PR emits PAYMENT_DESTINATION_NOT_FOUND as a typed 422 code and the UI transport preserves response codes.
  • Exact-head unit, typecheck, eslint, format, screen-tests, native-export, and analyze checks succeeded; visual capture jobs were still in progress when checked.
  • Targeted local Jest execution was unavailable because the detached read-only worktree has no installed node_modules; exact-head CI unit coverage succeeded.

Security review: did not run — this change has no security, privacy or money surface, so it was not asked. This review is one reviewer short.

Third opinion by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.

Exact head: 3e445813a7a4 · Context: repo, sibling-repo · Took 7m

@github-actions

Copy link
Copy Markdown
Contributor

🖼 Visual diff — 2 screens moved

3 of 96 shots changed · 93 identical · baseline 404f40e → head 3e44581

worst % screen widths
12.26% avatar-picker 320, 430
0.58% guest-invite 430

job summary · before/after/diff images — artifact

Fixture screenshots, no backend. Advisory — this check never blocks a merge. Posted from the default branch by ds-shots-comment.yml; the report it renders is untrusted data.

@innolope-dev
innolope-dev merged commit 9aa135e into dev Sep 17, 2026
31 of 32 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.

1 participant