Skip to content

fix(runner): mount the preview once when npm latest is ahead of the buckets (DEV-3344) - #419

Merged
demtario merged 1 commit into
masterfrom
fix/DEV-3344-preview-single-mount
Oct 7, 2026
Merged

demtario merged 1 commit into
masterfrom
fix/DEV-3344-preview-single-mount

Conversation

@demtario

@demtario demtario commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Context

The o11y local integration workflow (e2e-o11y-local.yml) has been red on master since 2026-10-07. telemetry-metrics.spec.ts:203 gets two preview.ready_ms points instead of one, and o11y-local.spec.ts intermittently reads outcome: "abandoned".

No commit caused it: between the last green run and the first red one, the only change was docs-example JSON. A visit with no version in the URL starts on DEFAULT_VERSION, the newest committed bucket pin (18.1.1), and switches to npm latest once /api/versions answers. The preview mount did not wait for that answer. When handsontable@18.1.2 was published ahead of the weekly bucket re-pin, every such visit booted the preview on 18.1.1, tore it down, and booted it again on 18.1.2. That cost two Sandpack boots (or two container sessions on Tier-2) and sent one abandoned point. The intermittent o11y-local failure is the same race: it passes when /api/versions answers before the starter artifact loads.

This recurs after every npm release until the Monday import-starters re-pin. The re-pin will turn master green on its own, but the bug returns with the next release.

Fix: versionPending in App.tsx now also holds the mount while a visit that pinned nothing is still on the DEFAULT_VERSION placeholder and /api/versions has not answered. Only the mount waits; the starter artifact still loads in parallel. Saved demos, ?v= links and docs routes are unchanged. Trade-off: if /api/versions is slow, an unpinned visit shows booting until it answers (worst case one 5 s timeout), then mounts on the fallback.

Types of changes

  • New example
  • Update to an existing example
  • README / documentation change
  • Demo runner (runner/) change
  • CI / tooling change

How was this verified?

  • Cause, A/B on one local build with only latest varied: stubbing it to 18.1.1 made telemetry-metrics Tier-1 pass; the real 18.1.2 made it fail with Expected: 1, Received: 2.
  • New deterministic test in telemetry-faro.spec.ts (runs per PR in ci.yml's e2e-telemetry job). It holds /api/versions until the starter has loaded, then asserts that no abandoned preview.ready_ms point is sent. It fails 3/3 on the previous App.tsx and passes with the fix.
  • e2e-o11y-local.yml dispatched on this branch and on master at the same time, while npm latest (18.1.2) still differed from the bucket pin (18.1.1). Branch: both jobs green, 2/2 tests each, no retries (run 37639930705). Master: telemetry-metrics still red with 1 vs 2 points (run 37639936182). That workflow's path filter does not match this diff, so it will not run on the PR by itself.
  • Locally: live telemetry-metrics Tier-1 + Tier-2 green; telemetry-faro + example-analytics 30/30; full deterministic suite 247 passed, 0 failed, 1 flaky. The flaky test, style-panel.spec.ts:317 (file-tree row after reload, not the preview mount), passed 15/15 when run on its own. pnpm typecheck clean.

Checklist

  • New/renamed example: added to runner/config/frameworks.json (see CONTRIBUTING.md); otherwise it won't appear on demos.handsontable.com (n/a: no example change)
  • New example: added a row to the tables in README.md (n/a)
  • Ran pnpm build (and pnpm dev) in the affected example/server-example locally (n/a: runner-only change; ran pnpm build + the e2e suites in runner/ instead)

Related issue(s):

  1. DEV-3344

Note

Medium Risk
Changes when the preview first mounts for unpinned visits and could briefly delay booting if /api/versions is slow; pinned URLs and saved demos are unaffected.

Overview
Fixes DEV-3344: unpinned visits no longer boot Sandpack twice when npm latest is ahead of the committed bucket default.

versionPending in App.tsx now stays true for bare visits still on DEFAULT_VERSION until /api/versions resolves, so the preview mount waits for the swap to npm latest. Starter loading is unchanged and still runs in parallel; only the runtime mount is deferred (worst case: booting until the versions fetch finishes).

Adds a deterministic Playwright case in telemetry-faro.spec.ts that delays /api/versions until the starter pins on the default, then checks there are no preview.ready_ms measurements with hot.outcome: "abandoned".

Reviewed by Cursor Bugbot for commit 0ccadc2. Bugbot is set up for automated code reviews on this repo. Configure here.

…uckets (DEV-3344)

A bare visit starts on DEFAULT_VERSION (the newest committed bucket pin)
and swaps in npm `latest` when /api/versions answers. The mount effect did
not wait for that answer, so once handsontable 18.1.2 was published ahead
of the weekly bucket re-pin (18.1.1), every unpinned visit booted the
preview on 18.1.1, tore it down, and booted again on 18.1.2: two Sandpack
boots (or two container sessions) and an `abandoned` preview.ready_ms.
That is what turned the o11y e2e workflow red on master.

Hold the mount, not the starter fetch, until the version is known for a
visit that pinned nothing. The deterministic regression test holds the
versions response until the starter has loaded and asserts no
`abandoned` point; it fails on the previous code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@demtario demtario self-assigned this Oct 7, 2026
@demtario
demtario merged commit 2e6a3e1 into master Oct 7, 2026
10 checks passed
@demtario
demtario deleted the fix/DEV-3344-preview-single-mount branch October 7, 2026 15:23
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