fix(assets-controller): hardened error handling#8294
Open
Conversation
f57996a to
4b711c2
Compare
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.
| /** Max concurrent `/v3/assets` chunk requests (same default scale as balance middleware). */ | ||
| const V3_ASSETS_FETCH_CONCURRENCY = 3; | ||
|
|
||
| const MIN_TOKEN_OCCURRENCES = 3; |
There was a problem hiding this comment.
Unused MIN_TOKEN_OCCURRENCES constant is dead code
Low Severity
The MIN_TOKEN_OCCURRENCES constant is defined but never referenced anywhere in the codebase. A grep across the entire repository finds only this single definition. The changelog notes that the filtering approach changed from minimum occurrence count to Blockaid scanning, so this constant appears to be a leftover from the old approach that was inadvertently introduced in this diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Explanation
References
Checklist
Note
Medium Risk
Changes request fan-out and concurrency for token metadata and spot-price fetching and alters error propagation by swallowing exceptions in several update callbacks, which could impact refresh behavior and observability if misconfigured.
Overview
Improves assets pipeline resilience by wrapping several push-update callbacks in
try/catch(active-chain updates inAssetsController, and polling callbacks inRpcDataSourceandStakedBalanceDataSource) to prevent unhandled errors from breaking subscription/poll ticks.Fixes v3 API request limits by chunking Tokens
/v3/assetsmetadata fetches and Prices v3 spot-price fetches into max 120 asset IDs per request, executing chunks in parallel with bounded concurrency viap-limit; adds unit tests covering chunking behavior (including non-USD + USD dual-fetch). Also hardensSnapDataSourcebalance update handling against missing/undefined payload fields and updates the mock messenger fixture import path.Written by Cursor Bugbot for commit f715a73. This will update automatically on new commits. Configure here.