fix(ramps-controller): compare internal order ids during order processing#9157
Closed
amitabh94 wants to merge 1 commit into
Closed
fix(ramps-controller): compare internal order ids during order processing#9157amitabh94 wants to merge 1 commit into
amitabh94 wants to merge 1 commit into
Conversation
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
Author
|
Superseded by upstream branch PR #9159 (enables preview builds and CI). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes duplicate fiat-on-ramp Activity rows (TRAM-3539) when redirect providers (Moonpay, PayPal, Coinbase, etc.) return a provider-native id in
providerOrderIdwhile the precreated stub used MetaMask's internal order code (c-{guid}).Root cause:
RampsControllermerged orders onproviderOrderId. After precreate, stub and API/callback updates often disagree on that field even though they represent the same buy.Fix: Introduce
getInternalOrderCode()to derive the canonical code fromorder.id(/providers/{provider}/orders/{code}), then merge/heal inaddOrder,getOrder, andaddPrecreatedOrderon that key. StoredproviderOrderIdis normalized to the internal code so polling continues to usec-{guid}(supported by on-ramp-api → Moonpay/v1/transactions/ext/{code}).Changes
getInternalOrderCode()from@metamask/ramps-controllerproviderOrderIdproviderOrderId→ single merged row[Unreleased]→ FixedOut of scope
c-code)@metamask/ramps-controllerafter release + Moonpay buy QATest plan
yarn workspace @metamask/ramps-controller run jest packages/ramps-controller/src/RampsController.test.ts(285 tests)Fixes TRAM-3539