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
| Call | Timeout | Configured in |
|---|---|---|
| Fetch API requests | None (no explicit timeout) | N/A |
| XMLHttpRequest uploads | None (no explicit timeout) | N/A |
Circuit Breakers
None implemented.
Fallback Strategy
| Failure scenario | Behaviour | User impact |
|---|---|---|
| 401 Unauthorized | Checks refresh token expiry, clears storage, redirects to login | User logged out and redirected to login page |
| Other HTTP errors | Promise rejected with structured error object | Error displayed to user (depends on calling component) |
| Request cancellation needed | Fetch: AbortController; XHR: manual cancellation | User 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 callsisTokenAboutToExpire()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)