Skip to content

[artifact build] async module resume fix on the 6d586e293f line#253

Closed
robobun wants to merge 1 commit into
mainfrom
bun/fix-async-module-resume-async-context-6d586e
Closed

[artifact build] async module resume fix on the 6d586e293f line#253
robobun wants to merge 1 commit into
mainfrom
bun/fix-async-module-resume-async-context-6d586e

Conversation

@robobun

@robobun robobun commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Do not merge. This branch is #252's one-function fix cherry-picked onto 6d586e2, the commit oven-sh/bun main currently pins, purely to generate preview artifacts that are API-compatible with bun main (bun's bindings do not compile against this fork's current main, which carries the 51cc3fe/24362e67 upstream upgrades).

oven-sh/bun#32184 pins the resulting autobuild-preview tag to prove the fix in bun CI. The mergeable fix for this fork's main is #252.

The diff vs main below is meaningless (it shows the upgrade reverted); the real content is the single commit 7eb8e17.

Same fix as the main-targeting PR #252, applied on top of the commit Bun
currently pins (6d586e2) so the preview artifacts are compatible with
oven-sh/bun main, whose bindings do not yet compile against the newer
upstream-upgrade API on this fork's main.

When an AsyncLocalStorage context is active at await time,
resolveWithInternalMicrotaskForAsyncAwait wraps the microtask context in an
InternalFieldTuple(context, asyncContext). AsyncFunctionResume unwraps it;
asyncModuleExecutionResume did not, and downcast the tuple as a
JSModuleRecord. Any top-level-await module awaiting with an active async
context crashed (oven-sh/bun#32178, regression in Bun 1.3.14).

Unwrap the tuple and set/restore the async context around the resumption,
mirroring AsyncFunctionResume.
@github-actions

Copy link
Copy Markdown

Preview Builds

Commit Release Date
7eb8e17e autobuild-preview-pr-253-7eb8e17e 2026-06-12 17:04:01 UTC

@robobun

robobun commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Obsolete after oven-sh/bun rebased onto main, which now pins WebKit 9cb85a0 (the upstream-upgrade commit, #251). This branch was a cherry-pick onto the old 6d586e2 base, built only because bun main's bindings didn't compile against the upgraded WebKit. bun main now pins 9cb85a0, so #252 (based on 9cb85a0) is directly compatible and its preview build is what oven-sh/bun#32184 now uses. #252 remains the mergeable fix for main.

@robobun robobun closed this Jun 16, 2026
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