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: fix account controller legacy polling #5321

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Feb 13, 2025

Explanation

Changes were made to accountTrackerController inside the @metamask/assets-controllers package.

The account tracker polling was executed on the constructor with the initialisation. This caused additional requests to be sent by the app, leading to performance issues.

Additionally, the accountTracker was still using legacy polling via the poll function. This function has now been removed, and a test has been added to prevent the creation of multiple polling instances.

These changes improve efficiency by reducing unnecessary network requests and ensuring the polling mechanism is properly controlled.

References

Changelog

@metamask/assets-controllers

  • CHANGED: Removed legacy poll function to prevent redundant polling.
  • FIXED: ensure that the polling is not triggered on the constructor with the initialisation

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
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@salimtb salimtb marked this pull request as ready for review February 13, 2025 09:42
@salimtb salimtb requested a review from a team as a code owner February 13, 2025 09:42
@salimtb salimtb force-pushed the fix/fix-account-tracker-legacy-polling branch from afe784a to 111a39f Compare February 13, 2025 09:58
@@ -35,8 +35,7 @@
"no-shadow": 2
},
"packages/assets-controllers/src/AccountTrackerController.test.ts": {
"import-x/namespace": 2,
"import-x/order": 2
"import-x/namespace": 2
Copy link
Contributor

Choose a reason for hiding this comment

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

nice cleanup!

@salimtb salimtb merged commit 422ab57 into main Feb 13, 2025
130 checks passed
@salimtb salimtb deleted the fix/fix-account-tracker-legacy-polling branch February 13, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants