Skip to content

chore: sync dev with main#1953

Merged
22 commits merged into
devfrom
main
May 10, 2026
Merged

chore: sync dev with main#1953
22 commits merged into
devfrom
main

Conversation

@chip-peanut-bot

Copy link
Copy Markdown
Contributor

Branch Sync

main is 17 commits ahead of dev.

Commits to sync:

• fix: bridge KYC state machine — unified gate, inline ToS, rejection handling
• chore: format with prettier
• chore: format manteca page and sumsub action
• fix: address review comments — try/catch in BridgeTosStep, safe metadata cast, gate fallthrough
• fix: add error for missing bank account id in claim flow
• fix: address hugo's review — prevStatusRef restore, typed silent result, dedup variant mapping
• test: add unit tests for useBridgeTransferReadiness hook
• fix: strengthen fetchCurrentStatus guard with userInitiatedRef to eliminate SDK auto-close race
• fix: revert temp balance check bypasses for withdraw and manteca pages
• chore: format manteca withdraw page
• fix(qr-pay): Pix-specific copy on QR decoding error + capture event
• fix(qr-pay): rail-specific decoding-error copy for QR3 too
• revert(qr-pay): keep MP fallback copy for ARGENTINA_QR3
• Merge pull request #1943 from peanutprotocol/fix/bridge-kyc-state-machine
• fix: format
• Merge branch 'main' into hotfix/qr-pix-decoding-error-message
• Merge pull request #1948 from peanutprotocol/hotfix/qr-pix-decoding-error-message


Auto-generated by Chip 🐿️

kushagrasarathe and others added 17 commits May 6, 2026 23:12
…andling

the bridge KYC state handling in transfer flows (withdraw, deposit, claim, qr-pay)
had multiple issues: wrong priority order, missing ToS checks, redirects instead of
inline flows, and broken rejection handling.

changes:
- new `useBridgeTransferReadiness` hook: unified pre-transfer gate with correct
  priority (hard rejection → tos → fixable rejection → enrollment → ready)
- `useBridgeTosStatus`: expanded to check `tos_acceptance`/`tos_v2_acceptance` in
  rail `additionalRequirements` metadata, not just `REQUIRES_INFORMATION` status
- `InitiateKycModal`: added `blocked` variant (contact support CTA), `error` prop
  for failed self-heal attempts
- withdraw/bank, add-money/bank, AddWithdrawCountriesList: replaced fragmented
  `needsBridgeEnrollment` + `guardWithTos` + `bridgeRejection` checks with unified gate
- BankFlowManager (claim flow): added ToS guard + rejection handling for non-guest paths
- qr-pay: replaced redirect-based KYC (`router.push('/profile/identity-verification')`)
  with inline sumsub SDK initiation (`handleInitiateKyc('LATAM')`)
- BridgeTosStep: show confirmation modal before iframe, prevent modal flash during
  confirmation with `isConfirming` state
- KycProviderRejection, ActivationCTAs, RegionsVerification: replaced broken
  `$crisp.push` calls with `setIsSupportModalOpen`
- useSumsubKycFlow: fixed race condition where `fetchCurrentStatus` closes SDK wrapper
  on first attempt by guarding with `showWrapperRef`
- useProviderRejectionStatus: permanent rejections now show generic support message
  instead of misleading "upload a clearer photo"
- DynamicBankAccountForm: `__silent__` sentinel to prevent form navigation when gate blocks
- close kyc modal via `sumsubFlow.showWrapper` effect instead of in `onVerify` callback
…ata cast, gate fallthrough

- BridgeTosStep: wrap confirmBridgeTosAndAwaitRails in try/catch to prevent
  isConfirming getting stuck on error
- useBridgeTosStatus: use Array.isArray guard for additionalRequirements metadata
- all gate checks: always return when gate is not ready, even if guardWithTos
  returns false (defensive)
…lt, dedup variant mapping

- useSumsubKycFlow: save/restore prevStatusRef on crossRegion failure to prevent
  suppressing subsequent legitimate APPROVED transitions
- DynamicBankAccountForm: replace __silent__ magic string with typed { silent: true }
- useBridgeTransferReadiness: extract getKycModalVariant() and getGateProviderMessage()
  helpers to deduplicate gate→modal mapping across 4 files
- BankFlowManager: only close kyc modal if sdk opened (check showWrapper), preserving
  error visibility on failure
…minate SDK auto-close race

the fetchCurrentStatus effect could still race with handleInitiateKyc in rare
cases — initiatingRef resets in the finally block before React batches the
showWrapper state update. adding userInitiatedRef as a guard permanently
disables the background fetch after any user-initiated flow, since the SDK
and websocket handle status updates from that point.
Users paying with a Pix QR were told to ask the merchant for a Mercado
Pago QR, which is wrong and confusing. Branch the message on qrType so
Pix scans get Pix-specific guidance.

Also capture qr_decoding_error_shown so we can measure how often this
fallback fires and which rails are most affected.
Per CodeRabbit review on #1948: ARGENTINA_QR3 was hitting the default
branch and getting told to ask the merchant for a Mercado Pago QR —
QR3 and Mercado Pago are distinct Argentine standards, so the copy
was actively misleading.

Now branches PIX, ARGENTINA_QR3, and the MP default explicitly.
In Argentina, Mercado Pago is the dominant rail and a workable fallback
when a QR3 code fails to decode — so suggesting "ask for a Mercado Pago
QR" is the most useful guidance for QR3 users too. Only Pix needs the
rail-specific copy because Brazil has no equivalent fallback.

Reverts the previous QR3-specific message; adds a comment explaining
the regional reasoning so future readers don't trip on the same point
CodeRabbit raised.
…hine

fix: bridge KYC state machine — unified gate, inline ToS, rejection handling
Signed-off-by: Juan José Ramírez <70615692+jjramirezn@users.noreply.github.com>
…rror-message

[TASK-19529] fix(qr-pay): Pix-specific copy on QR decoding error + capture event
@vercel

vercel Bot commented May 8, 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 May 9, 2026 3:52pm

Request Review

Hugo0 and others added 4 commits May 8, 2026 11:16
Sister change to peanut-api-ts hotfix/bridge-developer-fee-zero. With
the backend no longer attaching developer_fee_percent on Bridge
transfers, the UI's "amount you will receive" math must stop deducting
the same 50bps locally — otherwise we under-quote.

Setting BRIDGE_DEVELOPER_FEE_RATE to 0 turns applyBridgeCrossCurrencyFee
and reverseBridgeCrossCurrencyFee into identity functions, which
matches what Bridge actually delivers. The hardcoded "Fee: $ 0.00"
PaymentInfoRows in withdraw/bank-claim flows now become truthful.

Tests are reparameterized against the constant so they stay correct
when the FX-spread followup re-enables a margin.
…fee-zero

hotfix(bridge): zero-out cross-currency dev fee to match backend
ci: fix auto-bump PR base + add pull_request trigger to Tests
@Hugo0 Hugo0 closed this pull request by merging all changes into dev in c1a5358 May 10, 2026
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.

3 participants