Skip to content

Commit

Permalink
Big fix for operation ordering in HTTP endpoints that use certain com…
Browse files Browse the repository at this point in the history
…binations of Marten middleware. Bumps to 1.12.4
  • Loading branch information
jeremydmiller committed Nov 24, 2023
1 parent 2530d2a commit 3f5bf24
Show file tree
Hide file tree
Showing 50 changed files with 3,559 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<NoWarn>1570;1571;1572;1573;1574;1587;1591;1701;1702;1711;1735;0618</NoWarn>
<ImplicitUsings>true</ImplicitUsings>
<Version>1.12.3</Version>
<Version>1.12.4</Version>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
10 changes: 6 additions & 4 deletions src/Http/Wolverine.Http/HttpChain.Codegen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,19 @@ internal IEnumerable<Frame> DetermineFrames(GenerationRules rules)
.Select(x => x.ReturnAction(this)).SelectMany(x => x.Frames()).ToArray();
foreach (var frame in actionsOnOtherReturnValues) yield return frame;

foreach (var frame in Postprocessors) yield return frame;

if (!Postprocessors.OfType<MethodCall>().Any(x =>
x.HandlerType == typeof(MessageContext) &&
x.Method.Name == nameof(MessageContext.EnqueueCascadingAsync)))
{
if (actionsOnOtherReturnValues.OfType<CaptureCascadingMessages>().Any())
if (actionsOnOtherReturnValues.OfType<CaptureCascadingMessages>().Any() && !Postprocessors.OfType<MethodCall>().Any(x => x.Method.Name == nameof(MessageContext.FlushOutgoingMessagesAsync)))
{
yield return MethodCall.For<MessageContext>(x => x.FlushOutgoingMessagesAsync());
var flush = MethodCall.For<MessageContext>(x => x.FlushOutgoingMessagesAsync());
flush.CommentText = "Making sure there is at least one call to flush outgoing, cascading messages";
yield return flush;
}
}

foreach (var frame in Postprocessors) yield return frame;
}

private string determineFileName()
Expand Down
Loading

0 comments on commit 3f5bf24

Please sign in to comment.