Skip to content

fix(frontend): normalize API and wallet errors safely - #290

Open
isaacsamual994-lang wants to merge 9 commits into
RemitFlow:mainfrom
isaacsamual994-lang:fix/283-normalize-errors
Open

fix(frontend): normalize API and wallet errors safely#290
isaacsamual994-lang wants to merge 9 commits into
RemitFlow:mainfrom
isaacsamual994-lang:fix/283-normalize-errors

Conversation

@isaacsamual994-lang

Copy link
Copy Markdown

Description

Normalizes API and wallet failures into a small safe error shape so raw provider responses, server details, wallet addresses, and token-like values are not surfaced to users. The normalized policy also carries explicit retryability and a validated correlation/request identifier for protected diagnostics.

Motivation

Issue #283 calls out two related problems: provider/server details can leak sensitive account data into user-facing errors, and callers can make unsafe retry decisions when failures are not classified consistently.

Changes Made

  • Add a centralized error normalizer with stable safe codes, retryability, safe user messages, and validated correlation IDs.
  • Keep raw provider messages/payloads out of the normalized/user-facing shape by default.
  • Distinguish wallet rejection/cancellation from retryable timeout, rate-limit, network, and 5xx failures.
  • Use the safe policy in wallet connection, transfer loading, and send-money submission paths.
  • Withhold the existing transfer retry action while a non-retryable error is displayed; keep it available for retryable failures.
  • Add regression coverage for malformed errors, sensitive-value redaction, wallet rejection, timeout/rate-limit/5xx classification, correlation handling, submit failures, and retry policy.

Testing

  • 24 Vitest files / 135 tests passed locally using the repository's integration/unit/Lighthouse-config test paths with thread workers (the default fork pool is blocked by the Charlotte sandbox's process permissions).
  • npm run build passed.
  • git diff --check passed.
  • ESLint passes on the files changed by this PR. The repository-wide lint command currently reports 9 pre-existing errors in files untouched by this change.
  • No visual/layout changes, so screenshots and a Lighthouse UI rerun are not applicable here.

Screenshots (if applicable)

Not applicable; this changes error handling/messages and retry policy without layout or styling changes.

Checklist

  • Tests pass locally
  • Code follows style guidelines for the changed files
  • Documentation update not required
  • No breaking changes
  • Lighthouse UI check not applicable (no layout/style changes)

Closes #283

@isaacsamual994-lang isaacsamual994-lang changed the title Fix/283 normalize errors fix(frontend): normalize API and wallet errors safely Aug 22, 2026
@isaacsamual994-lang

Copy link
Copy Markdown
Author

@arisu6804 #283 is implemented and ready for review in this PR. The branch is conflict-free and the local test/build validation is included above. GitHub is currently showing two workflows awaiting maintainer approval; when you have a chance, could you please approve those runs and review the change? Thanks!

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.

security(frontend): normalize API and wallet errors without leaking sensitive data

1 participant