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

Commits on Oct 10, 2024

  1. fix: trying to access an undefined object in swaps review quote compo… (

    #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 committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    72c5cc3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5cff8b5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e81fb0e View commit details
    Browse the repository at this point in the history
  4. chore: clarify changeog message

    Co-authored-by: Mark Stacey <markjstacey@gmail.com>
    jclancy93 and Gudahtt authored Oct 10, 2024
    Configuration menu
    Copy the full SHA
    3889c9b View commit details
    Browse the repository at this point in the history