Feature / Trending tokens#2505
Conversation
sonytooo
commented
Jun 24, 2026
- Add trending tokens to the DappsController. Later the dapps ctrl is planned to be renamed to the more generic name ExploreController to match to FE functionality
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
| // Trending tokens are refreshed server-side every 10 minutes; poll at the same cadence. | ||
| this.#updateTrendingTokensInterval = new RecurringTimeout( | ||
| () => this.continuouslyUpdateTrendingTokens(), | ||
| TRENDING_TOKENS_UPDATE_INTERVAL, | ||
| this.emitError.bind(this) | ||
| ) |
There was a problem hiding this comment.
Should we move it to continuous updates?
| this.#continuouslyUpdateTrendingTokensPromise = this.#continuouslyUpdateTrendingTokens() | ||
| .catch((err) => { | ||
| this.#updateTrendingTokensInterval.updateTimeout({ | ||
| timeout: TRENDING_TOKENS_FAILED_UPDATE_INTERVAL | ||
| }) | ||
| throw err | ||
| }) |
There was a problem hiding this comment.
Why do we rethrow the error here and not emit an error?
| export const PHISHING_INACTIVE_UPDATE_INTERVAL = 6 * 60 * 60 * 1000 // 6 hrs | ||
| export const PHISHING_ACTIVE_UPDATE_INTERVAL = 15 * 60 * 1000 // 15 minutes | ||
| export const PHISHING_FAILED_TO_GET_UPDATE_INTERVAL = 600000 // 10 minutes | ||
| export const TRENDING_TOKENS_UPDATE_INTERVAL = 10 * 60 * 1000 // 10 minutes |
There was a problem hiding this comment.
Isn't this way too often? There are 30 tokens, yes, but we are updating the tokens regardless of whether the extension is active or not. Imo, we shoud run the interval while the extension is active and simply update on popup open if the last update is more than X minutes ago. If the interval runs less often then it will be okay to run it always (e.g., every 4+ hours)
…med-payload Trending tokens/ remove duplicate properties