fix(connect): reject intent on send failure, human-readable errors, drop dead prefill#384
Merged
Merged
Conversation
…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.
10 tasks
MastaP
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-ups on the Connect intent work (part of #609), after
send/payment_requestmoved to base-units confirm-only modals.1. Reject the intent on send failure
SendIntentModal/PaymentRequestIntentModalpreviously showed the error in-modal and left the dApp's intent pending — the dApp'sintent()never settled and sat on "Sending…". They now reject on failure:send→TRANSFER_FAILEDpayment_request→INTERNAL_ERRORThe 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.getErrorMessagenow 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/asModalThe Connect
send/payment_requestintents now use their own confirm-only modals, so nothing passesprefill/asModaltoSendModal/SendPaymentRequestModalanymore. Removed the props, theSendPrefill/PaymentRequestPrefilltypes, the prefill effects, and the now-unused imports. Manual send / payment-request flows are unaffected.Verification
tsc --noEmit→ clean (exit 0)eslinton changed files → clean (exit 0)