fix: cp-7.69.0 default to first convertible token regardless of selected network in deeplink flow#27202
Conversation
|
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. |
7e97ba6 to
f545c05
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
6dfbbea to
b179cd4
Compare
|
✅ E2E Fixture Validation — Schema is up to date |
…k in deeplink flow
b179cd4 to
5a5c5da
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These are isolated to a specific Earn educational/conversion view and related hook logic. There are:
While Earn is accessible from the Trade wallet actions menu, SmokeTrade primarily validates swaps, bridges, staking, analytics, and transaction flows—not internal educational subviews. There is no indication that this PR modifies entry points, transaction flows, or shared components used by other E2E scenarios. Given the scope (component + hook + unit tests only), the risk to existing Detox E2E flows is low and does not justify running any specific E2E tag suite. Performance Test Selection: |
|



Description
When a user opens the mUSD conversion education screen via deeplink, the component calls getPaymentTokenForSelectedNetwork() to determine which token to convert. If the user hasn't selected a specific network (e.g., using the "Popular networks" filter), this function can return null — causing the flow to skip conversion entirely and fall through to the buy or navigate-home paths, even though the user has convertible tokens.
This fix adds a fallback: when getPaymentTokenForSelectedNetwork() returns null but conversionTokens is non-empty (guarded by the hasConvertibleTokens check), the component defaults to the first available conversion token. This ensures deeplink users are always routed to the conversion flow when they have eligible tokens.
Changelog
CHANGELOG entry: n/a
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MUSD-496
Manual testing steps
Screenshots/Recordings
Before
https://consensys.slack.com/files/U06EZC2Q81X/F0AKSVBC51P/screenrecording_03-09-2026_10-22-25_1.mp4
After
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-03-09.at.09.57.01.mp4
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes deeplink routing to auto-select a fallback conversion token and alters conversion-token ordering, which can affect which asset is preselected/converted for users in edge cases. Scope is limited to mUSD conversion entry flow and covered by added tests, but impacts user-facing navigation/selection logic.
Overview
mUSD deeplink conversion now falls back to a wallet token instead of skipping conversion. When
getPaymentTokenForSelectedNetwork()returnsnull, the education deeplink flow uses the firstconversionTokensentry (validated/normalized viasafeFormatChainIdToHex+toChecksumAddress) to proceed withconvertrather than falling through to buy or home.Conversion token ordering is updated.
useMusdConversionTokensnow sorts eligible conversion tokens by descending fiat balance so the fallback token is deterministically the highest-value option.Tests updated/added to cover the fallback conversion behavior and the buy/home fall-through when the fallback token is invalid (e.g., missing
chainId), plus token sorting by fiat balance.Written by Cursor Bugbot for commit 5a5c5da. This will update automatically on new commits. Configure here.