feat: gate asset controller polling on unified assets in hooks#30477
Conversation
Move the feature-flag check from AssetPollingProvider into each polling hook so polling no-ops with empty input when unified assets state is off, while keeping hook call order stable for the provider.
|
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. |
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 dc10eb8. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key behavioral change: Previously, Impact areas:
The risk is medium because: (a) the logic is equivalent in both flag states (just moved), (b) tests were updated to cover both flag states, but (c) any regression in the flag check logic could cause polling to run when it shouldn't (or not run when it should), breaking asset display across the app. Performance Test Selection: |
|




Move the feature-flag check from AssetPollingProvider into each polling hook so polling no-ops with empty input when unified assets state is off, while keeping hook call order stable for the provider.
Description
Changelog
CHANGELOG entry: gate asset controller polling on unified assets in hooks
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes when asset-related controllers start/stop polling by moving unified-assets feature-flag gating into each polling hook; risk is moderate because it affects background polling behavior and could change network/load characteristics if the flag state is misinterpreted.
Overview
Moves unified-assets feature-flag gating from
AssetPollingProviderinto each asset polling hook (useCurrencyRatePolling,useTokenRatesPolling,useTokenDetectionPolling,useTokenBalancesPolling,useMultichainAssetsRatePolling) by resolving normal inputs and then passing an emptyinputtousePollingwhen the flag is enabled.Updates
AssetPollingProviderto always mount all polling hooks (stable call order) and adjusts/adds tests to assert that polling does not start when unified assets state is enabled, while provider tests no longer cover the provider-level feature-flag branch.Reviewed by Cursor Bugbot for commit ee35a16. Bugbot is set up for automated code reviews on this repo. Configure here.