sdk-codegen icon indicating copy to clipboard operation
sdk-codegen copied to clipboard

Bug: timeout option in SDK requests ignored in embedded extensions due to invokeCoreSdk implementation

Open ariel66degrees opened this issue 10 months ago • 1 comments

Summary: When using the modern @looker/extension-sdk-react with ExtensionContext40, SDK calls that include options.timeout are routed through legacy host code (invokeCoreSdk) in embedded contexts, and the timeout is silently dropped.

Environment:

  • SDK: @looker/extension-sdk-react using ExtensionContext40
  • Embedding mode: hostType: "embed" (legacy /embed/extensions/...)
  • Looker version: [insert your version]
  • Code pattern used:
await core40SDK.run_sql_query(slug, 'json', undefined, { timeout: 300 })

Expected behavior: Looker should honor the timeout provided in the fourth options parameter of the SDK call, per the SDK documentation. This works correctly in non-embedded (standard) contexts.

Observed behavior: In extension app mode, the request is routed through a legacy handler like this:

async invokeCoreSdk(e, t) {
  const { body: o, params: s, path: n, httpMethod: r, apiVersion: i, options: a } = e;

  if (n && r) {
    const e = await D(r, n, this.cleanQueryParams(s), o, i, {
      "x-looker-appid": this.generateLookerAppId(a)
    });
    // NOTE: `options` (a) is not passed through here
    ...
  }
}

The options object — containing the timeout value — is destructured but never forwarded, meaning all calls fall back to the default timeout (e.g. 10s or whatever is set in the host).

Impact:

  • options.timeout has no effect in embedded mode.
  • Long-running queries cannot be properly controlled or canceled.
  • Developers are misled into thinking the timeout is respected when it silently isn’t.

ariel66degrees avatar Jun 12 '25 16:06 ariel66degrees

See this comment for the fix with chattyTimeout property on the ExtensionProvider

bwebs avatar Jun 12 '25 22:06 bwebs

The chattyTimeout is no longer working @bwebs . I'm encountering the same issue as @ariel66degrees . My extension has used the chattyTimeout fix for a while, but recently the Looker API seems to be overriding this and failing with a timeout error after 2 minutes. Setting a timeout directly in the run_inline_query call is being ignored as well.

Can someone please look into this?

ScottThePott avatar Jul 17 '25 16:07 ScottThePott

@ScottThePott was able to reproduce this on Looker 25.10.21 and 25.10.30. It appears to be working in our staging environments; will confirm if this is fixed in 25.12 this week.

bwebs avatar Jul 21 '25 06:07 bwebs

Thank you!

ScottThePott avatar Jul 22 '25 05:07 ScottThePott

@ScottThePott We backported the fix to version 25.10.31. Please contact your Looker team to get the upgrade scheduled during one of your maintenance windows.

bwebs avatar Jul 23 '25 18:07 bwebs

Awesome thanks so much

ScottThePott avatar Jul 31 '25 16:07 ScottThePott