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

fix: main token balance not updating when switching accounts #9812

Merged
merged 11 commits into from
Jun 3, 2024

Conversation

tommasini
Copy link
Contributor

@tommasini tommasini commented May 31, 2024

Description

We should re-use the other selectors to make sure the deepEqual updates when the other values are updated.
If we access those directly that will not trigger an update for the deeEqual selector.

Related issues

Fixes: #1818

Manual testing steps

  1. Switch accounts and the main token balance should change
  2. Switch networks and the main token balance should change

Screenshots/Recordings

Before

before-selector-fix.mov

After

fixed-selectors.mov

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.

Copy link
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.

@tommasini tommasini added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-platform labels May 31, 2024
@tommasini tommasini marked this pull request as ready for review May 31, 2024 11:58
@tommasini tommasini requested a review from a team as a code owner May 31, 2024 11:58
@tommasini tommasini added the Run Smoke E2E Triggers smoke e2e on Bitrise label May 31, 2024
Copy link
Contributor

github-actions bot commented May 31, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: c53d581
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d8a5e6e2-bc36-4d6b-a45e-c177fe0c2963

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

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

left a comment

app/selectors/accountTrackerController.ts Outdated Show resolved Hide resolved
@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels May 31, 2024
Copy link
Contributor

github-actions bot commented May 31, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: dcbc5c1
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a936843c-b9dc-4524-accf-75e9df6c6131

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

Cal-L
Cal-L previously approved these changes May 31, 2024
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jun 3, 2024
Copy link
Contributor

github-actions bot commented Jun 3, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: e46238d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/48c0a4ed-376e-4b4b-8746-34887f23ed84

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

@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jun 3, 2024
Copy link
Contributor

github-actions bot commented Jun 3, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 2541672
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/56be57dd-e1ad-4b9b-9876-5ddb4ac6c2e6

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

Copy link
Contributor Author

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

Unit tests looks good! Amazing that we can test the re renders caused by our selectors!

Cal-L
Cal-L previously approved these changes Jun 3, 2024
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@Cal-L Cal-L added the No QA Needed Apply this label when your PR does not need any QA effort. label Jun 3, 2024
@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jun 3, 2024
Copy link
Contributor

github-actions bot commented Jun 3, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 02e7521
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c0dee013-76e1-4d41-ad3b-bacfbf9d072e

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

@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jun 3, 2024
Copy link
Contributor

github-actions bot commented Jun 3, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 509ac4d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6cbe155a-9768-4aa6-a2ac-452b46047d76

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

Copy link

sonarcloud bot commented Jun 3, 2024

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@tommasini tommasini merged commit be29b05 into main Jun 3, 2024
35 checks passed
@tommasini tommasini deleted the fix/balance-between-accounts-switching-network branch June 3, 2024 21:22
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jun 3, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2024
@metamaskbot metamaskbot added the release-7.25.0 Issue or pull request that will be included in release 7.25.0 label Jun 3, 2024
@tommasini tommasini added release-7.24.0 Issue or pull request that will be included in release 7.24.0 and removed release-7.25.0 Issue or pull request that will be included in release 7.25.0 labels Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.24.0 Issue or pull request that will be included in release 7.24.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants