Skip to content

fix: Only prevent the service worker timestamp save if initState.PreferencesController?.enableMV3TimestampSave is false#24697

Merged
danjm merged 1 commit intodevelopfrom
allow-undefined-enableMV3TimestampSave
May 22, 2024
Merged

fix: Only prevent the service worker timestamp save if initState.PreferencesController?.enableMV3TimestampSave is false#24697
danjm merged 1 commit intodevelopfrom
allow-undefined-enableMV3TimestampSave

Conversation

@danjm
Copy link
Copy Markdown
Contributor

@danjm danjm commented May 21, 2024

Description

This if block was added to allow us to easily toggle off the timestamp saving at an interval. (#24326)

enableMV3TimestampSave defaults to true in the preferences controller, but on first install of the extension, before the preferences controller has been initialized, it will be undefined.

We should ensure that this timestamp saving behaviour is able to occur on first install of the extension by only preventing it if enableMV3TimestampSave is explicitly false.

Open in GitHub Codespaces

Manual testing steps

Repro broken:

  1. On develop, put a console log inside the if block that this PR modifies
  2. Build and install and start to use metamask. Notice that the console log does on occur.

Test fix:

  1. On this branch, put a console log inside the if block that this PR modifies
  2. Build and install and start to use metamask. Notice that the console log does occur.

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.

…esController?.enableMV3TimestampSave is false
@danjm danjm requested a review from a team as a code owner May 21, 2024 21:10
@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.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 21, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7803a91]
Page Load Metrics (969 ± 535 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint66179992914
domContentLoaded84119126
load5429409691113535
domInteractive84119126
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 13 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@DDDDDanica
Copy link
Copy Markdown
Contributor

Thanks for the fix ! LGTM

@danjm danjm added the team-extension-platform Extension Platform team label May 22, 2024
@danjm danjm changed the title Only prevent the service worker timestamp save if initState.PreferencesController?.enableMV3TimestampSave is false fix: Only prevent the service worker timestamp save if initState.PreferencesController?.enableMV3TimestampSave is false May 22, 2024
@danjm danjm merged commit 92d5e04 into develop May 22, 2024
@danjm danjm deleted the allow-undefined-enableMV3TimestampSave branch May 22, 2024 16:11
@github-actions github-actions bot locked and limited conversation to collaborators May 22, 2024
@metamaskbot metamaskbot added release-11.16.6 Issue or pull request that will be included in release 11.16.6 and removed release-11.18.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.18.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

INVALID-PR-TEMPLATE PR's body doesn't match template release-11.16.6 Issue or pull request that will be included in release 11.16.6 team-extension-platform Extension Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants