Skip to content

[Frontend] Transaction state machine + error-code surfacing in the UI #44

Description

@Gbangbolaoluwagbemiga

Problem

When a Soroban transaction fails or stalls, the UI gives little feedback and doesn't surface the
contract's typed error. Users don't know whether to retry, wait, or that they're unauthorized.

What needs to be done

  • Map every SecureFlowError code (see storage_types.rs / [Contract] Use the typed SecureFlowError enum everywhere #26) to a human-readable message +
    suggested action, in one place
  • A transaction state machine (idle → building → signing → pending → success / failed) surfaced
    via toasts/inline status, with retry on transient RPC failures
  • React error boundaries so a render error in one panel doesn't blank the app
  • Handle the "stuck/pending" case (timeout → check status → allow safe retry without double-spend)

Acceptance criteria

  • A reverted tx shows the specific reason (e.g. "Not authorized", "Milestone already approved")
  • Transient failures are retryable; the app never silently hangs on a spinner
  • An error in one component doesn't crash the whole page

Relevant files

src/contexts/, src/lib/ (contract service), src/components/ (milestone-actions, approval panel)

Depends conceptually on #26 (typed errors) for the code→message mapping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSfrontendReact/Vite appqualityCode quality & correctness cleanups

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions