Repository navigation
Fix provider auto-selection when initial provider has no quote (TRAM-4119) - #11601
Closed
matteyusys wants to merge 2 commits into
Closed
matteyusys wants to merge 2 commits into
matteyusys wants to merge 2 commits into
Conversation
…4119) When an auto-selected provider (e.g., Banxa) times out or returns no quote, the controller now automatically switches to the best available quote's provider while keeping the selection marked as auto-selected. Manual provider selections are never overridden to preserve user intent. - Add #reselectProviderIfAutoSelectedHasNoQuote method to detect and handle auto-selected providers with no usable quote - Add #pickBestQuoteForReselection to select the best provider based on reliability/price sort order - Comprehensive test coverage for error, timeout, empty-quote, and manual selection cases Co-authored-by: Matt I. <[email protected]>
Contributor
🛑 Files requiring codeowner reviewTo merge this PR, you'll need to get approvals from the following owners. @MetaMask/money-movement (3 files)
@MetaMask/core-platform (expand for more) |
Remove verbose documentation and explanatory comments from the reselection methods, keeping only essential information consistent with the surrounding code style. Co-authored-by: Matt I. <[email protected]>
4 of 10 tasks
Contributor
Author
|
Moved to #11673 (branch |
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
The extension's quote flow would auto-select a provider (e.g., Banxa) based on order history or availability, but if that provider timed out or returned no quote, the selection remained stuck on that provider even when other providers (like Coinbase and MoonPay) successfully returned quotes. This caused the Continue button to be disabled because the selected provider had no usable quote.
This PR fixes the issue by automatically switching to the best available quote's provider when the originally auto-selected provider fails to return a quote. The fix:
QuotesResponse(error, timeout, or not insuccessarray)The reselection logic is called at the end of
getQuotesbefore returning, ensuring any consumer of the method benefits from the fix without needing changes.References
Checklist