Skip to content

[Bug] useWallet's connect() has no catch, silently swallowing rejected wallet calls #94

Description

@collinsezedike

Description

useWallet's connect() has no catch, only a finally. If anything it awaits (connectWallet(), or the getAddress/getNetwork calls inside it) ever rejects rather than resolving to an error-state object, the rejection is unhandled: connecting resets, but the user gets no feedback at all, and the error only surfaces as a silent unhandled-promise-rejection in the console.

Steps to reproduce

  1. Open the demo app with Freighter installed and unlocked.
  2. Simulate a rejected promise somewhere in the connect() chain (e.g. temporarily throw inside resolveConnectedState() in src/lib/wallet.ts, or trigger a genuine Freighter extension messaging failure by disabling/reloading the extension mid-call).
  3. Click "Connect wallet".

Expected behavior

The UI shows some indication that the connection attempt failed (a toast, an inline message, anything), matching the error-surfacing pattern already used elsewhere in the app (e.g. MilestoneRow.tsx's run() wrapper, which catches and surfaces contract-call errors).

Actual behavior

connecting flips back to false (via finally), but wallet state never updates and no error is shown. The failure is invisible to the user; only a console error (if any) hints at what happened.

Environment

  • Network: testnet
  • Contract: n/a (this is demo-app-only, demos/freelance-escrow)
  • Commit or tag: main

Possible impact

No fund-safety or contract-state impact; this is a demo-app UX bug (silent failure on wallet connect), not a security issue.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignbugSomething isn't workingeasySmall, low-risk change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions