Azure / azure-functions-durable-js

JavaScript library for using the Durable Functions bindings
https://www.npmjs.com/package/durable-functions
MIT License
128 stars 47 forks source link

Define semantics for CompoundTasks with no children #423

Open davidmrdavid opened 1 year ago

davidmrdavid commented 1 year ago

Follow up to: https://github.com/Azure/azure-functions-durable-js/pull/405/files#r1068072395

Our CompoundTask can be constructed without any sub-tasks / children. We handle this case by immediately setting the Task to "Completed" See here:

https://github.com/Azure/azure-functions-durable-js/blob/66ba4a172687543624cbc89a6c3836c70721a1e7/src/task.ts#L226-L247

This is an edge case, and perhaps one that we should not have supported in the first place. Assuming we were to continue supporting it, we should determine how to set the Task's isPlayed property, which is used to set the context.IsReplaying flag. Today, the tasks' isPlayed property remains unchaged, meaning that it is false and so it runs the risk of changing the context.IsReplaying flag to false when it shouldn't.

davidmrdavid commented 1 year ago

@hossam-nasr: for the new programming model, we should consider whether or not to continue supporting this kind of compound task.

hossam-nasr commented 1 year ago

@davidmrdavid Sounds good, I've created an issue for that here: #424. Let's triage this on our next sync (with the rest of the remaining v3 issues)