fix(ssr): contain rejected async resource loaders - #401
Merged
Conversation
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.
An async resource loader rejected during synchronous SSR could produce an unhandled rejection after the caller caught
SSRDataMissingError, terminating a Node server.Observe the returned work and abort its signal before rejecting SSR. Promise assimilation contains thenable failures without awaiting the loader or publishing its result. The public synchronous SSR contract is unchanged, and internal documentation describes cancellation and failure ownership.
Validation: subprocess regressions use the built public APIs and strict Node rejection handling. The original source failed three cases; the fix passes all five, covering immediate/delayed rejection, abort rejection, rejecting thenables, and throwing then accessors. The subprocess also verifies a subsequent render succeeds. Final local validation passed: formatting, lint, build, 336 unit, 65 repository, 1639 DOM, 53 browser, public types, and 21 packed-consumer tests. The unchanged 256 KiB bundle check passes. The existing 250-row SSR benchmark passes (4190 samples, mean 0.0955 ms, RME 2.56%); this is not a comparative performance claim. Source review checked synchronous error identity, cancellation ordering, thenable assimilation, and subsequent-render recovery. Hosted checks must pass on the exact head before merge.