-
Notifications
You must be signed in to change notification settings - Fork 199
fix(BaseTransport) Fix handling of AbortSignal availability detection in selected transport #1582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,7 @@ export abstract class BaseTransport implements ITransport { | |
let signaller; | ||
if (AbortSignal.timeout) { | ||
const ms = sdkTimeout(options) * 1000; | ||
let signaller = AbortSignal.timeout(ms); | ||
signaller = AbortSignal.timeout(ms); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed double let declaration, since it's block scoped, and would cause a new blocked scoped variable, which shadowed the top level |
||
if ('signal' in options && options.signal) { | ||
// AbortSignal.any may not be available, tolerate its absence | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
|
@@ -189,11 +189,11 @@ export abstract class BaseTransport implements ITransport { | |
); | ||
console.debug({ AbortSignal }); | ||
} | ||
} else { | ||
console.debug( | ||
'AbortSignal.timeout is not defined. Timeout will use default behavior' | ||
); | ||
} | ||
} else { | ||
console.debug( | ||
'AbortSignal.timeout is not defined. Timeout will use default behavior' | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This log was being generated even if AbortSignal.timeout was available in the runtime, since it was attached to the wrong condition (options.signal) |
||
} | ||
|
||
let props: IRequestProps = { | ||
|
Uh oh!
There was an error while loading. Please reload this page.