fix(engine): fail closed on blocked SRI scripts - #3664
Merged
Conversation
miga-heygen
approved these changes
Sep 4, 2026
miga-heygen
left a comment
Contributor
There was a problem hiding this comment.
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.
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.
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_failurepolicy 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