Skip to content

feat(engine): a failed CDN script's report names its library and version, never its URL - #7394

Merged
miguel-heygen merged 1 commit into
mainfrom
dexportfix/script-lib
Nov 8, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
dexportfix/script-lib

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

When a script from a public CDN fails to load during a render, the failure's warning now also names the library and exact version, as [script_lib: [email protected]], never the URL. Today it says only [script_load: cdn/net::ERR_INTERNET_DISCONNECTED], so a report cannot say which library broke.

Why

Desktop reports about 20 CDN script failures in five days (offline, DNS) without knowing whether they are GSAP or something else. Which libraries fail decides whether shipping more GSAP versions in the packages is worth their size. The engine has the URL where it classifies the failure; the report must not carry it.

Related work

None found: git grep -n "script_lib\|cdnLib" packages had no match.

How

  • classifyScriptLoadCause adds lib for an unscoped package at one exact version on jsDelivr (/npm/[email protected]/), unpkg (/[email protected]/) or cdnjs (/ajax/libs/name/x.y.z/); a range (gsap@3), a scoped package, another host or an odd path gives none. The name is [a-z0-9][a-z0-9._-]{0,48} and the version x.y.z, so nothing free-form reaches a report.
  • The warning keeps [script_load: origin/code, ...] exactly as readers parse it today and adds [script_lib: [email protected], [email protected]] after it, so no reader of the first bracket changes.

Size

A lone change nothing else can carry: it touches one function and its test file in the engine, and the question it answers (which library fails) has to be answerable before the other open PR (which ships GSAP differently) can be sized.

Test plan

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at f2944855: I found no blocker.

  • The test fails without the fix. On main's frameCapture.ts with this PR's tests, 4 of 16 fail: the three CDN names the library… cases and names the failed libraries in a bracket of their own…. That includes the test named on the fails without the fix: line. With the fix, all 16 pass. Typecheck and oxlint on the two files are clean.
  • No URL leaks into a report. lib is set only when origin === "cdn", and only from a fixed host→path table. The output is limited to [a-z0-9][a-z0-9._-]{0,48}@\d+.\d+.\d+. Ranges, scoped packages, prereleases, other hosts and .. paths give no lib. A .. path is safe because URL normalises the path before matching, so the result is whatever the browser actually requested.
  • The existing bracket is unchanged. [script_load: …] reads exactly as before, and [script_lib: …] comes after it, deduped across the same first four causes. Nothing else in this repo parses script_load. Readers outside this repo (Desktop) were not checked.

Nit, not blocking: an exact-version prerelease such as [email protected] reports no library. That is the conservative choice, so it is fine as is.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 124 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving at 4452602e.

I compared the trees of the approved head f2944855 and this head. The only difference is the one-line doc comment on scriptLoadCauseSuffix in frameCapture.ts, which was reworded. No code or tests changed. The fails without the fix: line is still in the body. The rest of my review at f2944855 still applies.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit adf14d7 Nov 8, 2026
98 of 100 checks passed
@miguel-heygen
miguel-heygen deleted the dexportfix/script-lib branch November 8, 2026 03:24
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 9, 2026
Port the adopted upstream fixes from f5bde95 to the current upstream tip:
heygen-com#7375 multipart cloud upload, heygen-com#7382 minParallelChunks, heygen-com#7349 HLG header SEI,
heygen-com#7369 skip unmounted compositions in lint/check, heygen-com#7381 filesystem-path media
in the cloud archive, heygen-com#7383 Safari cut-point pre-roll revert, heygen-com#7373 clock
steering between audio time updates, heygen-com#7384 injector test isolation, heygen-com#7378
preview seek retention, heygen-com#7390 virtual timer schedule per worker, heygen-com#7394 CDN
script failure naming, heygen-com#7395 menu row radius, heygen-com#7119 decode timeout caller
test, heygen-com#7397 authored tween order, heygen-com#7402 capture page clip loading, heygen-com#7412 muted
video audio track at cuts, heygen-com#6150 template root variable test, heygen-com#7442 held tail
seek once.

Deliberate local differences: heygen-com#7067's audio-start hold is not carried into
clock.ts, mountedSources comes from heygen-com#6827 as a helper only, cloud/_gen/types.ts
omits the image-request types the fork does not generate, and the lint
symlink test skips through symlinkOrSkip where the account cannot create links.

Co-Authored-By: Claude Sonnet <[email protected]>
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