metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

Import all scripts fix

Open danjm opened this issue 1 year ago • 1 comments

Description

Fixes https://github.com/MetaMask/metamask-extension/issues/24514.

The problem was that if the service worker is terminated, when app-init.js runs again when the service worker is to be restarted, importAllScripts() is not called. The solution is just to make sure it is called in the top-level scope, on every run of the script. This should be safe to do because of the scriptsLoadInitiated check already in the importAllScripts function.

However, I am unsure why we were not doing this already... which makes me want to double check that there are no other reasons not to do this

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/metamask-extension/issues/24514

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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.

danjm avatar May 20 '24 11:05 danjm

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.

github-actions[bot] avatar May 20 '24 11:05 github-actions[bot]

Builds ready [321c043]
Page Load Metrics (1486 ± 564 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint601701063215
domContentLoaded9331352
load49307914861175564
domInteractive9331352
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar May 21 '24 17:05 metamaskbot

Builds ready [5d7b649]
Page Load Metrics (1321 ± 609 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint661761043216
domContentLoaded9331453
load52308613211269609
domInteractive9331453
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar May 23 '24 20:05 metamaskbot

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.

metamaskbot avatar Jun 04 '24 20:06 metamaskbot