Skip to content

fix(connect): reject intent on send failure, human-readable errors, drop dead prefill#384

Merged
MastaP merged 2 commits into
mainfrom
chore/connect-cleanup-error-ux
Jun 19, 2026
Merged

fix(connect): reject intent on send failure, human-readable errors, drop dead prefill#384
MastaP merged 2 commits into
mainfrom
chore/connect-cleanup-error-ux

Conversation

@KruGoL

@KruGoL KruGoL commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

What

Follow-ups on the Connect intent work (part of #609), after send / payment_request moved to base-units confirm-only modals.

1. Reject the intent on send failure

SendIntentModal / PaymentRequestIntentModal previously showed the error in-modal and left the dApp's intent pending — the dApp's intent() never settled and sat on "Sending…". They now reject on failure:

  • sendTRANSFER_FAILED
  • payment_requestINTERNAL_ERROR

The dApp is informed (and can retry); the wallet's global query handler still toasts the error for the user.

2. Human-readable errors (no raw HTML)

When the backend/gateway returns an HTML error page (e.g. a 503 Service Unavailable), the raw <html>…</html> was rendered straight into the wallet modal and the dApp's error display. getErrorMessage now sanitizes such markup / 5xx responses into a clean message ("Service temporarily unavailable. Try again later", "Too many requests…", etc.). Centralized, so all error surfaces (modals + toasts) benefit.

3. Drop dead prefill / asModal

The Connect send / payment_request intents now use their own confirm-only modals, so nothing passes prefill / asModal to SendModal / SendPaymentRequestModal anymore. Removed the props, the SendPrefill / PaymentRequestPrefill types, the prefill effects, and the now-unused imports. Manual send / payment-request flows are unaffected.

Verification

  • tsc --noEmit → clean (exit 0)
  • eslint on changed files → clean (exit 0)

KruGoL added 2 commits June 19, 2026 03:16
…rop dead prefill

Three Connect follow-ups after send/payment_request moved to base-units
confirm-only modals:

- Send/payment_request confirm modals now REJECT the dApp intent on failure
  (TRANSFER_FAILED / INTERNAL_ERROR) instead of leaving it hanging — the dApp is
  informed and the wallet's global query handler toasts the error.
- getErrorMessage sanitizes raw backend error pages: an HTML / 5xx response
  (e.g. a gateway "503 Service Unavailable") is shown as "Service temporarily
  unavailable. Try again later" instead of dumping raw HTML into the UI.
- Drop the now-dead prefill/asModal props (+ SendPrefill / PaymentRequestPrefill
  types and the prefill effects) from SendModal/SendPaymentRequestModal: the
  Connect intents moved to their own confirm-only modals and no caller passes
  them. Manual send / payment-request flows are unaffected.
@MastaP MastaP merged commit 8ecd6ea into main Jun 19, 2026
7 checks passed
@MastaP MastaP deleted the chore/connect-cleanup-error-ux branch June 19, 2026 09:11
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.

2 participants