Skip to content

Conversation

@karlseguin
Copy link
Collaborator

ScriptManager should only ever has one in-flight blockingGet. The is_blocking flag is used to assert this, as well as enforce it in evaluate(). If is_blocking is true, evaluate() exits.

This doesn't work for async scripts however, as they aren't executed via evaluate(), but rather execute directly once complete.

This PR changes the execution behavior of async scripts. They are now only executed in evaluate() (and thus won't execute when is_blocking == true). However, unlike normal/deferred scripts, async scripts continue to execute in their completion order (not their declared order).

Fixes #1016

ScriptManager should only ever has one in-flight blockingGet. The is_blocking
flag is used to assert this, as well as enforce it in evaluate(). If is_blocking
is true, evaluate() exits.

This doesn't work for async scripts however, as they aren't executed via
evaluate(), but rather execute directly once complete.

This PR changes the execution behavior of async scripts. They are now only
executed in evaluate() (and thus won't execute when is_blocking == true).
However, unlike normal/deferred scripts, async scripts continue to execute in
their completion order (not their declared order).

Fixes #1016
@krichprollsch krichprollsch merged commit 80adee8 into main Sep 5, 2025
10 checks passed
@krichprollsch krichprollsch deleted the fix_async_script_processing branch September 5, 2025 15:43
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

self.is_blocking == false assertion fails when fetching nytimes.com

3 participants