Skip to content

Add retry logic with exponential backoff for failed API calls #191

Description

@Akatenvictor

What

Implement automatic retry with exponential backoff for transient API failures (network errors, 503, 429) across all service calls.

Why

Transient failures (network blips, server overload) are common but temporary. Without retry logic, users see immediate errors and must manually retry. Automatic retry with backoff handles most transient issues transparently.

Scope

In scope:

  • Create a retry utility with configurable max retries and backoff
  • Apply to all API calls in service files
  • Retry on: network errors, 429 (rate limit), 503 (service unavailable)
  • Do NOT retry on: 400, 401, 403, 404 (client errors)
  • Show toast notification when retrying

Out of scope:

  • Retry for file uploads
  • Circuit breaker pattern
  • Retry queue for offline scenarios

Acceptance Criteria

  • Retry utility exists in app/src/utils/
  • Transient failures are retried automatically (up to 3 times)
  • Exponential backoff is implemented (1s, 2s, 4s)
  • Client errors are NOT retried
  • User sees notification when retrying
  • Non-retryable errors fail immediately

Technical Context

  • Service files in app/src/services/
  • Utility in app/src/utils/retry.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions