-
Notifications
You must be signed in to change notification settings - Fork 5k
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 old properties from state #29792
base: main
Are you sure you want to change the base?
Conversation
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. |
delete state.NetworkController.networkConfigurations; | ||
// Removed in 800a9d3a177446ff2d05e3e95ec06b3658474207 with a migration, but | ||
// still persists for some people for some reason | ||
delete state.NetworkController.providerConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this error in Sentry: https://metamask.sentry.io/issues/6011869130/events/039861ddb07f4b39b947edba3bbd710e/. I am not sure why it is occurring. We already have a migration that removes this property. So do we need this here? Kind of strange that some people still have this property.
delete state.PreferencesController.infuraBlocked; | ||
// Removed in 4f66dc948fee54b8491227414342ab0d373475f1 with a migration, but | ||
// still persists for some people for some reason | ||
delete state.PreferencesController.useCollectibleDetection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this error in Sentry here: https://metamask.sentry.io/issues/6042074159/events/5711f95785d741739e5d0fa5ad19e7c0/. Again we already have a migration that should be removing this property, so I'm not sure if this is needed?
Builds ready [f964268]
Page Load Metrics (1736 ± 65 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There are several kinds of errors in Sentry which indicate that there are properties in controller state we are attempting to persist that do not have corresponding metadata. This indicates that these properties were removed at some point from the controller's state but no migration was added that removed them from the persisted wallet state. In many cases, at the time of removal, such a migration was not needed because the controller in question inherited from BaseController v1. However, we have made a targeted effort over the past few years to migrate all controllers to BaseController v2, and so it matters now that every property have corresponding metadata or else are removed from state. We don't want these errors to show up in Sentry because they create noise, so this commit removes these properties from state.
f964268
to
e69d847
Compare
Builds ready [e69d847]
Page Load Metrics (1768 ± 76 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [f28fa49]
Page Load Metrics (1930 ± 229 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
There are several kinds of errors in Sentry which indicate that there are properties in controller state we are attempting to persist that do not have corresponding metadata. This indicates that these properties were removed at some point from the controller's state but no migration was added that removed them from the persisted wallet state. In many cases, at the time of removal, such a migration was not needed because the controller in question inherited from BaseController v1. We have made a targeted effort over the past few years to migrate all controllers to BaseController v2, however, and so it matters now that every property have corresponding metadata or else are removed from state. We don't want these errors to show up in Sentry because they create noise, so this commit removes these properties from state.
Related issues
Fixes #28289.
Fixes #28290.
Fixes #28300.
Fixes #28302.
Fixes #28344.
Fixes #28608.
Fixes #29746.
Manual testing steps
These changes should not affect users in any way since the errors we are trying to avoid occur out of band and should not crash anything.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist