-
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
feat: account syncing various updates #28541
Conversation
…ait for _addAccountsWithBalance before dispatching the first account sync
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. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@metamask/[email protected], npm/[email protected] |
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is network access?This module accesses the network. Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use. What is new author?A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package. Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights. What is unstable ownership?A new collaborator has begun publishing package versions. Package stability and security risk may be elevated. Try to reduce the amount of authors you depend on to reduce the risk to malicious actors gaining access to your supply chain. Packages should remove inactive collaborators with publishing rights from packages on npm. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
if (count !== 1) { | ||
await this.removeAccount(address); | ||
} | ||
break; |
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.
This whole function appears to be fully modified but it has just been wrapped in a try - catch - finally
block
app/scripts/metamask-controller.js
Outdated
} catch (e) { | ||
log.warn(`Failed to add accounts with balance. Error: ${e}`); | ||
} finally { | ||
this.preferencesController.setHasFinishedAddingAccountsWithBalance(true); |
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.
In order to prevent conflicts with different actors adding accounts at the end of onboarding, we're only dispatching account syncing when _addAccountsWithBalance
is done.
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
…etaMask/metamask-extension into improv/account_syncing_various_updates
…etaMask/metamask-extension into improv/account_syncing_various_updates
…etaMask/metamask-extension into improv/account_syncing_various_updates
Builds ready [32286e0]
Page Load Metrics (2341 ± 112 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
…etaMask/metamask-extension into improv/account_syncing_various_updates
Builds ready [0ed48a0]
Page Load Metrics (1897 ± 66 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
…etaMask/metamask-extension into improv/account_syncing_various_updates
Builds ready [c2f24fd]
Page Load Metrics (2110 ± 64 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
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.
Look good! Thanks for sorting.
Description
This PR adds various account syncing house keeping improvements in order to be ready for re-enablement in a subsequent PR.
The number of files changed by this PR is large, but none affects a user facing feature, since account syncing is disabled in production.
@metamask/profile-sync-controller
to version1.0.2
UserStorageController
,isAccountSyncingReadyToBeDispatched
andhasAccountSyncingSyncedAtLeastOnce
_addAccountsWithBalance
to finish adding accounts after onboarding, then setisAccountSyncingReadyToBeDispatched
totrue
USER_STORAGE_FEATURE_NAMES
exported constant from@metamask/profile-sync-controller
to define user storage paths everywhere (no more magic strings)UserStorageMockttpController
Related issues
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist