Abort signal is not handled
wzulfikar opened this issue · comments
Describe the bug
The docs say that we can pass abort signal as second argument but looks like it's not being handled.
https://the-guild.dev/openapi/fets/client/request-params#request-cancellation
- The
get
function doesn't actually accept second argument:
- The
requestInit
doesn't includesignal
that should have been passed as the second argument:
feTS/packages/fets/src/client/createClient.ts
Lines 107 to 110 in 2f1aab9
This means request cancellation doesn't actually work.
To Reproduce Steps to reproduce the behavior:
Something like:
const client = createClient<NormalizedOAS>({
endpoint: 'https://postman-echo.com',
});
// This should throw because of timeout, but it didn't because the signal wasn't handled
client['/get'].get(undefined, { signal: AbortSignal.timeout(0) }))
Expected behavior
The signal should be handled
Environment:
- OS:
package-name...
:- NodeJS:
Additional context
I created a draft PR (#709) to illustrate the point with a test.
Thank you!