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: Remove invalid providerConfig id #26310

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Aug 2, 2024

Description

Remove invalid providerConfig.id state. This was one possible explanation for some Sentry errors that we have been encountering in production. The diagnostic state attached to the error was not sufficient to confirm that this was the cause.

Open in GitHub Codespaces

Related issues

Relates to #26309 and #26320

Manual testing steps

N/A

Screenshots/Recordings

N/A

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.

Base automatically changed from remove-obsolete-network-controller-state to develop August 2, 2024 13:15
@Gudahtt Gudahtt force-pushed the remove-invalid-provider-config-id branch from cc38f47 to 9dfec33 Compare August 2, 2024 13:18
@Gudahtt Gudahtt changed the title Remove invalid providerConfig ids fix: Remove invalid providerConfig ids Aug 2, 2024
@Gudahtt Gudahtt changed the title fix: Remove invalid providerConfig ids fix: Remove invalid providerConfig id Aug 2, 2024
it('does nothing if obsolete properties are not set and providerConfig is set to undefined', async () => {
const oldState = {
NetworkController: {
// This should be impossible because `undefined` cannot be returned from persisted state,
Copy link
Member Author

Choose a reason for hiding this comment

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

I discovered this when investigating this test failure: https://github.com/MetaMask/metamask-extension/actions/runs/10216054639/job/28266703200

@@ -40,7 +41,7 @@ function removeObsoleteSnapControllerState(
if (!hasProperty(state, 'SnapController')) {
return;
} else if (!isObject(state.SnapController)) {
global.sentry.captureException(
global.sentry?.captureException?.(
Copy link
Member Author

Choose a reason for hiding this comment

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

Updating these to follow the convention in other migrations of not assuming this global is set. It should always be set in production, but one of the migrator tests doesn't set it and can blow up here.

Discovered while investigating this test failure:
https://github.com/MetaMask/metamask-extension/actions/runs/10216054639/job/28266703200

@Gudahtt Gudahtt marked this pull request as ready for review August 2, 2024 13:35
@Gudahtt Gudahtt requested a review from a team as a code owner August 2, 2024 13:35
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.05%. Comparing base (5b56034) to head (90c5763).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26310      +/-   ##
===========================================
+ Coverage    70.04%   70.05%   +0.01%     
===========================================
  Files         1411     1411              
  Lines        50031    50050      +19     
  Branches     13812    13822      +10     
===========================================
+ Hits         35042    35061      +19     
  Misses       14989    14989              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gudahtt Gudahtt added team-extension-platform needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Aug 2, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [27d6dcc]
Page Load Metrics (284 ± 270 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint612551294723
domContentLoaded10164424421
load482066284562270
domInteractive10164424421
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.15 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Gudahtt added 3 commits August 2, 2024 12:16
Remove invalid `providerConfig.id` state. This was one possible
explanation for some Sentry errors that we have been encountering in
production. The diagnostic state attached to the error was not
sufficient to confirm that this was the cause.

Relates to #26309
@Gudahtt Gudahtt force-pushed the remove-invalid-provider-config-id branch from 27d6dcc to 90c5763 Compare August 2, 2024 14:46
Copy link

sonarqubecloud bot commented Aug 2, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [90c5763]
Page Load Metrics (230 ± 234 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint673451257134
domContentLoaded106727136
load401788230488234
domInteractive106727136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.15 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@Gudahtt Gudahtt merged commit b1ecc6c into develop Aug 2, 2024
78 checks passed
@Gudahtt Gudahtt deleted the remove-invalid-provider-config-id branch August 2, 2024 17:26
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Aug 2, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Aug 2, 2024
@gauthierpetetin gauthierpetetin added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.4.0 Issue or pull request that will be included in release 12.4.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-extension-platform team-wallet-framework
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants