Skip to content

fix: crash on Verify Address in Receive screen#6938

Closed
Parsh with Copilot wants to merge 2 commits into
feat/openspec-integrationfrom
copilot/fix-app-crash-verify-address
Closed

fix: crash on Verify Address in Receive screen#6938
Parsh with Copilot wants to merge 2 commits into
feat/openspec-integrationfrom
copilot/fix-app-crash-verify-address

Conversation

Copilot AI commented May 7, 2026

Copy link
Copy Markdown

Tapping "Verify Address" on the Receive screen caused an immediate crash due to a React Rules of Hooks violation in ConnectChannel.

Root cause

useVault was called inside a conditional block, violating React's requirement that hooks always execute unconditionally at the top level:

// Before — hook inside an if block: INVALID
if (mode === InteracationMode.ADDRESS_VERIFICATION) {
  const { activeVault: vault } = useVault({ vaultId }); // 💥 crashes
  ...
}

Fix

  • Moved useVault({ vaultId }) to the top level of ConnectChannel, ahead of all conditionals.
  • Added && vault null-guard so address-descriptor computation is skipped until the vault is available.
  • Added optional chaining on vaultKey?.registeredVaults to harden a latent null-dereference on the same path.
// After — unconditional hook call at top level
const { activeVault: vault } = useVault({ vaultId });

if (mode === InteracationMode.ADDRESS_VERIFICATION && vault) {
  // safe to use vault here
}

Copilot AI linked an issue May 7, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix app crash on verify address in receive screen fix: crash on Verify Address in Receive screen May 7, 2026
Copilot AI requested a review from Parsh May 7, 2026 08:53
Copilot finished work on behalf of Parsh May 7, 2026 08:53
Copilot finished work on behalf of Parsh May 7, 2026 09:24
@Parsh
Parsh marked this pull request as ready for review May 7, 2026 09:41
@Parsh

Parsh commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Failure, missing specs

@Parsh Parsh closed this May 7, 2026
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.

App crashes on Verify Address in Receive screen

2 participants