temporalio / sdk-dotnet

Temporal .NET SDK
MIT License
394 stars 33 forks source link

[Bug] WaitConditionAsync is run outside of Workflow context #240

Closed cretz closed 7 months ago

cretz commented 7 months ago

Describe the bug

The callback for WaitConditionAsync is run outside of the event loop, so the current task scheduler is not the workflow instance. This means any calls on the Workflow object within the callback will fail.

Tyler-Harker commented 7 months ago

Workflow event loop is in the following file (for future reference)

https://github.com/temporalio/sdk-dotnet/blob/ee378c17595bccf8a390ff82e4e1f514d4a6344f/src/Temporalio/Worker/WorkflowInstance.cs#L648