Skip to content

fix(engine): fail closed on blocked SRI scripts - #3664

Merged
miga-heygen merged 1 commit into
mainfrom
magi/fix-stale-gsap-sri-classification
Sep 4, 2026
Merged

fix(engine): fail closed on blocked SRI scripts#3664
miga-heygen merged 1 commit into
mainfrom
magi/fix-stale-gsap-sri-classification

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Best-effort renders now fail closed when Chromium blocks a load-bearing script because its Subresource Integrity digest is stale. The failure reaches the existing sub_timeline_script_failure policy instead of degrading to static scenes under a non-fatal readiness timeout.

Why

Chromium returns HTTP 200 for the script and emits the SRI rejection only as a generic console error. The engine previously monitored request failures, HTTP failures, and HyperFrames-prefixed runtime errors, so this browser diagnostic was invisible even though the script never executed.

How

One console script-failure classifier now recognizes both existing composition runtime errors and Chromium’s exact blocked-integrity diagnostic. The classifier records a redacted stable failure ID through the existing deduplicated script-failure path. Authored integrity values and localized script bytes remain untouched.

Test plan

  • Exact Chromium stale-SRI console diagnostic is classified as a script failure.
  • Non-error and unrelated integrity messages remain ignored.
  • Existing sub-timeline poll returns the fail-fast script-failure outcome.
  • Frame-capture and sub-timeline suites pass (32/32).
  • Engine typecheck, oxlint, and oxfmt checks pass.
  • Documentation updated (not applicable).

@miga-heygen miga-heygen 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.

Clean, narrow classifier extraction. classifyConsoleScriptFailure preserves the existing HyperFrames-runtime-error priority path unchanged, and adds a new case that requires both type === "error" and a match on Chromium's exact blocked-integrity phrasing ('failed to find a valid digest ... integrity ...' AND 'resource has been blocked') before promoting to the existing deduplicated recordScriptLoadFailure fail-fast path. Tests confirm the exact Chromium diagnostic is classified correctly, and that non-error type / unrelated integrity text are correctly ignored (no false positives). CI green. LGTM.

@miga-heygen
miga-heygen enabled auto-merge (squash) September 4, 2026 23:15
@miga-heygen
miga-heygen merged commit c0303fc into main Sep 4, 2026
55 checks passed
@miga-heygen
miga-heygen deleted the magi/fix-stale-gsap-sri-classification branch September 4, 2026 23:15
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.

2 participants