refactor(sell): sanitize user-facing error messages - #2384
refactor(sell): sanitize user-facing error messages#2384wired-pasteque wants to merge 15 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
conflict management required @wired-pasteque |
|
Conflict management required @wired-pasteque |
ec65540 to
d9f76d8
Compare
Wrap the throwing shared-core GetWalletUtxosUsecase in a sell-owned use-case returning Result<List<WalletUtxo>, SellFailure>.
Owns the pre-order estimation (rate, required amount, sufficient-balance rule, absolute fee) and maps every infra throw to a sealed SellFailure.
Recomputes the absolute payin fee on coin-selection / RBF changes, returning Result<int, SellFailure>.
Loads the exchange user summary and bitcoin unit for the amount-input screen, mapping infra throws to a sealed SellFailure.
Build+sign+broadcast the payin as a single boundary. Derives the txid before broadcast and treats labelling as a best-effort post-broadcast side-effect, so a bookkeeping failure never demotes a completed payin to a SellSendPaymentFailure (no double-spend retry). The raw exception is never forwarded to logs or failure state (type + trace only). Txid derivation is injectable so the money path is unit-testable.
Fetches the latest sell order while polling, mapping both an infra throw and an unexpected order type to a sealed SellFailure.
Move create/refresh use-cases into domain/usecases/ and rewire SellBloc to switch on Ok/Err from the eight sell use-cases instead of running its own try/catch. The presentation layer now holds zero try/catch; the data boundary is the use-case, as the convention requires. This activates two behaviour fixes carried by the new use-cases: - payin is treated as succeeded once broadcast succeeds (labelling failure no longer reported as a payment failure); - order-polling failures surface to the user instead of being swallowed.
The key was added to 23 locales when the sell send-payment failure was introduced; complete the remaining four so every language is translated.
Replace a hardcoded 'Loading...' with the existing sellLoadingGeneric key, and rename the private _SellError error-card widget to _SellErrorCard to avoid confusion with the SellFailure family.
This comment was marked as outdated.
This comment was marked as outdated.
|
@claude, check the fixes |
|
Claude finished @wired-pasteque's task in 5m 33s —— View job Review of the #1895 fixes ✅
VerdictThe fixes hold up. The core goal of #1895 — no raw exception text ever reaching the UI — is now enforced structurally: every sell error crosses the domain boundary as a sealed The latest fix commits, checked individually
Improvements worth calling out
Minor observations (non-blocking, mostly pre-existing)
CI ( --- · Branch |
a78be2f to
0c13fd4
Compare
No description provided.