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

[Bug]: Contract Interaction and Alerts - MetaMask breaks with Cannot read properties of undefined (reading 'key') #27238

Closed
seaona opened this issue Sep 18, 2024 · 0 comments
Assignees
Labels
regression-RC-12.3.0 Regression bug that was found in release candidate (RC) for release 12.3.0 release-12.3.0 Issue or pull request that will be included in release 12.3.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-confirmations Push issues to confirmations team type-bug

Comments

@seaona
Copy link
Contributor

seaona commented Sep 18, 2024

Describe the bug

MetaMask broke with the error Cannot read properties of undefined (reading 'key') when I clicked on Alert, navigated over 2 alerts and then clicked Got it

Expected behavior

No response

Screenshots/Recordings

Screenshot from 2024-09-18 08-10-34

Steps to reproduce

It's not deterministic, so there must be a race condition somewhere. Here is what I did:

  1. Deploy an ERC721 contract from the test dapp
  2. Trigger a transaction with a nonce +1, so it's not confirmed
  3. Now trigger a Mint
  4. Click on the alerts (there are 2)
  5. Navigate to the 2nd alert
  6. Click got it --> MM broke

Error messages or log output

No response

Detection stage

During release testing

Version

12.3.0

Build type

None

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

Severity

No response

@seaona seaona added type-bug Sev2-normal Normal severity; minor loss of service or inconvenience. team-confirmations Push issues to confirmations team release-12.3.0 Issue or pull request that will be included in release 12.3.0 labels Sep 18, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Sep 18, 2024
@metamaskbot metamaskbot added the regression-RC-12.3.0 Regression bug that was found in release candidate (RC) for release 12.3.0 label Sep 18, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Sep 19, 2024
@vinistevam vinistevam self-assigned this Sep 20, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 8, 2024
<!--
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**
This PR aims to fix the banner alert to support rendering multiple
alerts. Previously we only rendered one alert and if there were more
alerts we rendered the banner with a default copy informing the user
there are multiple alerts.

- Fixed padding on the alerts modal based on
[figma](https://www.figma.com/design/gcwF9smHsgvFWQK83lT5UU/Confirmation-redesign-V4?node-id=3355-12480&node-type=frame&t=3Vbe0qFcmcfN5uCG-0)
- Fixed bug Contract Interaction and Alerts - 'Cannot read properties of
undefined (reading 'key')`
<!--
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?
-->

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

## **Related issues**

Fixes: MetaMask/MetaMask-planning#2873
#27238

## **Manual testing steps**

1. Create a transaction with high nonce
2. Go to test dapp
3. Trigger a malicious transaction from PPOM session

## **Screenshots/Recordings**

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

### **Before**

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

### **After**

![Screenshot from 2024-09-23
13-38-10](https://github.com/user-attachments/assets/f4cbe8ee-7217-4718-998a-2016c9c60b88)

![Screenshot from 2024-09-23
14-09-42](https://github.com/user-attachments/assets/abb8c0c0-8cb8-4230-9469-d0b8b9f2a9a1)

![Screenshot from 2024-09-23
14-21-53](https://github.com/user-attachments/assets/0747e0d0-d50f-4f59-9a9e-0baefb4d9b5e)


[bug.webm](https://github.com/user-attachments/assets/eb447959-78f0-4ccc-a554-cca272e59b19)


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

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

- [ ] 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.

---------

Co-authored-by: Ariella Vu <[email protected]>
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Oct 8, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-RC-12.3.0 Regression bug that was found in release candidate (RC) for release 12.3.0 release-12.3.0 Issue or pull request that will be included in release 12.3.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-confirmations Push issues to confirmations team type-bug
Projects
Archived in project
Development

No branches or pull requests

3 participants