Skip to content

Fix provider auto-selection when initial provider has no quote (TRAM-4119) - #11673

Draft
matteyusys wants to merge 2 commits into
mainfrom
fix/tram-4119
Draft

matteyusys wants to merge 2 commits into
mainfrom
fix/tram-4119

Conversation

@matteyusys

Copy link
Copy Markdown
Contributor

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:

  • Detects when an auto-selected provider has no quote in the returned QuotesResponse (error, timeout, or not in success array)
  • Selects the best alternative provider based on reliability ranking (fallback to price, then first available)
  • Keeps the selection marked as auto-selected for consistent UX
  • Never overrides manual provider selections to preserve user intent

The reselection logic is called at the end of getQuotes before returning, ensuring any consumer of the method benefits from the fix without needing changes.

References

  • Fixes TRAM-4119

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
Open in Web Open in Cursor 

Moved from #11601 (branch renamed from cursor/fix-banxa-autoselect-no-quote-cf59); earlier review history is there.

cursoragent and others added 2 commits November 17, 2026 23:11
…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]>
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]>

This branch has not been deployed

No deployments
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.

2 participants