Context
The inline PR review comment for AbortSignal support (added in the current review) uses the DOM AbortSignal type. Azure SDK TypeScript guidelines specify AbortSignalLike from @azure/abort-controller for broader compatibility.
Issue
// Current inline comment suggestion (DOM type — narrower)
abortSignal?: AbortSignal
// Azure SDK guideline (interface — broader, works with polyfills)
import { AbortSignalLike } from "@azure/abort-controller";
abortSignal?: AbortSignalLike
AbortSignalLike is a subset interface: { readonly aborted: boolean; addEventListener(...): void; removeEventListener(...): void }. Using it instead of the concrete DOM AbortSignal type:
- Works in environments where the DOM
AbortSignal type is not available
- Allows passing custom abort signal implementations
- Aligns with how
@azure/core-rest-pipeline and all other Azure SDK packages accept cancellation
Proposed change
- Add
@azure/abort-controller as a dependency (or use @azure/core-rest-pipeline which re-exports AbortSignalLike)
- Use
AbortSignalLike as the parameter type in ConnectorHttpClient.sendAsync() and all generated method signatures
- The internal
AbortController handling in sendWithRetry() stays the same — AbortController.signal implements AbortSignalLike
This is a non-breaking change (widening the accepted type is backward-compatible). Best implemented together with the AbortSignal parameter addition from PR #26 review feedback.
Azure SDK guideline
Cancellation: use AbortSignalLike
Context
The inline PR review comment for
AbortSignalsupport (added in the current review) uses the DOMAbortSignaltype. Azure SDK TypeScript guidelines specifyAbortSignalLikefrom@azure/abort-controllerfor broader compatibility.Issue
AbortSignalLikeis a subset interface:{ readonly aborted: boolean; addEventListener(...): void; removeEventListener(...): void }. Using it instead of the concrete DOMAbortSignaltype:AbortSignaltype is not available@azure/core-rest-pipelineand all other Azure SDK packages accept cancellationProposed change
@azure/abort-controlleras a dependency (or use@azure/core-rest-pipelinewhich re-exportsAbortSignalLike)AbortSignalLikeas the parameter type inConnectorHttpClient.sendAsync()and all generated method signaturesAbortControllerhandling insendWithRetry()stays the same —AbortController.signalimplementsAbortSignalLikeThis is a non-breaking change (widening the accepted type is backward-compatible). Best implemented together with the
AbortSignalparameter addition from PR #26 review feedback.Azure SDK guideline
Cancellation: use
AbortSignalLike