[LWD] fix(lwd): include testnets in global search results (LIVE-33220)#18959
[LWD] fix(lwd): include testnets in global search results (LIVE-33220)#18959LucasWerey wants to merge 3 commits into
Conversation
Web Tools Build Status
|
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Ledger Wallet Desktop (Wallet 4.0) Global Search assets query so DADA can return testnet assets when developer mode is enabled, matching the Receive flow behavior and keeping the backend environment (prod vs staging) consistent with the lldModularDrawer feature flag.
Changes:
- Pass
includeTestNetworks(fromMANAGER_DEV_MODE) intouseAssetsDatafor Global Search results. - Pass
isStaging(fromlldModularDrawer.params.backendEnvironment) intouseAssetsDatato align DADA environment selection. - Add a unit test suite and a changeset for the desktop patch release.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/ledger-live-desktop/src/mvvm/features/SearchAssets/hooks/useAssetSearchResultsViewModel.ts | Threads includeTestNetworks + isStaging into the DADA useAssetsData query for Global Search. |
| apps/ledger-live-desktop/src/mvvm/features/SearchAssets/hooks/tests/useAssetSearchResultsViewModel.test.ts | Adds unit tests asserting the query opts into testnets based on MANAGER_DEV_MODE (and should cover staging). |
| .changeset/lwd-globalsearch-testnets.md | Declares a desktop patch changeset for the Global Search testnet/staging query update. |
Rsdoctor Bundle Diff AnalysisFound 7 projects in monorepo, 7 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 desktop-mainPath:
📁 desktop-preloaderPath:
📁 desktop-rendererPath:
📁 desktop-webviewDappPreloaderPath:
📁 desktop-webviewPreloaderPath:
📁 desktop-workersPath:
📁 mobilePath:
Generated by Rsdoctor GitHub Action |
…sults (LIVE-33220)
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
apps/ledger-live-desktop/src/mvvm/features/SearchAssets/utils/mapAssetsDataToMarketCurrencies.ts:33
- The deactivated-currency filtering only excludes meta-assets when all network currencies are deactivated, but the selected
ledgerIdcan still end up pointing to a deactivated network when a meta-asset spans both deactivated and active networks (becauseselectCurrencyForMetaIdmay prefer a CryptoCurrency from the deactivated network). This can make Global Search surface an item whose returnedledgerIdsare unusable even though an active network exists.
Consider selecting the ledgerId from an active (non-deactivated) network whenever the preferred currency resolves to a deactivated network, and fall back to the first active network entry when no currency resolves.
const currency = selectCurrencyForMetaId(id, data);
const ledgerId = currency?.id ?? Object.values(meta.assetsIds)[0];
if (!ledgerId) return [];
const market = currency ? markets[currency.id] : undefined;
| it("hides a result whose only network currency flag is off", () => { | ||
| mockedAssets.mockReturnValue(buildSearchData("robinhood_testnet")); | ||
|
|
||
| const { result } = renderHook(() => useAssetSearchResultsViewModel({ search: "amd" })); | ||
|
|
||
| expect(result.current.data).toHaveLength(0); | ||
| }); |



✅ Checklist
npx changesetwas attached.useAssetsDatais queried withincludeTestNetworksdriven byMANAGER_DEV_MODE.📝 Description
Desktop port of the LWM fix (#18931 / LIVE-33199). Global Search did not surface testnets because
useAssetSearchResultsViewModelcalled the DADAuseAssetsDatahook without theincludeTestNetworks/isStagingparameters, so the backend returned mainnets only.This PR adds the same logic the Receive flow already uses (
useReceiveNetworkLedgerIds):includeTestNetworksfromuseEnv("MANAGER_DEV_MODE")→ testnets surface only in developer mode.isStagingderived from thelldModularDrawerfeature flag'sbackendEnvironmentparam, keeping the DADA environment consistent with the rest of the app.❓ Context