Skip to content

chore(runway): cherry-pick fix: prevent uncaught error from missing crypto object on order data cp-7.72.0#28090

Merged
chloeYue merged 1 commit into
release/7.72.0from
runway-cherry-pick-7.72.0-1774872776
Mar 30, 2026
Merged

chore(runway): cherry-pick fix: prevent uncaught error from missing crypto object on order data cp-7.72.0#28090
chloeYue merged 1 commit into
release/7.72.0from
runway-cherry-pick-7.72.0-1774872776

Conversation

@runway-github

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

Copy link
Copy Markdown
Contributor

Description

Summary

This PR addresses the recurring Cannot read property "network" of undefined error encountered by some users during the offramp flow.

Context

The issue was identified via multiple user reports and there was already
a previous
fix

for a similar issue. Users reported that after being redirected back
from the provider's widget to the MetaMask app, the application crashed.
This issue is a blocker for users.

More info can be found on this Slack
thread.

Changes

Added defensive checks to ensure the network object is properly
initialized before access.

Next actions

Investigation is ongoing with providers to understand why crypto
object could be missing in some occasion on order data.

Changelog

CHANGELOG entry: prevent app crash caused by missing crypto object from
order data

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-3393
Ongoing investigation:
https://consensyssoftware.atlassian.net/browse/RAMP-451

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

After

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

Low Risk
Low risk defensive null-checking in SendTransaction plus tests; main
behavior change is the screen and send action now no-op/return null when
required crypto/network data is missing, which could hide the CTA for
malformed orders but prevents crashes.

Overview
Prevents the offramp SendTransaction screen from crashing when an
order returns without cryptoCurrency (or missing
cryptoCurrency.network).

transactionAnalyticsPayload now uses optional chaining for
provider/payment/currency fields, and handleSend early-returns if
chainId is unavailable; the view also returns null when
cryptoCurrency is missing.

Adds/updates tests to cover missing/partial order data (including
analytics assertions and ensuring addTransaction is not invoked) and
refreshes snapshots accordingly.

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


Signed-off-by: Sébastien Van Eyck sebastien.vaneyck@consensys.net 417a6fa

…rypto object on order data cp-7.72.0 (#27884)

<!--
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**

### Summary
This PR addresses the recurring `Cannot read property "network" of
undefined` error encountered by some users during the offramp flow.

### Context
The issue was identified via multiple user reports and there was already
a [previous
fix](consensys-vertical-apps/va-mmcx-onramp-api#894)
for a similar issue. Users reported that after being redirected back
from the provider's widget to the MetaMask app, the application crashed.
This issue is a blocker for users.

More info can be found on this Slack
[thread](https://consensys.slack.com/archives/C03P2H287N2/p1771581292456779).

### Changes
Added defensive checks to ensure the network object is properly
initialized before access.

### Next actions
Investigation is ongoing with providers to understand why `crypto`
object could be missing in some occasion on order data.

## **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: prevent app crash caused by missing crypto object from
order data

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-3393
Ongoing investigation:
https://consensyssoftware.atlassian.net/browse/RAMP-451

## **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] -->

### **After**

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

## **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
- [ ] 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]
> **Low Risk**
> Low risk defensive null-checking in `SendTransaction` plus tests; main
behavior change is the screen and send action now no-op/return null when
required crypto/network data is missing, which could hide the CTA for
malformed orders but prevents crashes.
> 
> **Overview**
> Prevents the offramp `SendTransaction` screen from crashing when an
order returns without `cryptoCurrency` (or missing
`cryptoCurrency.network`).
> 
> `transactionAnalyticsPayload` now uses optional chaining for
provider/payment/currency fields, and `handleSend` early-returns if
`chainId` is unavailable; the view also returns `null` when
`cryptoCurrency` is missing.
> 
> Adds/updates tests to cover missing/partial order data (including
analytics assertions and ensuring `addTransaction` is not invoked) and
refreshes snapshots accordingly.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
bdd0b0f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Signed-off-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
@runway-github runway-github Bot requested a review from a team as a code owner March 30, 2026 12:13
@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 30, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk size-S labels Mar 30, 2026

@chloeYue chloeYue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@chloeYue chloeYue added the skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run label Mar 30, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found

All E2E tests pre-selected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

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

@chloeYue chloeYue merged commit 3fd454e into release/7.72.0 Mar 30, 2026
212 of 241 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-7.72.0-1774872776 branch March 30, 2026 14:27
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk-high Extensive testing required · High bug introduction risk size-S skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run 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