Skip to content

fix: Resolve edge AsyncLocalStorage from runtime builtins#1611

Merged
Luca Forstner (lforst) merged 4 commits intomainfrom
lforst-als-edge
Mar 19, 2026
Merged

fix: Resolve edge AsyncLocalStorage from runtime builtins#1611
Luca Forstner (lforst) merged 4 commits intomainfrom
lforst-als-edge

Conversation

@lforst
Copy link
Member

@lforst Luca Forstner (lforst) commented Mar 19, 2026

Authorized PR for CI taken from: #1567

All attributions go to Dillon Mulroy (@dmmulroy)

Use process.getBuiltinModule('node:async_hooks') when workerd or edge-light do not expose AsyncLocalStorage globally, so traced child spans keep their active parent context. Add a minimal bootstrap regression test and flip the affected Cloudflare smoke scenarios to expect ALS to work.
Use normal property lookup for runtime AsyncLocalStorage resolution so accessor-backed or inherited values are still discovered. Reset the symbol-backed Braintrust state between bootstrap test cases to keep the regression test isolated.
Align the browser-named Cloudflare Worker smoke scenario docs with the actual test setup, which imports \ and asserts resolution to the \ build. Document the no-compat scenario's expected ALS limitation so the smoke expectations are easier to understand.
@lforst Luca Forstner (lforst) merged commit 7bfd78d into main Mar 19, 2026
48 checks passed
@lforst Luca Forstner (lforst) deleted the lforst-als-edge branch March 19, 2026 11:45
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.

3 participants