-
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
Simplify MV3 initialization #16559
Merged
Merged
Simplify MV3 initialization #16559
+131
−50
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
init-changes
branch
3 times, most recently
from
November 17, 2022 19:13
7b728f7
to
1a025ef
Compare
6 tasks
Gudahtt
commented
Nov 18, 2022
Builds ready [7d5c09a]
Page Load Metrics (2148 ± 128 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
highlights:storybook
|
Gudahtt
force-pushed
the
init-changes
branch
from
November 18, 2022 22:55
7d5c09a
to
e2b62ae
Compare
Builds ready [e2b62ae]
Page Load Metrics (2086 ± 99 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
highlights:storybook
|
The MV3 initialization logic was complicated and introduced race difficult-to-reproduce race conditions when dapps connect during initialization. It seems that problems were encountered after the UI tried to connect before the background was initialized. To address this, the initialization step was _delayed_ until after the first connection. That first connection was then passed into the initialization function, and setup properly after initialization had begun. However, this special treatment is only given for the first connection. Subsequent connections that still occur during initialization would fail. This also results in the initialization being needlessly delayed, which is concerning given that our main performance goal is to speed it up.
Gudahtt
force-pushed
the
init-changes
branch
from
November 21, 2022 14:55
e2b62ae
to
bca4d76
Compare
Gudahtt
force-pushed
the
init-changes
branch
from
November 21, 2022 14:57
1e51ecb
to
28099cf
Compare
Builds ready [28099cf]
Page Load Metrics (2216 ± 119 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
highlights:storybook
|
Builds ready [e380ffb]
Page Load Metrics (2565 ± 258 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
highlights:storybook
|
segun
approved these changes
Nov 23, 2022
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
jpuri
approved these changes
Nov 24, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Explanation
The MV3 initialization logic was complicated and introduced difficult-to-reproduce race conditions when connections are made during initialization.
It seems that problems were encountered after the UI tried to connect before the background was initialized. To address this, the initialization step was delayed until after the first connection. That first connection was then passed into the initialization function, and setup properly after initialization had completed.
However, this special treatment is only given for the first connection. Subsequent connections that still occur during initialization would fail. This also results in the initialization being needlessly delayed, which is concerning given that our main performance goal is to speed it up.
Manual Testing Steps
Standard regression testing steps should apply here.
I think this might solve race conditions relating to connections during initialization, but I have not confirmed this, nor do I have steps to reproduce such problems.
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.