Open andrei-micuda opened 1 year ago
Describe the bug Having a CompensateWithSequence step causes the compensation to happen in parallel with CompensateWith steps.
CompensateWithSequence
CompensateWith
To Reproduce Steps to reproduce the behavior:
builder.Saga(x => x .StartWith(_ => Console.WriteLine("Step1.")) .CompensateWith(_ => Console.WriteLine("Compensating Step1.")) .Then(_ => Console.WriteLine("Step2.")) .CompensateWithSequence(seq => seq .StartWith(_ => Console.WriteLine("Compensating Step2.")) .Then(_ => Thread.Sleep(3000)) .Then(_ => Console.WriteLine("Finished compensating Step2.")) ) .Then(_ => throw new Exception()));
The output of the workflow is:
Step1. Step2. Compensating Step1. Compensating Step2. Finished compensating Step2.
Expected behavior The expected output of the workflow is:
Step1. Step2. Compensating Step2. Finished compensating Step2. Compensating Step1.
Describe the bug Having a
CompensateWithSequence
step causes the compensation to happen in parallel withCompensateWith
steps.To Reproduce Steps to reproduce the behavior:
The output of the workflow is:
Expected behavior The expected output of the workflow is: