chore: remove TokenListController#29872
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d85c0c7. Configure here.
bergarces
left a comment
There was a problem hiding this comment.
Reviewed and tested locally. LGTM
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The removal of TokenListController from the Engine means token list data must now come from another source (likely the new useTokensData hook that calls the tokens API directly). This is a significant change that could affect:
The fixture changes are particularly important as they affect the E2E test infrastructure directly. Performance Test Selection: |
|




Description
TokenListControllerhas been removed from@metamask/assets-controllersin favour of the token list being fetched directly by dependent controllers (e.g.TokenDetectionController,TokenRatesController). This PR removes all wiring ofTokenListControllerfrom the mobile app.Changes included:
token-list-controller-init.tsand its messenger (token-list-controller-messenger.ts) along with their testsuseTokenListPollinghook and its testTokenListControllerfromEngine.ts(instantiation, wiring, and exported state)TokenListControllerfromtypes.ts(MessengerClients,EngineState,MessengerClientsToInitialize, global action/event union types)TokenListControllerfrommessengers/index.ts(MESSENGER_FACTORIES)TokenListController:stateChangefromconstants.ts(BACKGROUND_STATE_CHANGE_EVENT_NAMES)TOKEN_LIST_STATE_CHANGE_EVENTconstant fromAppConstants.tsuseTokenListPollingcall fromAssetPollingProvideranduseEarnNetworkPollingTokenListController.state.tokensChainsCachefromTransactionElement/utils.jsTokenListController.fetchTokenListcall fromAddAsset.tsxinitial-background-state.json, E2E fixture files (default-fixture.json,fixture-validation.ts), and mock state files (Bridge/initialState.ts,perpsStateMock.ts,other-controllers-mock.ts,component-view/mocks.ts)Changelog
CHANGELOG entry: remove TokenListController
Related issues
https://consensyssoftware.atlassian.net/browse/ASSETS-3181
Manual testing steps
Screenshots/Recordings
Before
N/A
After
https://github.com/MetaMask/metamask-mobile/actions/runs/25657693707
https://github.com/MetaMask/metamask-mobile/actions/runs/25726986329
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an examplePre-merge reviewer checklist
Note
Medium Risk
Medium risk because it removes
TokenListControllerfrom Engine wiring/state and strips related polling and fixtures, which can impact token discovery/display paths if any remaining callsites still expect the controller or its cached token metadata.Overview
Removes
TokenListControllerintegration from the app, including Engine initialization/exported state, messenger wiring, background state change constants, and shared type definitions.Eliminates token-list polling (
useTokenListPolling) and stops calling it fromAssetPollingProvideranduseEarnNetworkPolling, along with deleting the hook and its tests.Cleans up UI callsites that depended on the controller:
AddAssetno longer triggersfetchTokenListon network change, andTransactionElementno longer prefixes approval action labels using token-list cache data. Updates/cleans fixtures and tests to reflect the removed controller state.Reviewed by Cursor Bugbot for commit ceeb3ef. Bugbot is set up for automated code reviews on this repo. Configure here.