Conversation
Contributor
Author
|
@metamaskbot publish-previews |
1 similar comment
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Closed
11 tasks
2d89a26 to
934834c
Compare
pkowalski
approved these changes
Mar 26, 2026
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.
Explanation
Fixes
addPrecreatedOrderto always storeprovider.idin the canonical/providers/{code}format, matching the shape returned by API responses.The previous commit (#8278) moved provider ID normalization into
RampsServiceat URL construction time and stopped normalizing inaddPrecreatedOrder. However, this caused the stub order'sprovider.idto be stored as whatever format the caller passed (e.g."paypal"instead of"/providers/paypal"). This mismatch breaks downstream equality checks —getOrdersProviders,determinePreferredProvider, anduseSortedQuotesall compareprovider.idagainst API-sourced provider lists which use the/providers/prefix.Changes:
RampsController.ts— RestorenormalizeProviderCode()call inaddPrecreatedOrderto strip any incoming prefix, then rebuild in canonical/providers/{normalizedCode}format. This ensures stub orders match the shape of API-fetched orders.RampsController.test.ts— UpdateaddPrecreatedOrdertest expectation back to/providers/paypal.CHANGELOG.md— Add Fixed entry for the id format correction.Link to mobile PR
link to: MetaMask/metamask-mobile#27893
References
TRAM-3244
Follows: MetaMask/core#8278
Checklist
Note
Low Risk
Low risk: small, localized change to how
addPrecreatedOrderformatsprovider.id, plus corresponding test and changelog updates.Overview
Ensures
RampsController.addPrecreatedOrderalways stores stub orders with a canonicalprovider.idof/providers/{code}by normalizing any incomingproviderCode(with or without the/providers/prefix).Updates the related unit test expectation and adds a changelog Fixed entry documenting the provider id normalization for precreated order stubs.
Written by Cursor Bugbot for commit 934834c. This will update automatically on new commits. Configure here.