chore: remove global network selector feature flag from selectors and polling #22463
+193
−951
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Description
This is the first in a series of PRs removing the
MM_REMOVE_GLOBAL_NETWORK_SELECTORfeature flag.Master PR for reference: #22067
This PR removes the feature flag from polling hooks and their tests. The polling hooks (
useTokenRatesPollinganduseTokenListPolling) already useusePollingNetworks(), which relies onNetworkEnablementControllerto determine which networks to poll. The tests were updated to:isRemoveGlobalNetworkSelectorEnabledfeature flag mocksNetworkEnablementControllerconfigurationFiles Changed:
app/components/hooks/AssetPolling/useTokenRatesPolling.test.ts- Removed feature flag mocks, updated tests to use NetworkEnablementController stateapp/components/hooks/AssetPolling/useTokenListPolling.test.ts- Removed feature flag mocks, updated tests to use NetworkEnablementController stateBehavior Change:
The default behavior is now equivalent to the feature flag being ON. Polling hooks poll enabled EVM networks based on NetworkEnablementController.enabledNetworkMap instead of using the feature flag to determine behavior.
Changelog
CHANGELOG entry: Removed
MM_REMOVE_GLOBAL_NETWORK_SELECTORfeature flag from asset polling hooks. Polling now usesNetworkEnablementControllerstate to determine which networks to poll.Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-195
Manual testing steps
Screenshots/Recordings
~Before
~After
~Pre-merge author checklist
Pre-merge reviewer checklist
Note
Removes
isRemoveGlobalNetworkSelectorEnabledusage across Wallet, selectors, and polling hooks, standardizing behavior to useNetworkEnablementController-driven enabled networks and updating tests/snapshots accordingly.app/components/Views/Wallet):isRemoveGlobalNetworkSelectorEnabledreferences; always showNftGridwhencollectiblesEnabled.enabledNetworksHasTestNet) to use enabled EVM networks directly.handleNetworkFilter, callselectNetwork(chainId)when no enabled EVM networks (without flag gating).NetworkEnablementController; snapshots updated.use-polling-networks: remove flag logic; return configs for enabled EVM networks when EVM selected.useAccountTrackerPolling,useCurrencyRatePolling,useTokenDetectionPolling,useTokenListPolling,useTokenRatesPolling): remove flag mocks and obsolete cases; assert polling only for enabled/popular networks; addNetworkEnablementControllerstate; ensure no polling when EVM not selected; unmount cleanup expectations.app/selectors/multichain/evm.ts):enabledNetworksByNamespace[EIP-155]when available, otherwise fall back to current-network/all-networks behavior....reading 'isNftFetchingProgress').Written by Cursor Bugbot for commit 328bfa3. This will update automatically on new commits. Configure here.