fix(ramps): consolidate terminal order status checks behind controller export (TRAM-3703)#33393
fix(ramps): consolidate terminal order status checks behind controller export (TRAM-3703)#33393amitabh94 wants to merge 1 commit into
Conversation
…r export TRAM-3703: Export TERMINAL_ORDER_STATUSES and isTerminalOrderStatus from @metamask/ramps-controller via a yarn patch until the upstream core release lands. Replace four hand-rolled terminal-status sets in OrderContent, BankDetails, useFiatOrderStatus, and ramps analytics with the shared predicate. BankDetails now treats IdExpired as terminal, matching the other call sites. Co-authored-by: Amitabh Aggarwal <amitabh94@users.noreply.github.com>
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
🧪 Flaky unit test detectionRun history flaky detectionHistorical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow. Failures / runs sampled per window:
AI-detected flaky patterns
|
|



Summary
Consolidates four duplicated ramp terminal-order-status sets behind a single source of truth from
@metamask/ramps-controller.Closes TRAM-3703.
Problem
Mobile maintained independent copies of the terminal order status set in:
OrderContent.tsxBankDetails.tsx(missingIdExpired— live inconsistency)useFiatOrderStatus.tsramps-controller/event-handlers/analytics.tsEach copy had to be kept in lockstep manually and had already drifted.
Solution
TERMINAL_ORDER_STATUSESandisTerminalOrderStatus()to@metamask/ramps-controller@17.0.0via a yarn patch until the upstream MetaMask/core release lands.Setdeclarations withisTerminalOrderStatus()from the controller package.IdExpiredorders now redirect to order details like the other terminal statuses.Risk
BankDetailstreatingIdExpiredas terminal (intentional bugfix aligning with controller + other consumers).@metamask/ramps-controllerpublishes the export natively.Follow-up
packages/ramps-controllerand bump mobile off the yarn patch.Verification
yarn jest app/core/Engine/controllers/ramps-controller/event-handlers/analytics.test.ts yarn jest app/components/Views/confirmations/hooks/activity/useFiatOrderStatus.test.ts yarn jest app/components/UI/Ramp/Views/OrderDetails/OrderContent.test.tsx yarn jest app/components/UI/Ramp/Views/NativeFlow/BankDetails.test.tsx -t "ID_EXPIRED"All targeted tests pass.