Waiting for an event in a while loop
When you wait for an event in a while loop, you expect execution to continue each time the event is received and then continue waiting.
Why is context.ExecutionPointer.EventName null when CustomMessage.Run() executes, rather than the event name? context.ExecutionPointer.EventPublished Why is it false? Why don't loops wait?
I have the same problem. Upon reviewing the data superficially, the event is not marked as consumed in the events table. It is possible that this is triggering the WaitFor repeatedly. In my case, I am using SQL Server.
I don’t know if you resolved the issue, but I hope I can contribute to solving this problem.
In the file WorkflowConsumer.cs, for some reason, after the event is successfully consumed and, in this case, the WaitFor is unlocked, the IsProcessed property is updated to True.
Then, for reasons I have yet to discover, the MarkEventUnprocessed function updates the IsProcessed property back to False. This causes the event to be re-enqueued and the WaitFor step in the workflow to be unlocked again.
I have been investigating this issue, but I still haven't identified the root cause of why MarkEventUnprocessed is being triggered.