fix: All Networks dead-end fallback (OK-57945)#12525
Open
weatherstar wants to merge 9 commits into
Open
Conversation
weatherstar
requested review from
ezailWang,
huhuanming,
originalix,
revan-zhang and
sidmorizon
as code owners
July 16, 2026 09:06
weatherstar
enabled auto-merge (squash)
July 16, 2026 09:06
originalix
reviewed
Jul 16, 2026
originalix
reviewed
Jul 16, 2026
originalix
reviewed
Jul 16, 2026
The pinned-to-bottom compensation will be reworked separately; this PR keeps only the All Networks dead-end fallback.
Rapid successive selections under All Networks could commit out of order because the fallback network query is async; guard writes with a per-scene latest-request id and cover the reordering in a test.
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-57945
Summary
confirmAccountSelectagainst out-of-order commits: rapid successive selections now resolve latest-wins even when the async fallback query completes out of order (review feedback)Intent & Context
QA-reported wallet issue:
OK-57945: With a software wallet on All Networks whose enabled set contains only QR-unsupported chains (e.g. DOT only), creating a QR wallet lands home on All Networks with zero compatible networks. The home network selector renders a blank placeholder (no press target), and the all-network data pipeline has nothing to aggregate — the page dead-ends with no way for the user to escape. The same dead end existed when switching to an existing QR wallet, and via legacy persisted state on cold start.
Root Cause
OK-57945:
createQrWalletforces the post-create selection toonekeyallwithout checking whether any enabled All Networks chain is compatible with the QR wallet;confirmAccountSelectsimilarly carriesonekeyallover when switching wallets.AllNetworksManagerTriggerrenders a non-pressable empty<Stack h={36}/>when the compatible enabled set is empty, so the user cannot recover from the UI.Design Decisions
createQrWallet(onboarding): if no enabled All Networks chain is compatible with the new wallet, select the first created account's network instead ofonekeyall(this restores previously commented-out fallback code, now gated on the compatibility check).confirmAccountSelect(wallet switch): a new BG methodgetAllNetworksFallbackNetworkIdreturns the first wallet-compatible mainnet only when the All Networks view would be empty; the switch then goes throughupdateSelectedAccountso deriveType is re-fixed for the new network. Skipped in webDappMode (which forces All Networks by design). Writes are guarded by a per-scene latest-request id so a slower fallback query cannot overwrite a newer selection.AllNetworksManagerTrigger(escape hatch for any residual path — cold-start legacy state, tray switches): when the compatible set is resolved and empty, render a pressable All Networks trigger that opens the unified network selector instead of a blank placeholder. A newisReadyflag on the hook distinguishes "not resolved yet" (keeps the loading placeholder, no cold-start visual change) from "resolved but empty".Changes Detail
packages/kit-bg/src/services/ServiceAllNetwork/ServiceAllNetwork.ts: new BG methodsgetEnabledNetworksCompatibleWithWalletIdandgetAllNetworksFallbackNetworkId.packages/kit/src/states/jotai/contexts/accountSelector/actions.tsx: All Networks dead-end fallback increateQrWallet(onboarding) andconfirmAccountSelect(wallet switch), with a latest-request guard on the fallback write path.packages/kit/src/hooks/useAllNetwork.ts:useEnabledNetworksCompatibleWithWalletIdInAllNetworksnow returnsisReady(initResult identity check; no behavior change for existing consumers).packages/kit/src/components/AccountSelector/AllNetworksManagerTrigger.tsx: pressable escape-hatch trigger when the compatible enabled set is resolved and empty.packages/kit/src/states/jotai/contexts/accountSelector/actions.test.tsx: 8 regression tests covering the createQrWallet fallback, confirmAccountSelect fallback, and out-of-order completion paths.