Repository navigation
fix(runner): mount the preview once when npm latest is ahead of the buckets (DEV-3344) - #419
Merged
Merged
Conversation
…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>
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.
Context
The o11y local integration workflow (
e2e-o11y-local.yml) has been red on master since 2026-10-07.telemetry-metrics.spec.ts:203gets twopreview.ready_mspoints instead of one, ando11y-local.spec.tsintermittently readsoutcome: "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 npmlatestonce/api/versionsanswers. The preview mount did not wait for that answer. Whenhandsontable@18.1.2was 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 oneabandonedpoint. The intermittento11y-localfailure is the same race: it passes when/api/versionsanswers before the starter artifact loads.This recurs after every npm release until the Monday
import-startersre-pin. The re-pin will turn master green on its own, but the bug returns with the next release.Fix:
versionPendinginApp.tsxnow also holds the mount while a visit that pinned nothing is still on theDEFAULT_VERSIONplaceholder and/api/versionshas 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/versionsis slow, an unpinned visit showsbootinguntil it answers (worst case one 5 s timeout), then mounts on the fallback.Types of changes
runner/) changeHow was this verified?
latestvaried: stubbing it to 18.1.1 madetelemetry-metricsTier-1 pass; the real 18.1.2 made it fail withExpected: 1, Received: 2.telemetry-faro.spec.ts(runs per PR inci.yml'se2e-telemetryjob). It holds/api/versionsuntil the starter has loaded, then asserts that noabandonedpreview.ready_mspoint is sent. It fails 3/3 on the previousApp.tsxand passes with the fix.e2e-o11y-local.ymldispatched on this branch and on master at the same time, while npmlatest(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-metricsstill 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.telemetry-metricsTier-1 + Tier-2 green;telemetry-faro+example-analytics30/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 typecheckclean.Checklist
runner/config/frameworks.json(see CONTRIBUTING.md); otherwise it won't appear on demos.handsontable.com (n/a: no example change)pnpm build(andpnpm dev) in the affected example/server-example locally (n/a: runner-only change; ranpnpm build+ the e2e suites inrunner/instead)Related issue(s):
Note
Medium Risk
Changes when the preview first mounts for unpinned visits and could briefly delay booting if
/api/versionsis slow; pinned URLs and saved demos are unaffected.Overview
Fixes DEV-3344: unpinned visits no longer boot Sandpack twice when npm
latestis ahead of the committed bucket default.versionPendinginApp.tsxnow stays true for bare visits still onDEFAULT_VERSIONuntil/api/versionsresolves, so the preview mount waits for the swap to npmlatest. Starter loading is unchanged and still runs in parallel; only the runtime mount is deferred (worst case:bootinguntil the versions fetch finishes).Adds a deterministic Playwright case in
telemetry-faro.spec.tsthat delays/api/versionsuntil the starter pins on the default, then checks there are nopreview.ready_msmeasurements withhot.outcome: "abandoned".Reviewed by Cursor Bugbot for commit 0ccadc2. Bugbot is set up for automated code reviews on this repo. Configure here.