Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cherry pick swaps undefined object access crash hotfix into v12.4.1 RC #27757

Merged

Conversation

jclancy93
Copy link
Contributor

@jclancy93 jclancy93 commented Oct 10, 2024

Description

Cherry picks swaps undefined object access crash hotfix intov12.4.1RC. See here for more info

Open in GitHub Codespaces

Related issues

https://consensyssoftware.atlassian.net/jira/software/projects/MMS/boards/447/backlog?assignee=5ae37c7e42b8a62c4e15d92a&selectedIssue=MMS-1569

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.

#27708)

## **Description**

Fixes the two errors with trade and decimals being undefined that have
been causing crashes starting around the 12.1/12.2 release. I was unable
to find the root cause of this issue. Variables in the redux store seem
to return as undefined, which leads me to think it might be some sort of
redux race condition. The lowest common denominator of this error seems
to be that `getUsedQuote` selector in the `ReviewQuote` component. I
have added an additional condition to the render guard in the parent
component `prepare-swaps-page` to prevent these errors


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27708?quickstart=1)

## **Related issues**


[MMS-1569](https://consensyssoftware.atlassian.net/jira/software/projects/MMS/boards/447/backlog?assignee=5ae37c7e42b8a62c4e15d92a&selectedIssue=MMS-1569)

## **Manual testing steps**

1. Open Swaps Page
2. Enter swap amount
3. Edit to token and amount rapidly multiple times 
4. Page should not crash

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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
- [x] 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-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.


[MMS-1569]:
https://consensyssoftware.atlassian.net/browse/MMS-1569?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@jclancy93 jclancy93 requested review from a team as code owners October 10, 2024 11:54
Copy link
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.

@jclancy93 jclancy93 changed the base branch from develop to Version-v12.4.1 October 10, 2024 11:55
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 10, 2024
Copy link

sonarcloud bot commented Oct 10, 2024

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@jclancy93 jclancy93 merged commit 3ebc8a7 into Version-v12.4.1 Oct 10, 2024
17 checks passed
@jclancy93 jclancy93 deleted the jc/swaps-undefined-object-access-crash-hotfix branch October 10, 2024 13:06
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants