Skip to content
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: network sync - add main sync logic #4694

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

Prithpal-Sooriya
Copy link
Contributor

Explanation

This adds support for the "main-sync" on network syncing feature. This will get all a users local networks, and saved remote networks; then will append/update/delete networks synced across their devices.

We will add the controller integration in a following PR.

References

https://consensyssoftware.atlassian.net/browse/NOTIFY-1040

Changelog

@metamask/profile-sync-controller

  • CHANGED: Renamed the sync.ts file to sync-mutations.ts
  • ADDED: utils to the UserStorageController subpath.
  • ADDED: findNetworksToUpdate() function which will perform the "main-sync" logic for local and remote network configurations.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

Sorry, something went wrong.

@Prithpal-Sooriya Prithpal-Sooriya added the team-notifications Notification Team changes. https://github.com/orgs/MetaMask/teams/notifications label Sep 12, 2024

Verified

This commit was signed with the committer’s verified signature.
Prithpal-Sooriya Prithpal Sooriya
another PR will add the controller integration.
@Prithpal-Sooriya Prithpal-Sooriya force-pushed the NOTIFY-1040/add-network-sync-all branch from af1bb32 to c6ea36e Compare September 12, 2024 14:00
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review September 12, 2024 14:10
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner September 12, 2024 14:10

Verified

This commit was signed with the committer’s verified signature.
Prithpal-Sooriya Prithpal Sooriya

Verified

This commit was signed with the committer’s verified signature.
Prithpal-Sooriya Prithpal Sooriya
…network-sync-all
Copy link
Contributor

@mathieuartu mathieuartu left a comment

Choose a reason for hiding this comment

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

Excellent job! I might re-use some of the way you laid out your logic, as I think it makes better sense for future use of the batch PUT endpoint.

Nice coverage as well, wooo

@Prithpal-Sooriya Prithpal-Sooriya merged commit 97220b5 into main Sep 13, 2024
116 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the NOTIFY-1040/add-network-sync-all branch September 13, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-notifications Notification Team changes. https://github.com/orgs/MetaMask/teams/notifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants