Skip to content

fix(ssr): contain rejected async resource loaders - #401

Merged
smiggleworth merged 1 commit into
mainfrom
fix/ssr-resource-rejection
Sep 6, 2026
Merged

fix(ssr): contain rejected async resource loaders#401
smiggleworth merged 1 commit into
mainfrom
fix/ssr-resource-rejection

Conversation

@smiggleworth

@smiggleworth smiggleworth commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

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.

@smiggleworth
smiggleworth marked this pull request as ready for review September 6, 2026 21:28
@smiggleworth
smiggleworth merged commit dc6c35a into main Sep 6, 2026
7 checks passed
@smiggleworth
smiggleworth deleted the fix/ssr-resource-rejection branch September 6, 2026 21:36
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