Description
@hey-api/client-angular accepts signal through its request options because the client configuration extends RequestInit, but the signal is not connected to the HttpClient observable. As a result, aborting the signal does not cancel an in-flight Angular HTTP request, and an already-aborted signal still starts one.
This differs from the fetch client and makes generated Angular SDK requests impossible to cancel through the shared client API.
I intend to submit a pull request to fix this.
Expected behavior
- An already-aborted signal prevents
HttpClient.request() from starting.
- Aborting an in-flight request unsubscribes from the
HttpClient observable, allowing Angular to abort the underlying transport.
- The abort reason follows the existing error interceptor and
throwOnError behavior.
- Requests without a signal and requests completed before a later abort remain unchanged.
Actual behavior
The Angular client awaits the filtered HttpClient observable with firstValueFrom(), but never observes options.signal.
Reproducible example or configuration
const controller = new AbortController();
const request = client.get({
signal: controller.signal,
throwOnError: true,
url: '/slow-request',
});
controller.abort();
await request;
The underlying Angular HTTP request remains subscribed instead of being cancelled.
System information
@hey-api/openapi-ts: current main (0.99.0)
@hey-api/client-angular
- Angular
21.2.x
- RxJS
7.8.x
Description
@hey-api/client-angularacceptssignalthrough its request options because the client configuration extendsRequestInit, but the signal is not connected to theHttpClientobservable. As a result, aborting the signal does not cancel an in-flight Angular HTTP request, and an already-aborted signal still starts one.This differs from the fetch client and makes generated Angular SDK requests impossible to cancel through the shared client API.
I intend to submit a pull request to fix this.
Expected behavior
HttpClient.request()from starting.HttpClientobservable, allowing Angular to abort the underlying transport.throwOnErrorbehavior.Actual behavior
The Angular client awaits the filtered
HttpClientobservable withfirstValueFrom(), but never observesoptions.signal.Reproducible example or configuration
The underlying Angular HTTP request remains subscribed instead of being cancelled.
System information
@hey-api/openapi-ts: currentmain(0.99.0)@hey-api/client-angular21.2.x7.8.x