Skip to content

fix(core): let evidence.query wait for slow queries in sandboxed blocks - #3370

Open
mosco98 wants to merge 1 commit into
evidence-dev:mainfrom
mosco98:fix/html-query-timeout
Open

mosco98 wants to merge 1 commit into
evidence-dev:mainfrom
mosco98:fix/html-query-timeout

Conversation

@mosco98

@mosco98 mosco98 commented Nov 5, 2026

Copy link
Copy Markdown

Fixes #3367

Problem

evidence.query(name) in an {% html %} block fails with sandbox request "query" timed out after 10000ms when the query takes longer than 10 seconds. Native components reading the same query keep waiting and paint when the response arrives.

As the issue suspected, the SDK calls host.request without a timeout, so queries inherit the sandbox RPC's default. That default is the old capture-png ceiling, and it's the only limit on query duration here: the 4s in wait-for-query.ts only covers finding the query by name.

Fix

  • SandboxRpc.request accepts timeoutMs: null, which sets no timer. Other requests keep the 10s default.
  • evidence.query passes it in evidence-sdk.ts.
  • map-evidence-sdk.ts gets the same change, as custom_map makes the same call.

Pending requests aren't left behind when a block goes away, because dispose() still rejects them.

Behaviour change

If a query never gets a response, the block now keeps waiting rather than showing an error after 10s. It shows no loading state during that time, which is what #3362 covers.

Testing

Chromium with a throwaway project containing an inline {% html %} block, with POST /api/query mocked to respond after 12s:

About 10s after the block appears Final result
Before sandbox request "query" timed out after 10000ms Stays on the error
After Still waiting Rows render at about 12s
  • pnpm test passes, including 2 new tests in request-response.test.ts: null waits past the default, and dispose() rejects a request with no timeout.
  • custom_map is covered by a unit test on the request options only. Neither it nor custom components were checked in a browser.
  • Query responses were mocked, so this hasn't run against a real slow warehouse.
  • pnpm check: core is clean. cli reports one error locally, a missing generated file (./docs-bundle.generated) imported by src/lib/docs/index.ts, which this PR doesn't touch.
  • Prettier didn't run locally: its config points at cli/src/routes/layout.css, which doesn't exist here.

@vercel

vercel Bot commented Nov 5, 2026

Copy link
Copy Markdown

@mosco98 is attempting to deploy a commit to the Evidence Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

evidence.query in {% html %} blocks and custom components times out after 10 s, native components do not

1 participant