Skip to content

fix: unblock neobank-demo CI and resolve Cursor findings for #9853 - #9861

Merged
amitabh94 merged 10 commits into
neobank-demofrom
fix/neobank-demo-ci-9853
Aug 13, 2026
Merged

fix: unblock neobank-demo CI and resolve Cursor findings for #9853#9861
amitabh94 merged 10 commits into
neobank-demofrom
fix/neobank-demo-ci-9853

Conversation

@amitabh94

Copy link
Copy Markdown
Contributor

Summary

Fixes the three real CI failures on #9853 and resolves the outstanding Cursor/Bugbot findings.

CI failures fixed

Failing check Root cause Fix
Build (24.x) TS2345/TS2739 in RampsController.addAutoramp — the inline union check did not narrow AutorampAccount Extracted an isFullAutorampAccount type guard
Lint (messenger-action-types:check) TransactionPayController-method-action-types.ts was stale after a JSDoc update to vaultIronPayout Regenerated via messenger-action-types:generate
Test (18/20/22.x) (@metamask/ramps-controller) Coverage below thresholds (statements 96.94%, branches 93.50%, functions 97.04%, lines 96.96%) Added tests; now 100% statements/functions/lines and 98.41% branches

Cursor/Bugbot findings

  • Unsafe timer unref call (high) — #ensureUserStatusPolling called .unref() directly, which throws in React Native/browser where timers are numbers. Now unref?.().
  • Unguarded status write after reset (medium) — the session_not_in_valid_state path called #applyUserStatus with no generation check, so a reset() mid-flight could force userStatus: completed and publish statusChanged on an idle controller. Added the generation guard.
  • Wrong vendor on customer identity (medium) — moonpayCustomerId survived a switch to another vendor, so getCustomerIdentity could report a MoonPay id under iron. It is now cleared in initialize (non-MoonPay vendor) and createIronCustomer.
  • Empty remote fields wipe local (medium) — the ?? merge introduced for lint let an empty-string remote customerId/walletAddress overwrite valid local values. Restored explicit non-empty checks in applyAutorampRemoteStatus and mapNeoBankAutorampToRemoteSnapshot.

Notes

  • The three defensive guards marked /* istanbul ignore next */ in controller-integration.ts are unreachable through the public surface (every caller filters on isSyncableAutoramp or a non-empty storage key). The unused default parameter on the private saveAutorampsToUserStorage was dropped instead.

Test plan

  • yarn workspace @metamask/ramps-controller run test — pass, thresholds met
  • yarn workspace @metamask/kyc-controller run test — pass, 100% coverage
  • yarn workspace @metamask/transaction-pay-controller run test — pass
  • yarn build — pass
  • yarn lint:tsc — pass
  • yarn messenger-action-types:check — pass
  • eslint + oxfmt --check on all changed files — pass
  • changelog:validate for the three packages — pass

Made with Cursor

@amitabh94
amitabh94 requested review from a team as code owners August 13, 2026 09:10
@amitabh94
amitabh94 requested a review from a team as a code owner August 13, 2026 09:14
@amitabh94
amitabh94 merged commit c34a16a into neobank-demo Aug 13, 2026
54 checks passed
@amitabh94
amitabh94 deleted the fix/neobank-demo-ci-9853 branch August 13, 2026 09:48
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