fix: buy flow quote loading and provider selection#28373
Merged
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
- Use effective asset id (route param or selectedToken) for displayProviders - Aligns listed providers with getQuotes providerIds when route omits assetId - Add regression test and update snapshot Made-with: Cursor
Ensure supportedCryptoCurrencies always includes defaultTestAssetId boolean entries so jest mock matches inferred controller return type. Made-with: Cursor
- Set React Query staleTime to 15s (RAMPS_QUOTES_STALE_TIME_MS), aligned with RampsController DEFAULT_QUOTES_TTL - Stop passing forceRefresh on BuildQuote, provider, and payment quote fetches so controller + RQ can reuse responses within the window - Update modal and quotes query tests Made-with: Cursor
Compute executeRequest cache keys like RampsController and compare the entry timestamp before vs after the sync prelude, instead of diffing the entire state.requests map (which mislabeled getQuotes when other fetches updated unrelated keys). Made-with: Cursor
2a3088c to
3a11f9b
Compare
This reverts commit 3a11f9b.
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - draft PR All E2E tests pre-selected. |
Contributor
|
✅ E2E Fixture Validation — Schema is up to date |
|
imyugioh
approved these changes
Apr 4, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Description
Quotes felt slow to load on Buy (Continue / amount screen loading, modals sluggish) partly because every quote path passed
forceRefresh: trueand React Query usedstaleTime: 0, sogetQuotesalmost always bypassed the ramps controller cache (15s TTL) even when token, amount, provider, and payment method were unchanged.This PR sets
RAMPS_QUOTES_STALE_TIME_MS(15s) on the quotes query—aligned withRampsControllerDEFAULT_QUOTES_TTL—and stops passingforceRefreshfrom Build Quote, provider selection, and payment selection so controller + React Query can reuse responses within that window.Provider list correctness: The provider selection modal filtered the visible list using only the route
assetId. When that param was absent butselectedTokenwas set, the UI could still show every provider whilegetQuotesused the token fromselectedToken, inflating quote work and mismatching the list vs quotes.This change uses the same effective asset id as quote fetching (
paramAssetId ?? selectedToken?.assetId) to derivedisplayProvidersfromsupportedCryptoCurrencies, so only providers that support the current asset appear and are included in quote params.Changelog
CHANGELOG entry: Fixed buy flow provider selection so only providers that support the selected asset are shown; improved quote responsiveness by aligning React Query cache with the ramps quotes TTL (15s) and avoiding unnecessary
forceRefreshon each fetch.Related issues
Fixes: TRAM-3425
Manual testing steps
Screenshots/Recordings
Simulator - Money Movement Sim - 3 April 2026 - Watch Video
Pre-merge author checklist
Pre-merge reviewer checklist