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: gasFeeEstimates property undefined #29312

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Dec 18, 2024

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.

Open in GitHub Codespaces

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

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.

@vinistevam vinistevam added the team-confirmations Push issues to confirmations team label Dec 18, 2024
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.

@metamaskbot
Copy link
Collaborator

Builds ready [0c8d002]
Page Load Metrics (1712 ± 172 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30831341575553265
domContentLoaded141430691677347167
load142331401712358172
domInteractive25104472713
backgroundConnect7105392813
firstReactRender1698423014
getState487172010
initialActions01000
loadScripts98522151245260125
setupStore684232412
uiStartup159937152071464223
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 13 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [2e0d45d]
Page Load Metrics (1661 ± 35 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1514186516607838
domContentLoaded1493179516327536
load1505180216617335
domInteractive157835167
backgroundConnect96123157
firstReactRender1698463215
getState468222412
initialActions0774178
loadScripts1084137312027134
setupStore65612136
uiStartup170423922012245118
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 13 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@vinistevam vinistevam marked this pull request as ready for review December 18, 2024 13:44
@vinistevam vinistevam requested a review from a team as a code owner December 18, 2024 13:44
if (!gasFeeEstimates) {
return;
}

if (!gasFeeEstimates[gasFeeEstimateToUse]) {
Copy link
Member

Choose a reason for hiding this comment

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

Could we achieve the same with optional chaining here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, pushed here.

@metamaskbot
Copy link
Collaborator

Builds ready [18f8b8e]
Page Load Metrics (1664 ± 66 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14581989166313866
domContentLoaded14451935163213866
load14641986166413766
domInteractive2493462210
backgroundConnect106426167
firstReactRender16100443215
getState56314147
initialActions01000
loadScripts10591483122811455
setupStore68016199
uiStartup166423561972226109
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 9 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@vinistevam vinistevam dismissed matthewwalsh0’s stale review December 20, 2024 11:12

Applied changes suggested

@vinistevam vinistevam added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 3fd27a9 Dec 20, 2024
80 checks passed
@vinistevam vinistevam deleted the fix/sentry-gas-fee-estimates-undefined branch December 20, 2024 11:47
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2024
@metamaskbot metamaskbot added the release-12.11.0 Issue or pull request that will be included in release 12.11.0 label Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.11.0 Issue or pull request that will be included in release 12.11.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Sentry] TypeError: Cannot read properties of undefined (reading 'medium')
6 participants