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(NOTIFY-1096): add account syncing #11190

Open
wants to merge 57 commits into
base: main
Choose a base branch
from

Conversation

mathieuartu
Copy link

@mathieuartu mathieuartu commented Sep 13, 2024

Description

This PR adds account syncing to MetaMask.
As part of profile syncing, with this new feature, users will be able to synchronize all of their accounts and accounts' names across all of their devices.

Related issues

Fixes:

NOTIFY-1096

Manual testing steps

  1. Log in with SRP
  2. Activate profile syncing in preferences
  3. Add new accounts and rename others
  4. Using another browser, log in with SRP
  5. Activate profile syncing in preferences
  6. Watch the magic happen!

Pre-merge author checklist

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.

@mathieuartu mathieuartu added the team-notifications Notifications team label Sep 13, 2024
Copy link
Contributor

github-actions bot commented Sep 13, 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.

@mathieuartu
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Sep 13, 2024
Copy link

socket-security bot commented Sep 13, 2024

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 55.68%. Comparing base (7475ab4) to head (9aca646).
Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
app/components/Views/Wallet/index.tsx 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11190      +/-   ##
==========================================
+ Coverage   55.24%   55.68%   +0.43%     
==========================================
  Files        1558     1573      +15     
  Lines       37153    37497     +344     
  Branches     4406     4473      +67     
==========================================
+ Hits        20527    20880     +353     
+ Misses      16155    16126      -29     
- Partials      471      491      +20     

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

@mathieuartu mathieuartu added Run Smoke E2E Triggers smoke e2e on Bitrise and removed INVALID-PR-TEMPLATE PR's body doesn't match template labels Sep 13, 2024
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Sep 13, 2024
Copy link
Contributor

github-actions bot commented Sep 13, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: b9bb37a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2134006d-61ca-4b88-9604-1c8f52146b4d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@mathieuartu mathieuartu added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Sep 13, 2024
Copy link
Contributor

github-actions bot commented Sep 13, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 6c9b2ce
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/79653e7d-5260-497f-b2ed-3cdcf84785e9

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@mathieuartu mathieuartu added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Sep 13, 2024
Copy link
Contributor

github-actions bot commented Sep 13, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: ab17435
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/362ae0c7-a89a-402c-956b-3c7737d8a7c0

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

app/components/Views/Wallet/index.tsx Show resolved Hide resolved
app/core/Engine.ts Show resolved Hide resolved
@mathieuartu mathieuartu marked this pull request as ready for review October 16, 2024 08:05
@mathieuartu mathieuartu requested review from a team as code owners October 16, 2024 08:05
Jonathansoufer
Jonathansoufer previously approved these changes Oct 16, 2024
Copy link
Contributor

@Jonathansoufer Jonathansoufer left a comment

Choose a reason for hiding this comment

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

LGTM!

Daniel-Cross
Daniel-Cross previously approved these changes Oct 16, 2024
Copy link
Contributor

@Daniel-Cross Daniel-Cross left a comment

Choose a reason for hiding this comment

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

Just one small listing issue fix and you're good to go!

Daniel-Cross
Daniel-Cross previously approved these changes Oct 16, 2024
Copy link
Contributor

@Daniel-Cross Daniel-Cross left a comment

Choose a reason for hiding this comment

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

GTG!

app/core/Engine.ts Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 17, 2024

@mathieuartu mathieuartu added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 17, 2024
Copy link
Contributor

github-actions bot commented Oct 17, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 9ca93ba
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/05e21872-7d34-427e-a7ca-99988fd8e5d2

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 17, 2024
@@ -144,4 +153,36 @@ describe('Wallet', () => {
const foxIcon = screen.getByTestId(CommonSelectorsIDs.FOX_ICON);
expect(foxIcon).toBeDefined();
});
it('should dispatch account syncing on mount', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it('should dispatch account syncing on mount', () => {
it('dispatches account syncing on mount', () => {

render(Wallet);
expect(useAccountSyncing().dispatchAccountSyncing).toHaveBeenCalledTimes(1);
});
it('should dispatch account syncing when appState switches from inactive|background to active', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it('should dispatch account syncing when appState switches from inactive|background to active', () => {
it('dispatches account syncing when appState switches from inactive|background to active', () => {


expect(addEventListener).toHaveBeenCalledTimes(1);

const handleAppStateChange = addEventListener.mock.calls[0][1];
Copy link
Contributor

Choose a reason for hiding this comment

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

C: Not fond of this as if we add another listener in the code, this will break this test even if the feature works.

Suggested change
const handleAppStateChange = addEventListener.mock.calls[0][1];
expect(addEventListener).toHaveBeenCalledWith('change', expect.any(Function));
const handleAppStateChange = (addEventListener as jest.Mock).mock.calls.find(
([event]) => event === 'change'
)[1];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template Run Smoke E2E Triggers smoke e2e on Bitrise team-notifications Notifications team
Projects
Status: Needs more work from the author
Development

Successfully merging this pull request may close these issues.

7 participants