Skip to content

Centralize and retry handle session aware fetches in client#500

Open
ekwe7 wants to merge 4 commits into
Remitwise-Org:mainfrom
ekwe7:Centralize-and-retry-handle-session-aware-fetches-in-client
Open

Centralize and retry handle session aware fetches in client#500
ekwe7 wants to merge 4 commits into
Remitwise-Org:mainfrom
ekwe7:Centralize-and-retry-handle-session-aware-fetches-in-client

Conversation

@ekwe7

@ekwe7 ekwe7 commented Jun 18, 2026

Copy link
Copy Markdown

closes #484

Description:
This PR enhances API request resilience by centralizing retry logic in
lib/client/apiClient.ts.

Changes:

  • Retry Mechanism: Introduced fetchWithRetry to apiClient.ts to
    automatically retry requests on 5xx server errors, 429 rate limiting,
    and network failures.
  • Exponential Backoff: Implemented exponential backoff for retries to
    prevent overwhelming the server.
  • Configurability: Added retries and backoff options to
    ApiClientOptions, allowing granular control per request.
  • Testing: Added tests/unit/apiClient.test.ts to ensure retry logic
    functions correctly and does not interfere with the existing
    session-expiry handling flow.
    Verification:
  • All tests in tests/unit/apiClient.test.ts passed successfully.
  • Verified that session-expiry (401) is still handled immediately
    without retries.

ekwe7 added 4 commits June 18, 2026 00:11
Implements the Add/Edit Savings Goal flow by lifting goalsData into
 component state and providing a fully accessible modal form.

 Key changes:
 - Integrated lib/validation/savings-goals for real-time form validation.
 - Externalized all strings and error messages to en.json for full i18n
      support.
 - Implemented modal accessibility (focus trap, ESC to close, and
      motion-reduce).
- Recomputed daysLeft and isOverdue dynamically from the target date.
 - Added 100% test coverage for goals utilities and validation logic.
 - Improved UI robustness with line-clamping for long titles and descriptions
… reflection

Cleans up unrelated syntax errors, missing imports, and type issues in app/ and components/ to ensure a green CI build for the savings goals feature.
  Adds set/edit limit control and a spent-vs-limit progress bar with
  near/over-limit warning states. Includes validation logic for
  spending limits and improves accessibility of the utilization
  display.
  apiClient

  Enhance API request resilience by centralizing retry logic in
  lib/client/apiClient.ts. Added support for retries on 5xx server errors,
  429 rate limiting, and network failures using configurable exponential
  backoff. Included comprehensive unit tests to verify the retry behavior
  and ensure session expiry handling remains correctly sequenced.
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.

Centralize and retry-handle session-aware fetches in lib/client/apiClient.ts (401 -> refresh -> retry)

1 participant