workflow-core icon indicating copy to clipboard operation
workflow-core copied to clipboard

ActivityResult useless events processing

Open dammafra opened this issue 3 years ago • 0 comments

Hello, I'm wondering why this piece of code is executed in case of events of type ActivityResult that matches one and only one Subscription (and viceversa, the Subscription should be matched with one and only one ActivityResult event).

https://github.com/danielgerlag/workflow-core/blob/a74727969e005dee6b4115ab4a18581b23d587b9/src/WorkflowCore/Services/BackgroundTasks/EventConsumer.cs#L99

It does useless processing and it can possibly match wrong ActivityResult for a Subscription.

My suggestion is to wrap that cycle in an if statement

if (!(evt.EventData is ActivityResult)) ...

dammafra avatar Sep 13 '22 08:09 dammafra