Skip to content

fix(react): preserve signing client hook order across chains - #54

Open
ayenisholah wants to merge 1 commit into
hyperweb-io:mainfrom
ayenisholah:fix/signing-client-hook-order
Open

ayenisholah wants to merge 1 commit into
hyperweb-io:mainfrom
ayenisholah:fix/signing-client-hook-order

Conversation

@ayenisholah

Copy link
Copy Markdown

Switching a mounted useSigningClient consumer between Cosmos and Ethereum/Solana changes the number of React hooks called because the non-Cosmos return precedes useAsync. This can crash the consumer or disturb subsequent hooks.

Always call useAsync, enable requests only for a ready, connected Cosmos wallet, and retain the existing null/false/null response for other chain types. No public API changes. This is separate from the stale-request handling in #52 and import-cycle fix in #53.

Validation (Node 24.19.0):

  • All three new regression cases fail before the fix.
  • After: 7 React suites / 35 tests pass, including round-trip chain switches and error clearing; no RPC/signing requests for non-Cosmos chains.
  • React package CJS/ESM/CSS build passes; git diff --check passes.
  • No wallet-network E2E run.

AI-assisted code and tests reviewed locally. Signed commit; draft pending upstream CI approval.

@ayenisholah
ayenisholah marked this pull request as ready for review November 3, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant