Skip to content

Conversation

@ritwikshanker
Copy link
Collaborator

@ritwikshanker ritwikshanker commented Nov 26, 2025

This pull request introduces a standardized fetch timeout mechanism across multiple API calls to improve reliability and user experience when backend services are slow or unresponsive. The main change is the addition of a reusable fetchWithTimeout utility, which is now used in several API helper functions to enforce a default timeout (typically 1 minute), with the option to override as needed.

API Timeout Handling Improvements:

  • Added a new fetchWithTimeout function in utils.ts that wraps fetch requests with an abortable timeout, throwing a user-friendly error if the request takes too long.
  • Updated searchWithBackend in api.ts to use fetchWithTimeout with a configurable timeout parameter (default 1 minute). [1] [2] [3]
  • Modified fetchFilesFromMetrix, submitMetadataToDispatcher, and checkTaskStatus in dispatcherApi.ts to use fetchWithTimeout, each now accepting an optional timeoutMs parameter and defaulting to 1 minute. [1] [2] [3] [4]

These changes make the application's network requests more robust, preventing indefinite hangs and providing clearer error messages to users when backend services are slow or unavailable.

@ritwikshanker ritwikshanker self-assigned this Nov 26, 2025
@ritwikshanker ritwikshanker added the Release PR's which release a new version label Nov 26, 2025
@ritwikshanker ritwikshanker merged commit 39ac69a into main Nov 26, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release PR's which release a new version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants