Skip to content

feat(21068): remove action queue for new MV3#21410

Merged
DDDDDanica merged 1 commit intodevelopfrom
feat/21068
Oct 19, 2023
Merged

feat(21068): remove action queue for new MV3#21410
DDDDDanica merged 1 commit intodevelopfrom
feat/21068

Conversation

@DDDDDanica
Copy link
Copy Markdown
Contributor

@DDDDDanica DDDDDanica commented Oct 17, 2023

Description

For our purposes at MetaMask, one of the most significant differences between manifest v3 and v2 extension implementations was that the background process runs on a service worker that restarts every 5 minutes. However, we recently learned that Chrome dropped that requirement, which means the mv3-specific code still needs to persist in the service worker state, but the implementation can be simplified from what we have previously implemented.
To remove the action queue functionality, we can essentially un-deprecate callBackgroundMethod and simplify it as well as submitRequestToBackground.

We can also simply call background., but since these methods use callbacks, it's still useful to keep a wrapper function around the background methods that promisifies them.

Reference MR which added action queue previously:
#15337

Manual testing steps

  1. Build the extension through the manifest v3 file using yarn dist:mv3 or yarn start:mv3
  2. Load the extension and perform a few user actions such as adding a new account.
  3. Wait 5 minutes (the previous limit for service worker lifecycle.
  4. Perform a few user actions such as adding a new account
  5. The actions should be performed and the app should not crash

Screenshots/Recordings

If applicable, add screenshots and/or recordings to visualize the before and after of your change.

Before

[screenshot]

After

[screenshot]

Related issues

Implements: #21068

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@github-actions
Copy link
Copy Markdown
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.

@DDDDDanica DDDDDanica force-pushed the feat/21068 branch 7 times, most recently from 6e171fc to 7e276cb Compare October 18, 2023 12:39
@DDDDDanica DDDDDanica marked this pull request as ready for review October 18, 2023 14:28
@DDDDDanica DDDDDanica requested a review from a team as a code owner October 18, 2023 14:28
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [4afc879]
Page Load Metrics (995 ± 386 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint811541092411
domContentLoaded68144972010
load801907995804386
domInteractive68144972010
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -1.72 KiB (-0.02%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 18, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (91f6a0d) 68.54% compared to head (4afc879) 68.50%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #21410      +/-   ##
===========================================
- Coverage    68.54%   68.50%   -0.04%     
===========================================
  Files         1029     1029              
  Lines        41013    40953      -60     
  Branches     10962    10941      -21     
===========================================
- Hits         28110    28052      -58     
+ Misses       12903    12901       -2     
Files Coverage Δ
ui/store/actions.ts 43.04% <ø> (-0.12%) ⬇️
ui/store/background-connection.ts 100.00% <100.00%> (ø)
ui/store/institutional/institution-background.ts 76.56% <ø> (ø)
ui/index.js 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

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

@DDDDDanica DDDDDanica merged commit 0406b6e into develop Oct 19, 2023
@DDDDDanica DDDDDanica deleted the feat/21068 branch October 19, 2023 12:15
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2023
@metamaskbot metamaskbot added the release-11.5.0 Issue or pull request that will be included in release 11.5.0 label Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.5.0 Issue or pull request that will be included in release 11.5.0 team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants