Skip to content

fix: wallet error classification, auto-retry dropped requests, actionable feedback - #19

Merged
jayteemoney merged 1 commit into
mainfrom
fix/wallet-error-handling
Jul 13, 2026
Merged

fix: wallet error classification, auto-retry dropped requests, actionable feedback#19
jayteemoney merged 1 commit into
mainfrom
fix/wallet-error-handling

Conversation

@jayteemoney

Copy link
Copy Markdown
Owner

What

Third and final hardening pass on the wallet flow. The "Couldn't reach the wallet" toast was a catch-all hiding three distinct failure modes — reading the @stacks/connect v8 source, its throw paths are now each handled properly:

Failure Cause Now
-31000 Provider did not return a response Browser suspended the extension's background worker; the waking request gets dropped Auto-retried once — succeeds in practice, invisible to the user
"No installed Stacks wallet found" Page can't see an injected provider (per-site extension access, etc.) Toast explains the exact fix: click the extension icon once to grant access
User cancel in foreign shapes instanceof JsonRpcError fails across module copies / wallet-thrown objects New wallet-errors module classifies by code (−31001/−32000) + message shape
Anything unknown Toast shows the actual error detail (+code), so reports are debuggable

Same hardening applied to transaction signing (stx_callContract), which shares the sleeping-worker failure mode.

Verify

  • tsc --noEmit + npm run build clean
  • Error classification is code+message based, no instanceof

…ctionable toasts

'Couldn't reach the wallet' was a dead-end catch-all that collapsed
three distinct failures into one useless message:

- code -31000 'Provider did not return a response': the extension's
  background worker was suspended by the browser and dropped the
  request while waking. Now retried automatically once — succeeds in
  practice, user never sees an error.
- 'No installed Stacks wallet found': the page can't see an injected
  provider (e.g. per-site extension access). Now explains exactly what
  to do: click the extension icon once to grant site access.
- User cancels arriving in foreign shapes: instanceof JsonRpcError is
  unreliable across module copies and wallet-thrown plain objects. New
  wallet-errors module classifies by numeric code and message shape.

Unknown failures now surface the actual error detail in the toast, so
field reports are debuggable instead of generic. Same hardening applied
to the transaction signing path (stx_callContract), which shares the
sleeping-worker failure mode.
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stackstream Ready Ready Preview, Comment Jul 13, 2026 7:59am

@jayteemoney
jayteemoney merged commit 818cc49 into main Jul 13, 2026
1 of 4 checks passed
@jayteemoney
jayteemoney deleted the fix/wallet-error-handling branch July 13, 2026 07:58
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