Merge branch 'hotfix/2.0.3'

This commit is contained in:
Hans Mulder 2020-01-20 16:48:32 +01:00
commit 8607c2b2c2
3 changed files with 15 additions and 0 deletions

View File

@ -9,5 +9,12 @@
/// Key given to the FlowContext object as stored in the message context.
/// </summary>
public const string FlowContext = "Tapeti.Flow.FlowContext";
/// <summary>
/// Indicates if the current message handler is the last one to be called before a
/// parallel flow is done and the convergeMethod will be called.
/// Temporarily disables storing the flow state.
/// </summary>
public const string FlowIsConverging = "Tapeti.Flow.IsConverging";
}
}

View File

@ -83,6 +83,9 @@ namespace Tapeti.Flow.Default
private static Task HandleParallelResponse(IControllerMessageContext context)
{
if (context.Get<object>(ContextItems.FlowIsConverging, out _))
return Task.CompletedTask;
var flowHandler = context.Config.DependencyResolver.Resolve<IFlowHandler>();
return flowHandler.Execute(new FlowHandlerContext(context), new DelegateYieldPoint(async flowContext =>
{

View File

@ -36,6 +36,10 @@ namespace Tapeti.Flow.Default
var converge = flowContext.FlowState.Continuations.Count == 0 &&
flowContext.ContinuationMetadata.ConvergeMethodName != null;
if (converge)
// Indicate to the FlowBindingMiddleware that the state must not to be stored
context.Store(ContextItems.FlowIsConverging, null);
await next();
if (converge)
@ -57,6 +61,7 @@ namespace Tapeti.Flow.Default
if (flowContext?.FlowStateLock != null)
{
// TODO do not call when the controller method was filtered, if the same message has two methods
if (!flowContext.IsStoredOrDeleted())
// The exception strategy can set the consume result to Success. Instead, check if the yield point
// was handled. The flow provider ensures we only end up here in case of an exception.