Skip to content

chore(runway): cherry-pick fix(ramps): improve external-browser callback redirection cp-7.71.0#27829

Merged
chloeYue merged 1 commit into
release/7.71.0from
runway-cherry-pick-7.71.0-1774298620
Mar 24, 2026
Merged

chore(runway): cherry-pick fix(ramps): improve external-browser callback redirection cp-7.71.0#27829
chloeYue merged 1 commit into
release/7.71.0from
runway-cherry-pick-7.71.0-1774298620

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github Bot commented Mar 23, 2026

Description

Fixes the external-browser return flow for unified ramps by moving
callback resolution out of Build Quote and into Order Details.

The bug was that external-browser returns were resolved too early in
BuildQuote. If callback parsing or order lookup failed there, users
could get bounced around or end up on a broken Order Details screen.

This change fixes that by moving callback resolution into Order Details
itself. BuildQuote now only hands off the callback context, and Order
Details fetches the real order itself. That makes the flow more
reliable: bailed callbacks return to Build Quote, and real fetch
failures show a retryable error instead of a broken redirect.

What changed

  • Build Quote -> Order Details callback handoff
    After a successful external-browser return, Build Quote now navigates to
    Order Details with the full callbackUrl, providerCode, and
    walletAddress instead of trying to resolve the order immediately.

  • Order Details callback bootstrap
    Order Details now supports loading from callback params, fetching the
    real order on first render, and updating route params once the order has
    been resolved.

  • Bailed / invalid callback handling
    If the callback resolves to a bailed order state or no usable order, the
    user is sent back to Build Quote instead of landing on a blank or broken
    Order Details screen.

  • Retryable callback error state
    If fetching the order from the callback URL fails, Order Details now
    shows a retryable error screen rather than silently resetting away. This
    makes transient backend/network failures recoverable.

  • Navigation tests updated
    Tests were updated to reflect the callback-based route shape and the new
    Order Details retry behavior.

What stays untouched
This PR does not change Order Content amount rendering, list display
formatting, or duplicate placeholder cleanup. It is scoped only to
fixing the external-browser redirection and callback-resolution path.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

Paypal Order going to build quote page first:
Uploading Screen Recording 2026-03-23 at 1.00.39 PM.mov…

After

Native Transak Redirection

Screen.Recording.2026-03-23.at.12.46.56.PM.mov

Bailed Paypal order (return to build quote page):

Screen.Recording.2026-03-23.at.12.38.45.PM.mov

Paypal order going to order details page:

Screen.Recording.2026-03-23.at.12.33.26.PM.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Note

Medium Risk
Changes the unified ramps external-browser return flow and navigation
params, which can impact users reaching the correct order state after
checkout; failures may surface as new retry/error behaviors.

Overview
Fixes unified ramps external-browser return handling by moving
callback URL resolution out of BuildQuote and into OrderDetails
.

BuildQuote no longer calls getOrderFromCallback/addOrder on
InAppBrowser success; it now resets navigation to OrderDetails with
callbackUrl, providerCode, and walletAddress. OrderDetails
bootstraps from these callback params, fetches the real order (bailing
back to BuildQuote for invalid/bailed statuses), updates route params
to the resolved orderId, and shows a retryable error state if the
callback fetch fails.

Updates rampsNavigation to support an OrderDetails route shaped
around callback params (and makes orderId optional), and adjusts/adds
tests to cover the new handoff and retry behavior.

Written by Cursor
Bugbot
for commit
0eabfd6. This will update automatically
on new commits. Configure
here.

[4efb704](https://github.com/MetaMask/metamask-mobile/commit/4efb70495c55584929c4271bb3576d35fc5a4681)

…ack redirection cp-7.71.0 (#27804)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

Fixes the external-browser return flow for unified ramps by moving
callback resolution out of Build Quote and into Order Details.

The bug was that external-browser returns were resolved too early in
BuildQuote. If callback parsing or order lookup failed there, users
could get bounced around or end up on a broken Order Details screen.

This change fixes that by moving callback resolution into Order Details
itself. BuildQuote now only hands off the callback context, and Order
Details fetches the real order itself. That makes the flow more
reliable: bailed callbacks return to Build Quote, and real fetch
failures show a retryable error instead of a broken redirect.

**What changed**

- **Build Quote -> Order Details callback handoff**  
After a successful external-browser return, Build Quote now navigates to
Order Details with the full `callbackUrl`, `providerCode`, and
`walletAddress` instead of trying to resolve the order immediately.

- **Order Details callback bootstrap**  
Order Details now supports loading from callback params, fetching the
real order on first render, and updating route params once the order has
been resolved.

- **Bailed / invalid callback handling**  
If the callback resolves to a bailed order state or no usable order, the
user is sent back to Build Quote instead of landing on a blank or broken
Order Details screen.

- **Retryable callback error state**  
If fetching the order from the callback URL fails, Order Details now
shows a retryable error screen rather than silently resetting away. This
makes transient backend/network failures recoverable.

- **Navigation tests updated**  
Tests were updated to reflect the callback-based route shape and the new
Order Details retry behavior.

**What stays untouched**  
This PR does not change Order Content amount rendering, list display
formatting, or duplicate placeholder cleanup. It is scoped only to
fixing the external-browser redirection and callback-resolution path.




## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->





### **Before**
<!-- [screenshots/recordings] -->



Paypal Order going to build quote page first:
Uploading Screen Recording 2026-03-23 at 1.00.39 PM.mov…



### **After**

<!-- [screenshots/recordings] -->



Native Transak Redirection

https://github.com/user-attachments/assets/32d1a7f9-23c7-4df1-aba8-f639338d7a6f



Bailed Paypal order (return to build quote page):

https://github.com/user-attachments/assets/8ed07fa3-e7df-4b69-b2f0-9318799c8249

Paypal order going to order details page:

https://github.com/user-attachments/assets/5a2e8489-a4b0-488d-8aca-7982df63c45c





## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes the unified ramps external-browser return flow and navigation
params, which can impact users reaching the correct order state after
checkout; failures may surface as new retry/error behaviors.
> 
> **Overview**
> Fixes unified ramps external-browser return handling by **moving
callback URL resolution out of `BuildQuote` and into `OrderDetails`**.
> 
> `BuildQuote` no longer calls `getOrderFromCallback`/`addOrder` on
InAppBrowser success; it now resets navigation to `OrderDetails` with
`callbackUrl`, `providerCode`, and `walletAddress`. `OrderDetails`
bootstraps from these callback params, fetches the real order (bailing
back to `BuildQuote` for invalid/bailed statuses), updates route params
to the resolved `orderId`, and shows a retryable error state if the
callback fetch fails.
> 
> Updates `rampsNavigation` to support an `OrderDetails` route shaped
around callback params (and makes `orderId` optional), and adjusts/adds
tests to cover the new handoff and retry behavior.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0eabfd6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github Bot requested a review from a team as a code owner March 23, 2026 20:43
@github-actions
Copy link
Copy Markdown
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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Mar 23, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk size-M labels Mar 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeRamps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are entirely contained within the Ramp feature (app/components/UI/Ramp/). The PR refactors the post-external-browser callback handling in the on-ramp flow:

  1. BuildQuote.tsx: Removed the getOrderFromCallback and addOrder calls from the external browser callback handler. Instead of fetching the order and navigating to OrderDetails with an orderId, it now passes callbackUrl, providerCode, and walletAddress directly as navigation params.

  2. OrderDetails.tsx: Now owns the callback URL fetching logic. On mount, if callbackUrl/providerCode/walletAddress params are present, it fetches the order, handles loading/error states, and supports retry. This is a meaningful behavioral change in the order details screen.

  3. rampsNavigation.ts: Extended the navigation params interface and added a new route variant for the callback-based navigation.

These changes directly affect the on-ramp purchase flow - specifically the critical path where a user returns from an external browser after completing a purchase. The SmokeRamps tag covers on-ramp and off-ramp flows including the amount input screen and navigation flows, making it the most relevant tag.

No other feature areas are impacted - no shared navigation components, no controllers, no Engine changes, no other UI components outside Ramp are touched. The changes don't affect performance-sensitive code paths (no list rendering, no heavy state management, no startup/initialization code).

Performance Test Selection:
The changes are a refactoring of where order-fetching logic lives within the Ramp flow (moved from BuildQuote to OrderDetails). There are no changes to list rendering, account/network selectors, app startup, login flows, or other performance-sensitive areas. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

Copy link
Copy Markdown
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

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

LGTM

@chloeYue chloeYue merged commit 27fa10a into release/7.71.0 Mar 24, 2026
87 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-7.71.0-1774298620 branch March 24, 2026 08:19
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants