fix: purge delisted networks from aggregate token cache and refresh stale wallet config OK-58112#12533
Open
weatherstar wants to merge 4 commits into
Open
fix: purge delisted networks from aggregate token cache and refresh stale wallet config OK-58112#12533weatherstar wants to merge 4 commits into
weatherstar wants to merge 4 commits into
Conversation
…tale wallet config
weatherstar
requested review from
ezailWang,
huhuanming,
originalix,
revan-zhang and
sidmorizon
as code owners
July 17, 2026 02:59
originalix
reviewed
Jul 17, 2026
- resolve a single surviving member as the current token so detail requests, contract copy and explorer links use its real network instead of the aggregate descriptor (mock networkId aggregate--0) - render an unavailable empty state and hide header actions when the filtered aggregate group has no valid member left - keep aggregate tokens on the loading spinner until the group is resolved so the descriptor never reaches the single-token fallback
originalix
reviewed
Jul 17, 2026
| // Skip networks this build no longer bundles: a stale | ||
| // aggregate-token cache persisted by an older app version may | ||
| // still reference delisted networks. | ||
| if (tokenNetwork) { |
Collaborator
There was a problem hiding this comment.
当旧聚合缓存引用的网络已从当前构建的 presetNetworks 移除,但它仍以 LISTED 状态存在于 serverNetwork 或 customNetwork 缓存时,getNetworkSafe() 仍会从合并后的网络注册表返回该网络。
因此这里不会执行注释所说的“当前构建不再 bundled 就跳过”,该成员仍会进入合约列表和详情页,PR 要修复的 stale-network 路径仍可复现。
请复用 getAllAggregateTokenInfo() 的 getListedNetworkMap() 过滤结果,或在此显式按 getListedNetworkMap() 判断,不要用 getNetworkSafe() 作为 bundled preset membership check。
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.
OK-58112
Problem
With All Networks enabled, opening an aggregate token's details page (e.g. USDT) and then the "Contract Address" popover shows blank rows — only the copy/explorer buttons render, with no network icon or name.
Root cause
/wallet/v1/wallet/configresponses are persisted intosimpleDb.aggregateToken.allAggregateTokenMap. On app versions before chore: remove 21 low-usage built-in EVM networks #10373 (removed 21 low-usage built-in EVM networks, 2026-02), networks like Gnosis (evm--100), B² (evm--223), Polygon zkEVM (evm--1101) and zkLink Nova (evm--810180) were LISTED presets, so USDT entries on them were cached.getNetworkSaferesolves toundefined→ empty network name and anullNetworkAvatar, while the address-driven buttons still render → blank rows.syncWalletConfigwas only triggered whenaggregateTokenConfigMapwas completely missing, so existing users never re-synced and the stale map survived indefinitely (server-side cleanup alone cannot fix affected users either).Changes
Symptom fixes (render-side tolerance):
TokenDetails: skip aggregate tokens whose network cannot be resolved when building the contract-address list.ServiceToken.getAllAggregateTokenInfo: filter cached aggregate tokens against the current bundled LISTED preset networks, healing all consumers of this accessor (receive flow, universal search, home token list).Root fix (cache refresh):
configSyncMeta(appVersion+syncedAt) on every successfulsyncWalletConfig.ServiceSetting.syncWalletConfigIfNeeded: re-syncs when the config was never synced, the app version changed (bundled preset network list may differ), or the cache is older than 24h; concurrent calls are deduped.TokenListBlockfires it in the background on all-networks refresh, so the full-replace sync (merge=false) purges delisted networks from the persisted maps.Verification
/wallet/v1/wallet/configstill returns 10 networkIds absent from current presets (4 of them removed by chore: remove 21 low-usage built-in EVM networks #10373 carry USDT — matching the 4 blank rows in the report).ServiceToken.getAllAggregateTokenInfofiltering andServiceSetting.syncWalletConfigIfNeededdecision matrix (9 tests, all passing).yarn agent:check --profile commitpasses.🤖 Generated with Claude Code