-
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: Fix create metric fragment #28970
Merged
Merged
+2
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gudahtt
force-pushed
the
fix-metric-event-fragments
branch
2 times, most recently
from
December 5, 2024 18:27
f8ff8f7
to
5348367
Compare
Gudahtt
changed the title
fix: Fix create/update metric fragment
fix: Fix createmetric fragment
Dec 5, 2024
Gudahtt
changed the title
fix: Fix createmetric fragment
fix: Fix create metric fragment
Dec 5, 2024
Gudahtt
force-pushed
the
fix-metric-event-fragments
branch
from
December 5, 2024 18:47
5348367
to
4f47a46
Compare
Builds ready [4f47a46]
Page Load Metrics (2036 ± 80 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Gudahtt
force-pushed
the
fix-metric-event-fragments
branch
3 times, most recently
from
December 5, 2024 23:04
52a61d4
to
91db2d4
Compare
The function `createEventFragment` of the `MetaMetricsController` was broken recently in the migration to BaseControllerV2 (#28113). We ended up trying to mutate a piece of Immer state, resulting in an error. The affected line was updated to use an empty base object as the merge target, so that we're no longer attempting to mutate a frozen object. Fixes ##28599
Gudahtt
force-pushed
the
fix-metric-event-fragments
branch
from
December 5, 2024 23:08
91db2d4
to
612e9c5
Compare
danjm
approved these changes
Dec 5, 2024
Builds ready [612e9c5]
Page Load Metrics (2060 ± 113 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
desi
approved these changes
Dec 6, 2024
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.
LGTM
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Dec 6, 2024
metamaskbot
added
the
release-12.10.0
Issue or pull request that will be included in release 12.10.0
label
Dec 6, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
release-12.10.0
Issue or pull request that will be included in release 12.10.0
team-extension-platform
team-wallet-framework
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The function
createEventFragment
of theMetaMetricsController
was broken recently in the migration to BaseControllerV2 (#28113). We ended up trying to mutate a piece of Immer state, resulting in an error.The affected line was updated to use
cloneDeep
prior to mutating, so that we're no longer attempting to mutate a frozen object.Related issues
Fixes #28599
Manual testing steps
I'm not sure exactly how to reproduce the error using a real build. But the problem is easy to demonstrate in the "should update existing fragment state with new fragment props" unit test. The problem is that we didn't catch this before because Lodash doesn't have strict mode enabled, so in unit tests the attempt to mutate a frozen object will silently fail. In a production build, strict mode is enabled by LavaMoat.
You can reproduce the problem by adding
"use strict"
to the top of the filenode_modules/lodash/lodash.js
and running the test with the{},
removed. Then you can test that adding back{}
as the initial parameter fixes the problem.Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist