Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: execute OnEntryFromAsync actions from FireAsync #532

Conversation

mclift
Copy link
Member

@mclift mclift commented Jun 2, 2023

Proposed resolution for issue #531.

It seems we missed a mistake in #511 in class AsyncFrom<TTriggerType> such that a call to the async method ExecuteAsync would invoke the synchronous Execute, which intentionally throws an InvalidOperationException.

Additionally, the implementation of AsyncFrom<TTriggerType>.ExecuteAsync(Transition, object[]) does not return the task queued to execute the entry action, and instead returns Task.CompletedTask, making it impossible for the caller to await completion of the entry action.

This PR changes ExecuteAsync so that it invokes the async action and returns the queued task.

@mclift mclift requested review from crozone and ffMathy June 11, 2023 12:58
@mclift mclift merged commit b45b999 into dotnet-state-machine:dev Jul 4, 2023
@mclift mclift deleted the bugfix/OnEntryFromAsync-InvalidOperationException branch July 4, 2023 13:45
This pull request was closed.
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.

2 participants