Preserve stream actor context and integrate reviewed CI fixes - #71
Merged
Merged
Conversation
The built status is written immediately after assigning iframe.srcdoc, while the previous document can still be active. Register for navigation before each build, save, and reload, then wait for the new preview root so API calls use its installed bridge. This also synchronizes the initial automatic build and uses the correct Playwright timeout argument.
Bumps the actions group with 1 update: [pnpm/action-setup](https://github.com/pnpm/action-setup). Updates `pnpm/action-setup` from 6.0.10 to 6.1.0 - [Release notes](https://github.com/pnpm/action-setup/releases) - [Commits](pnpm/action-setup@0977fd9...ea17c68) --- updated-dependencies: - dependency-name: pnpm/action-setup dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
Delayed TransformStream input bypasses transformed awaits and can enter streamed tool execution without an actor input lock. Capture the creating context at construction and use the existing reentry gate for asynchronous callbacks, preserving native receivers and synchronous start timing.
Full extension CI exposed the corresponding ReadableStream gap: source pull callbacks inherited consumer context after transformed chunks re-entered their own gates. Bind native sources and transformers through the same constructor seam. A focused regression reproduces the lost async store, and the real streamed Think example now completes tools, Stop, and recovery.
Let the creating input lock expire before pulling so the test proves reentry instead of accidentally sharing the original microtask checkpoint. Also assert that start keeps its synchronous actor scope and receiver.
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.
Delayed ReadableStream and TransformStream callbacks could enter streamed model work without the creating actor's input lock, causing valid SQL access to fail. Capture their creating actor and async stores, then route pull, transform, flush, and cancel through the existing reentry gate. Preserve synchronous start behavior, callback receivers, frozen sources, and native operation outside an actor.
This PR also incorporates the reviewed commits from #51 and #58, so the combined result is tested against current main before one merge:
Validation: reproduced the original extension SQL failure and confirmed that source callback binding fixes it. The current stream implementation passes 940 runtime unit tests and 74 conformance tests each on Node and workerd. Chromium conformance and both built examples are included in the final CI run. The source/transformer regressions check actor scope, AsyncLocalStorage, receivers, frozen inputs, and isolation from the consumer's unrelated context.
References: WHATWG streams, TC39 Async Context, Rook integration, and the reported failing CI run. Includes a runtime patch changeset. The prior Rook validation covered 153 Chrome E2E cases and delayed-tool/disconnect recovery; it does not establish physical laptop-sleep recovery.