Skip to content

Conversation

@aristidesstaffieri
Copy link
Contributor

Closes #2437

Why
If a user is in the sign-transaction flow and the call to fetch their balances fails, we fail harshly and block them from completing the transaction.

What
This handles the failure silently and allows the user to continue in their flow, the only side effect is that we cannot warn them about a potential insufficient balance.

… view. Tweaks logic for insufficient balance warning to degrade silently in case of balance failures. Adds test cases for balance failures in the sign transaction flow
@aristidesstaffieri aristidesstaffieri self-assigned this Jan 29, 2026
Copilot AI review requested due to automatic review settings January 29, 2026 21:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses issue #2437 by making the account balance fetch in the sign transaction flow fail silently. Previously, if the balance API call failed (e.g., due to network connectivity issues), users were blocked from signing transactions with an error. Now, the balance fetch failure is handled gracefully, allowing users to proceed with signing transactions even when balances cannot be loaded.

Changes:

  • Modified balance fetching in useGetSignTxData to handle failures silently by catching errors and setting balances to undefined
  • Updated the ResolvedData interface to make the balances field optional
  • Changed the insufficient balance check in SignTransaction to skip the warning when balances are unavailable
  • Added comprehensive test coverage for the new behavior

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
extension/src/popup/views/SignTransaction/hooks/useGetSignTxData.tsx Added try-catch block around balance fetching to handle failures silently, removed error-throwing logic, and made balances field optional in ResolvedData interface
extension/src/popup/views/SignTransaction/index.tsx Updated balance check logic to handle undefined balances by defaulting to allowing the user to proceed
extension/src/popup/views/tests/SignTransaction.test.tsx Added test case for rendering sign transaction view when balances are unavailable, with minor inconsistency in using hardcoded network passphrase
extension/src/popup/views/SignTransaction/hooks/tests/useGetSignTxData.test.tsx Added test case to verify graceful handling of balance fetch failures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aristidesstaffieri aristidesstaffieri requested a review from a team January 29, 2026 22:54
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.

If Account Balances fetch fails, Sign TX doesn't handle error

3 participants