Conversation
…"not defined" message `BaseTransport.initRequest` shadowed its own `signaller` variable, so the `AbortSignal` it built never reached the request: no timeout and no caller cancel signal ever applied. The "AbortSignal.timeout is not defined" debug message also sat in the wrong branch and printed on every request where `AbortSignal.timeout` *was* defined and no caller signal was passed, which is the normal case on Node 17+. - assign the outer `signaller` instead of redeclaring it - move the "not defined" message to the branch where it is true - in that fallback, still pass a caller-supplied signal through - add baseTransport.spec.ts covering both paths Supersedes looker-open-source#1582 (same fix, blocked on CLA, no tests). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
BaseTransport.initRequestbuilds anAbortSignalfor every request, but two bugs in the same block mean it never reachesfetchand it logs a misleading message on every call:let signaller = AbortSignal.timeout(ms)declares a new variable instead of assigning the outer one, so the outersignallerstaysundefinedandprops.signalis alwaysundefined. In practice, no request carries a timeout or a caller cancel signal. Theeslint-disable-next-line @typescript-eslint/no-unused-varscomment next to it was silencing the linter that had caught this.console.debug('AbortSignal.timeout is not defined...')sits in theelseofif (options.signal), insideif (AbortSignal.timeout). So it prints exactly whenAbortSignal.timeoutis defined and the caller passed no signal, which is the normal case for every SDK call on Node 17+. On a server that ships JSON logs this is one unparseable plain-text line per Looker request.Changes
signallerinstead of shadowing it, so the timeout (and any composed caller signal) reaches the request.AbortSignal.timeoutreally is missing.signalthrough rather than dropping it.baseTransport.spec.tscovering: default timeout attached, timeout aborts, caller signal composed with timeout, and the no-AbortSignal.timeoutfallback (message logged, caller signal honored).Relationship to #1582
#1582 by @p3drosola fixes the same two bugs and has been mergeable since May 2025, but it is blocked on the CLA check and has no tests. This PR supersedes it with a signed CLA and regression coverage; credit for the diagnosis goes to that PR. Happy to close this one if #1582 can move forward instead.
Behavior note for reviewers
Because the signal was previously dropped, merging this means the documented 120 s default timeout (
defaultTimeoutintransport.ts) starts applying for real. That is the intended behavior per the existing code and docs, but it is a change consumers will observe on long-running calls.Developer Checklist