Skip to main content

Resilience: hbf-console

Error handling and retry patterns for this service. Platform-wide patterns: docs/architecture/resilience.md

HTTP Retry

  • Library: Fetch API (browser) + XMLHttpRequest (uploads)
  • Attempts: 0 (no retry logic)
  • Backoff: None
  • On failure: Promise rejected with structured error (status, code, description, details, metadata)

Queue Retry

Not applicable. Frontend SPA, no queue consumers.

Timeouts

CallTimeoutConfigured in
Fetch API requestsNone (no explicit timeout)N/A
XMLHttpRequest uploadsNone (no explicit timeout)N/A

Circuit Breakers

None implemented.

Fallback Strategy

Failure scenarioBehaviourUser impact
401 UnauthorizedChecks refresh token expiry, clears storage, redirects to loginUser logged out and redirected to login page
Other HTTP errorsPromise rejected with structured error objectError displayed to user (depends on calling component)
Request cancellation neededFetch: AbortController; XHR: manual cancellationUser can cancel long-running uploads

Known Gaps

  • Zero HTTP retry logic on any API call. Transient network errors surface directly to the user
  • No timeout on Fetch or XHR requests. Long-running or hung requests block indefinitely
  • Token handling: Root.jsx implements proactive auto-refresh via setInterval(handleTokenRefresh, REFRESH_TOKEN_INTERVAL_MILLISECONDS) which calls isTokenAboutToExpire() and refreshes preemptively every 1 hour (3600000ms). On 401, it also checks refresh token expiry, clears storage, and redirects to login
  • No /health endpoint (expected for a frontend SPA)