Skip to content

feat(24224): introduce flag to disable MV3 service worker keep alive code#24326

Merged
DDDDDanica merged 1 commit intodevelopfrom
feature/24224
May 2, 2024
Merged

feat(24224): introduce flag to disable MV3 service worker keep alive code#24326
DDDDDanica merged 1 commit intodevelopfrom
feature/24224

Conversation

@DDDDDanica
Copy link
Copy Markdown
Contributor

@DDDDDanica DDDDDanica commented May 1, 2024

Description

The saveTimestamp function is called at an interval in background.js to prevent the service worker from dying. It is now put behind a feature flag via develop options settings page to provide an option to toggle and test.

Open in GitHub Codespaces

Related issues

Fixes: #24224

Manual testing steps

  1. run yarn start:mv3
  2. open service worker console from extension management page
  3. input let { timestamp } = await chrome.storage.session.get('timestamp'); and then console.log(timestamp), you should see latest timestamp result
  4. Open extension, go to settings => developer options
  5. Toggle off Service Worker Keep Alive option
  6. Reload extension, repeat between step 2 - 3
  7. you should see undefined result this time.

Screenshots/Recordings

Before

After

2024-05-01.22.53.56.mov

New UI:
截屏2024-04-30 21 53 07

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

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.

@DDDDDanica DDDDDanica added the team-extension-platform Extension Platform team label May 1, 2024
@DDDDDanica DDDDDanica self-assigned this May 1, 2024
@DDDDDanica DDDDDanica requested a review from a team as a code owner May 1, 2024 13:23
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 1, 2024

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.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [5d5ef43]
Page Load Metrics (710 ± 542 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint58162852210
domContentLoaded8191231
load4630537101128542
domInteractive8191231
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 281 Bytes (0.01%)
  • ui: 1.39 KiB (0.02%)
  • common: 464 Bytes (0.01%)

@codecov
Copy link
Copy Markdown

codecov bot commented May 1, 2024

Codecov Report

Attention: Patch coverage is 65.45455% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 67.37%. Comparing base (2c45770) to head (7f1956c).
Report is 53 commits behind head on develop.

Files Patch % Lines
...gs/developer-options-tab/developer-options-tab.tsx 63.16% 14 Missing ⚠️
ui/helpers/constants/settings.js 0.00% 4 Missing ⚠️
ui/store/actions.ts 90.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24326      +/-   ##
===========================================
+ Coverage    67.31%   67.37%   +0.06%     
===========================================
  Files         1276     1276              
  Lines        49731    49749      +18     
  Branches     12921    12918       -3     
===========================================
+ Hits         33474    33515      +41     
+ Misses       16257    16234      -23     

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Convert this file to typescript and added new component

Copy link
Copy Markdown
Contributor

@zone-live zone-live left a comment

Choose a reason for hiding this comment

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

LGTM!

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7f1956c]
Page Load Metrics (763 ± 594 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint60152812110
domContentLoaded8271242
load4837007631237594
domInteractive8271242
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 281 Bytes (0.01%)
  • ui: 1.39 KiB (0.02%)
  • common: 464 Bytes (0.01%)

@DDDDDanica DDDDDanica merged commit 0452736 into develop May 2, 2024
@DDDDDanica DDDDDanica deleted the feature/24224 branch May 2, 2024 14:43
@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-11.17.0 on PR. Adding release label release-11.17.0 on PR and removing other release labels(release-11.18.0), as PR was added to branch 11.17.0 when release was cut.

@metamaskbot metamaskbot added release-11.16.6 Issue or pull request that will be included in release 11.16.6 and removed release-11.17.0 labels Jun 4, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-11.16.6 on PR. Adding release label release-11.16.6 on PR and removing other release labels(release-11.17.0), as PR was cherry-picked in branch 11.16.6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MV3: Add flag to disable MV3 service worker keep alive code

4 participants