adobe / adobe/node-fetch-retry

use AbortSignal.timeout() when available

Open
#80 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
44
Forks
16
PR merge metrics
No merged PRs in 30d

Description

This would give a nicer message than the current `The user aborted a request.` which is confusing when in fact it is a timeout:

```
AbortError failed with type: aborted; message: The user aborted a request.
Retrying in 129 milliseconds, attempt 1 error: AbortError, The user aborted a request.
```

MDN doc of AbortSignal.timeout(): https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout

WhatWG spec: https://dom.spec.whatwg.org/#interface-AbortSignal

Available in nodejs 16.14+: https://nodejs.org/dist/latest-v16.x/docs/api/globals.html#class-abortcontroller

Unfortunately the [abort-controller](https://www.npmjs.com/package/abort-controller) library we use doesn't support it yet, neither do the other AbortController libraries on npm that I found (at this time).

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing abort, timeout, and retry handling, then compare the available-runtime condition with the MDN AbortSignal.timeout() behavior. Done means supported Node.js versions use the timeout signal for clearer timeout errors, while the existing abort-controller fallback remains available where needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.