Skip to content

Follow navigation-only deep links without waiting for wallets - #6152

Open
j0ntz wants to merge 3 commits into
developfrom
jon/ramps-deeplink-redirect-time
Open

Follow navigation-only deep links without waiting for wallets#6152
j0ntz wants to merge 3 commits into
developfrom
jon/ramps-deeplink-redirect-time

Conversation

@j0ntz

@j0ntz j0ntz commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

Asana: https://app.asana.com/0/1215088146871429/1217441639677994

A deep link that only needs to open a scene did not follow until every wallet on the account had finished loading. DeepLinkingManager held a single gate for every link type:

const canHandleLink =
  (account !== defaultAccount && accountReferralLoaded && allWalletsLoaded &&
   settingsLoaded === true) || pendingLink?.type === 'passwordRecovery'

allWalletsLoaded waits for every id in activeWalletIds to appear in currencyWallets or currencyWalletErrors. It was gating links such as the ramps buy/sell entry (#6141), whose handler is nothing but navigation.navigate('buyTab', { screen: 'pluginListBuy', params }).

Each link type now declares the lightest app state it can safely run in, and the manager releases a link as soon as the app reaches that state:

Readiness Link types Why
loggedOut passwordRecovery, noop Nothing to wait for (recovery was already exempt)
account edgeLogin, fiatProvider, price-change, ramp, rampCreate, scene, swap Navigate, or hand off to an already-open scene
referral promotion, affiliate activatePromotion writes the account referral, so a default accountReferral would be persisted over the real CreationReason.json
wallets azteco, fiatPlugin, modal, other, paymentProto, paymentRedirect, plugin, requestAddress, rewards, walletConnect Search account.currencyWallets or open a wallet picker (unchanged behavior). walletConnect is here because WcConnectionsScene opens the picker as soon as it mounts with a uri

affiliate takes the stricter of referral and its inner link. plugin and fiatPlugin stay on wallets on purpose: they consult state.ui.exchangeInfo[...].disablePlugins, which comes from the info-server rollup and has no readiness flag of its own, so the wallet wait is what currently gives that fetch time to land. Narrowing those two is a separate change.

getDeepLinkReadiness lives next to handleLink and is exhaustive over the DeepLink union, so a new link type does not compile until it is classified.

The second commit is a consequence of the first. RampCreateScene builds its crypto amount placeholder by formatting the currency code, which is undefined while the persisted wallet selection loads, so the field read Amount undefined. That window used to be invisible because the scene was only reachable after the wallets loaded; a deep link now opens it earlier. It falls back to a plain Amount until the code is known.

Measured on the iOS simulator (edge-funds, cold start, edge://buy/moonpay/venmo), timestamps relative to DeepLinkingManager mount:

link dispatched wallets loaded
before 12372 ms 11337 ms
after 2909 / 3401 / 3805 / 4033 ms (4 runs) 11337 / 12943 / 12513 / 13508 ms

Screenshots are in the test-evidence comment below: at 11 s the old gate still had the app on the wallet list, and at 7 s the new one is already on Buy Crypto with the wallets still loading behind it. Driving through to the options list shows Venmo / MoonPay pinned first, so the link's providerId and paymentType still arrive when the link is dispatched that much earlier.

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@j0ntz

j0ntz commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence

before still on wallet list at 11s

before still on wallet list at 11s

buy scene at 7s wallets still loading

buy scene at 7s wallets still loading

buy scene settled after wallets loaded

buy scene settled after wallets loaded

venmo moonpay pinned first

venmo moonpay pinned first

Captured by the agent's in-app test run (build-and-test).

@j0ntz
j0ntz marked this pull request as ready for review August 13, 2026 20:35
@j0ntz
j0ntz force-pushed the jon/ramps-deeplink-redirect-time branch from 3004fa7 to ff92679 Compare August 13, 2026 20:35
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ff92679. Configure here.

Comment thread src/actions/DeepLinkingActions.tsx
Comment thread eslint.config.mjs Outdated
j0ntz added 3 commits August 13, 2026 13:44
Add explicit return types, type the catch callback as unknown, and
replace the direct react-native-vector-icons import with a themed
BellIcon.
DeepLinkingManager held one gate for every link type, and it required
every wallet in activeWalletIds to finish loading. A link that only
navigates, such as the ramps buy/sell entry, sat pending for as long
as wallet loading took.

Each link type now declares the lightest app state it can safely run
in, and the manager releases the link as soon as the app reaches it.
Link types that search currencyWallets or open a wallet picker keep
waiting for wallets, and promotion links keep waiting for the account
referral so activatePromotion cannot persist default state.
The placeholder was built by formatting the crypto currency code, which
is undefined until the persisted wallet selection resolves, so the field
read "Amount undefined". That window was invisible before, because the
scene was only reachable once the wallets had loaded; a deep link now
opens it earlier. Fall back to a plain "Amount" until the code is
known.
@j0ntz
j0ntz force-pushed the jon/ramps-deeplink-redirect-time branch from ff92679 to 70e5ddc Compare August 13, 2026 20:44
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.

1 participant