Skip to content

No Timeout or Retry Logic in Axios HTTP Client Configuration #1599

@mohi-devhub

Description

@mohi-devhub

Description

The application lacks proper timeout configuration and retry logic for Axios HTTP requests, leading to potential hanging requests, poor error handling, and inconsistent user experience when dealing with network failures or slow API responses.

Current Behavior

  • API calls can hang indefinitely if external services are slow or unresponsive
  • No retry mechanism for transient network failures (503, timeout errors, connection resets)
  • Inconsistent error handling across the application:
    • Some endpoints return { success: false }
    • Others throw errors directly
    • No standardized error response format
  • No timeout configuration for any Axios instance
  • Users experience different error behaviors depending on which part of the app they're using

Expected Behavior

  • All HTTP requests should have reasonable timeout limits (10-30 seconds)
  • Transient failures should automatically retry (exponential backoff, 3 attempts recommended)
  • Consistent error response format across all API endpoints
  • Loading states should timeout appropriately with user-friendly error messages
  • External API calls should implement circuit breaker pattern to prevent cascading failures

Affected Files

Controllers:

  • EmailController.js:17

Vue Components:

  • FacialSentimentPanel.vue:221
  • GeneralAnalytics.vue:672
  • 15+ other files with direct axios usage

Steps to Reproduce

  1. Make an API call to a slow or unresponsive endpoint
  2. Observe that the request hangs indefinitely with no timeout
  3. Trigger a transient network error (503, temporary DNS failure)
  4. Notice that the request fails immediately without retry
  5. Compare error responses from different endpoints
  6. Observe inconsistent error formats and handling

Why This Matters

User Impact:

  • Poor user experience when network is slow or unstable
  • Users don't know if the app is processing or stuck
  • Inconsistent error messages cause confusion

Technical Impact:

  • Resource leaks from hanging connections
  • Difficult to debug network-related issues
  • No resilience against temporary service outages
  • Scalability issues under load

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions