Repository navigation
fix(neobank): keep VBA KYC pending until provider approval - #38688
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Smart E2E Test SelectionSelected E2E tags: ALL AI Confidence: 100 E2E reasoningExpand to readThis PR contains multiple high-risk changes that warrant running all E2E smoke tests:
The combination of major controller version bumps (transaction-controller 72→73, core-backend 12→13) with Engine type changes creates a critical risk level. The transaction-controller major bump alone could break any test that involves transaction submission, confirmation, or gas estimation. The hard rule seed of ALL tags is confirmed as appropriate given these controller version updates. |
|
@roz0n one more spot to cover here: |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@amitabh94 fixed in a08cdfd: microdeposit reads now require provider-final |
Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #38688 +/- ##
==========================================
+ Coverage 87.58% 87.63% +0.05%
==========================================
Files 7925 7967 +42
Lines 230191 231664 +1473
Branches 58385 58695 +310
==========================================
+ Hits 201603 203014 +1411
- Misses 16296 16304 +8
- Partials 12292 12346 +54 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks Arnold, this looks great for the in-session case. One scenario I want to make sure we cover is a reinstall. The user passed Sumsub (relay kycStatus approved), but MoonPay's finalStatus is still pending, and then they reinstall the app, so the local KYC session state is empty. Expected behavior is that tapping the Money card lands them on the 'Verifying your identity' pending screen and Sumsub doesn't open again. As far as I can tell, that path goes through resolveVbaOnboarding and relies on the snapshot fix in MetaMask/core#11243, but this branch still has @metamask/ramps-controller ^28.0.0. Could you pair the ramps-controller 29.0.0 and transaction-pay-controller ^30.3.3 bump with this PR, or confirm the current version already returns that snapshot? Could you also add a test where local session status is null and the hydrated server state is kycStatus approved with finalStatus pending, asserting the destination is kycPending and the Sumsub/KYC flow isn't started? Separately, vbaCustomerAbilities: null still looks missing from initial-background-state.json. |
|
Follow-up with more precise detail on the reinstall case: after the ramps-controller 29 bump, hydrate gives kycStatus 'pending' for this user, and the local providerFlowStatus is gone. So the identityVerification step in vbaOnboardingFunnel.ts isn't marked complete, and they get sent back into Sumsub. Could we treat a pending server KYC status with session disclaimers complete as past identityVerification? A getVbaDestinationForSnapshot test for this would be great: sessionExists true, disclaimers complete, kycStatus 'pending', providerFlowStatus not 'submitted', expecting 'kycPending'. Also please add "vbaCustomerAbilities": null to RampsController in app/util/test/initial-background-state.json along with the bump, since without the bump the #11243 fix won't take effect on mobile. |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
|
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@amitabh94 addressed both reinstall comments in fa47ee2 (with the Core bumps in e419494):
The two focused suites pass (63 tests), the Engine fixture assertion passed, and TypeScript passes. |
… round trip An approved account with a usable autoramp already has local account state. The CTA was awaiting resolveVbaOnboarding before navigating, which stutters and flashes a button spinner even though the details load instantly from the View Account Details action elsewhere on Money home. Route this case through openVbaEntry's fast path instead, which opens details immediately and hydrates in the background. Co-authored-by: Cursor <cursoragent@cursor.com>
…ramp account_is_ready also covers provider-final KYC before an autoramp exists. openVbaEntry only skips the loader for an Approved autoramp, so that tap was presenting the standalone loading screen and a second tap could mount it again. Use the persisted-details check, and leave the reentry guard set. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 890d841. Configure here.
The persisted-details tap left the reentry guard set, so the CTA stayed dead after returning to Money. Co-authored-by: Cursor <cursoragent@cursor.com>
A throw while starting the journey was dropping the Mixpanel click. Co-authored-by: Cursor <cursoragent@cursor.com>
|
There was a problem hiding this comment.
Why do we need this change?
## Explanation `RampsController.hydrateVbaOnboarding` currently treats either the relay-side `kycStatus` or the provider-side `finalStatus` as final KYC approval. MoonPay/Iron clarified that relay approval only represents document processing; it does not confirm that the provider has accepted the customer. This change makes `finalStatus === 'approved'` the only approval gate. A session with `kycStatus: 'approved'` and `finalStatus: 'pending'` now stays pending and does not begin customer or autoramp setup. This intentionally supersedes the behavior introduced in MetaMask#10497. **Demo with mobile changes applied:** https://github.com/user-attachments/assets/8f8fcf94-c5af-45d6-bedb-0636af3ac455 ## References - [TRAM-4392](https://consensyssoftware.atlassian.net/browse/TRAM-4392) - Mobile consumer: [MetaMask/metamask-mobile#38688](MetaMask/metamask-mobile#38688) - Related: MetaMask#10497 ## Verification - `yarn workspace @metamask/ramps-controller test --run` (1,128 tests) - `yarn workspace @metamask/ramps-controller build` - `yarn lint:oxlint packages/ramps-controller/src/RampsController.ts packages/ramps-controller/src/RampsController.test.ts` - `yarn lint:misc --check packages/ramps-controller/src/RampsController.ts packages/ramps-controller/src/RampsController.test.ts` ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them [TRAM-4392]: https://consensyssoftware.atlassian.net/browse/TRAM-4392?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes when VBA onboarding reports KYC approved and unlocks wallet/autoramp steps, which affects money-account UX and reverses prior relay-first behavior. > > **Overview** > **VBA onboarding now treats only provider `finalStatus: 'approved'` as KYC approved**, reversing the behavior from MetaMask#10497 where relay `kycStatus: 'approved'` could advance users while the vendor was still pending. > > `resolveVbaKycStatus` no longer ORs in relay approval; relay-approved sessions with a pending `finalStatus` stay **`kycStatus: 'pending'`**, so `hydrateVbaOnboarding` returns early and does not surface `needs_wallet_registration` or other post-approval autoramp states. When the provider has approved but relay `kycStatus` still lags, **`finalStatus` still wins** and onboarding can proceed. > > Tests and the changelog document the relay/vendor divergence cases. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 015df72. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
## Explanation Releases: - `@metamask/ramps-controller` @ `29.0.0` - `@metamask/transaction-pay-controller` @ `30.3.3` This release includes the VBA KYC final-status fix from MetaMask#11243 and customer rail abilities from MetaMask#11225. The major bump reflects the new required `NeoBankService:getCustomerAbilities` messenger action. ## References - MetaMask#11243 - MetaMask#11225 - Consumer update: MetaMask/metamask-mobile#38688 ## Checklist - [x] I’ve updated the test suite for new or updated code as appropriate - [x] I’ve updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I’ve communicated my changes to consumers by updating changelogs for packages I’ve changed - [x] I’ve introduced breaking changes in this PR and have prepared a draft pull request for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > The diff is low-risk versioning, but it publishes ramps-controller 29.0.0 with a breaking messenger delegation requirement that downstream clients must adopt before upgrading. > > **Overview** > This PR **cuts release 1381.0.0** by bumping versions and lockfile entries only—no application source changes in the diff. > > **`@metamask/ramps-controller`** goes **28.1.0 → 29.0.0** (major). The changelog section for **29.0.0** is finalized from `[Unreleased]`, documenting what ships with this tag: customer rail abilities APIs/state, deposit-rail readiness helpers, a **breaking** requirement to delegate **`NeoBankService:getCustomerAbilities`**, plus VBA KYC **`finalStatus`** and microdeposits session-profile fixes from earlier PRs. > > **`@metamask/transaction-pay-controller`** is patched to **30.3.3** with **`@metamask/ramps-controller` ^29.0.0** and a matching changelog entry. Root **`package.json`** moves to **1381.0.0**; **`yarn.lock`** reflects the ramps-controller resolution bump. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1272c95. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>




Description
MoonPay relay approval means document processing completed, but the provider can still be reviewing the customer. Mobile previously treated relay-side
kycStatus: approvedas terminal even when provider-sidefinalStatusremained pending,finalStatusbecomes terminal.Note
@metamask/ramps-controllerto29.0.0and@metamask/transaction-pay-controllerto30.3.3to consume the Core fix and maintain compatible dependencies.Changelog
CHANGELOG entry: Fixed Money Account identity verification advancing before provider approval
Related issues
Refs: https://consensyssoftware.atlassian.net/browse/TRAM-4392
Manual testing steps
Screenshots/Recordings
Before
N/A
After
Screen.Recording.iPhone.17.Pro.11-02-2026.at.5.23.11.PM.mp4
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Made with Cursor
Note
Medium Risk
Changes Money Account KYC gating and onboarding routing, which are compliance-sensitive, though behavior is narrowed to wait for provider finalization with broad test coverage.
Reviewed by Cursor Bugbot for commit 02c055c. Bugbot is set up for automated code reviews on this repo. Configure here.