Skip to content

fix: isolate async invoke processing context - #728

Open
edsonsims wants to merge 1 commit into
fgmacedo:mainfrom
edsonsims:fix/async-invoke-processing-context
Open

edsonsims wants to merge 1 commit into
fgmacedo:mainfrom
edsonsims:fix/async-invoke-processing-context

Conversation

@edsonsims

Copy link
Copy Markdown

Fixes #707.

An async invoke inherits the processing-loop marker from the macrostep that creates it. If the invoke later awaits raise_() while another event is processing, the event is treated as internal and the await can return before its transition runs.

I clear only that marker while creating the invoke task, preserving unrelated context variables. The caller's processing context is restored even if the task factory raises. Inline callback event handling and the invocation lifecycle are unchanged.

Validation: both new regressions fail on the original source and pass with the fix. The full suite passes with 2,975 passed, 26 skipped and 126 expected failures, reaching 100% statement and branch coverage. Applicable pre-commit hooks, MyPy and Pyright pass on macOS/Python 3.13.1. The broad all-files hook run regenerated unrelated lock/image files; those bytes were restored and the actual changed-file hooks rerun successfully. Nine Sphinx deprecation warnings remain in unchanged diagram code.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

Async invoke tasks inherit the running-engine context, so raise_ from them is treated as internal

1 participant