Skip to content

fix(website): start the UI demo's engine in Firefox - #414

Merged
kvlonge merged 1 commit into
mainfrom
fix/demo-firefox-engine-start
Nov 14, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/demo-firefox-engine-start

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Why

The UI demo's real engine hangs at "Starting ClickHouse…" in Firefox most of the time. chdb-wasm's worker hands Emscripten the downloaded wasm as bytes (wasmBinary), and Firefox never finishes starting it. Given a URL to stream instead, it starts in about a second. Separately, a build can leave an order twice in the engine, which broke the live panel's keyed list, and the cross-origin test failed when the page dropped a request it was refetching.

Changes

  • The website build patches the copied worker to stream the wasm from the blob URL (locateFile), fails if a chdb-wasm upgrade changes that code, and hashes the patched worker into the engine directory's name, since engine files are cached as immutable.
  • The live engine panel keys order rows by position, so duplicate rows display instead of throwing.
  • The cross-origin isolation test only rewrites the page document's headers.

Verification

  • Firefox 159 on macOS: a minimal page reproduces the hang with wasmBinary (4 of 4) and starts with the streamed URL (4 of 4, about 1.3 s). The rebuilt demo started 5 of 5 times, and a full click-through (every page, Plan, Execute, Promote, Roll back, recording fallback) ran with no console errors.
  • Website demo tests in Chrome: 10 of 10 (each test twice).
  • svelte-check and fensu are clean.

chdb-wasm's worker hands Emscripten the downloaded wasm as bytes, and Firefox
then never finishes starting the engine. The website build now has the worker
stream the same blob URL, which starts in about a second in Firefox and
Chrome, and names the engine directory after the patched worker too, since
the engine's files are cached for good. The build fails if a chdb-wasm
upgrade changes the code it replaces.

The live engine panel keys its order rows by position, so an order the
engine holds twice no longer breaks the list, and the cross-origin isolation
test only rewrites the page's own headers instead of refetching every
request.
@kvlonge
kvlonge enabled auto-merge (squash) November 14, 2026 12:28
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sqltide with  Cloudflare Pages  Cloudflare Pages

Latest commit: c5fe779
Status: ✅  Deploy successful!
Preview URL: https://50ebebcf.sqltide.pages.dev
Branch Preview URL: https://fix-demo-firefox-engine-star.sqltide.pages.dev

View logs

@kvlonge
kvlonge merged commit 372ccf2 into main Nov 14, 2026
12 checks passed
@kvlonge
kvlonge deleted the fix/demo-firefox-engine-start branch November 14, 2026 12:53
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.

1 participant