feat: use token search endpoint for token import flow#26108
feat: use token search endpoint for token import flow#26108
Conversation
| // Increment request ID to mark this as the current request | ||
| const currentRequestId = ++requestIdRef.current; | ||
| setIsLoading(true); | ||
| setIsFetching(true); |
There was a problem hiding this comment.
Stale token results reappear after clearing
Medium Severity
useSearchRequest returns early for an empty debouncedQuery before advancing requestIdRef. If an earlier request resolves afterward, it is still treated as current and can repopulate results with stale tokens even though the search input is cleared.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The regression tests for import tokens and NFTs (import-tokens.spec.ts, import-custom-token.spec.ts, nft-details.spec.ts) use RegressionAssets tag which is not in the available smoke tags. However, the functionality being changed relates to:
This is marked as high risk because:
Performance Test Selection: |
|




Description
NEEDS UPDATE TO CORE PACKAGE
Changelog
CHANGELOG entry: use token search endpoint for token import flow
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2656
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes the token import/search behavior and network support detection, which could impact users’ ability to find/import tokens if the probe/search API behaves unexpectedly or errors are mishandled.
Overview
Updates the Add Asset token-import flow to rely on the token search API for populating the search tab, including an upfront “probe” request to determine whether the selected network supports search and showing a loading state while that check runs.
Refactors the Add Asset UI/test surface by removing legacy token/NFT import components and their tests/snapshots (
AddCustomToken,AddCustomCollectible,AssetSearch,MultiAssetListItems,SearchTokenAutocomplete) and consolidating selector IDs underImportAssetView.testIds(plus minor header/title and import-path cleanups).Written by Cursor Bugbot for commit db70fe9. This will update automatically on new commits. Configure here.