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]: Gas - TypeError: Cannot set properties of undefined (setting 'gasFeeEstimates') #27241

Closed
seaona opened this issue Sep 18, 2024 · 4 comments
Assignees
Labels
regression-RC-12.3.0 Regression bug that was found in release candidate (RC) for 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

Background error TypeError: Cannot set properties of undefined (setting 'gasFeeEstimates'). I haven't seen any UI impact, but cannot reproduce again, to be able to add more details

Expected behavior

No response

Screenshots/Recordings

Screenshot from 2024-09-18 10-59-46

Steps to reproduce

To determine.

I was using 2 networks for 2 different dapps (Sepolia and Linea Sepolia) and switching back and forth triggering txs.

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

@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
@gauthierpetetin gauthierpetetin added team-confirmations Push issues to confirmations team Sev2-normal Normal severity; minor loss of service or inconvenience. labels Sep 19, 2024
@cryptotavares
Copy link
Contributor

@seaona if you cannot reproduce should we close it?

@seaona
Copy link
Contributor Author

seaona commented Oct 3, 2024

I've just encountered it again in 12.3.0 and I've seen that there are more than 90k entries for this error in Sentry. So I think that investigating repro steps and trying to address it would definitely help reducing Sentry errors.

Screenshot from 2024-10-03 11-42-05

We could open the Sentry issue too if that's more helpful to link data, and get more debugging info. What do you think?

Screenshot from 2024-10-03 11-40-02

@seaona
Copy link
Contributor Author

seaona commented Nov 4, 2024

Found some repro steps cc @cryptotavares :

Repro:

  1. Setup proxy (ie Burpsuite)
  2. Intercept the gas.api.cx.metamask.io requests
  3. Start a Send flow
  4. Leave all the gas API requests unresolved
  5. Go to the last confirmation screen
  6. Wait a couple of seconds
  7. Open the Edit gas
  8. See how gas is trying to refresh
  9. Confirm tx
  10. See background error
gasEstimates-undefined.mp4

@vinistevam
Copy link
Contributor

The issue will be fixed by PR.

github-merge-queue bot pushed a commit that referenced this issue Dec 20, 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 fixes an issue created by Sentry where the property
`gasFeeEstimates` is `undefined`.
Added an early return when the property is `undefined` and covered the
scenario with unit tests.
<!--
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/29312?quickstart=1)

## **Related issues**

Fixes: #27501
#27241

## **Manual testing steps**

1. Go to this test dapp
2. Block requests against gas-api
3. Start a send or contract interaction 
4. Verify the console

## **Screenshots/Recordings**


[block-gas-api.webm](https://github.com/user-attachments/assets/1c3cf638-905e-4df9-b875-84f0056979b1)


<!-- 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
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/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
- [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/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.
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Dec 20, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Dec 20, 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 Sev2-normal Normal severity; minor loss of service or inconvenience. team-confirmations Push issues to confirmations team type-bug
Projects
Archived in project
Status: Fixed
Development

No branches or pull requests

5 participants