Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
<NoWarn>1570;1571;1572;1573;1574;1587;1591;1701;1702;1711;1735;0618</NoWarn>
<ImplicitUsings>true</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>4.12.0</Version>
<Version>4.12.1</Version>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
8 changes: 6 additions & 2 deletions src/Wolverine/Runtime/MessageContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private bool hasRequestedReply()

private bool isMissingRequestedReply()
{
return Outstanding.All(x => x.MessageType != Envelope!.ReplyRequested);
return Outstanding.Concat(_sent ?? []).All(x => x.MessageType != Envelope!.ReplyRequested);
}

public async Task FlushOutgoingMessagesAsync()
Expand Down Expand Up @@ -95,11 +95,15 @@ public async Task FlushOutgoingMessagesAsync()
await flushScheduledMessagesAsync();
}

_sent ??= new();
_sent.AddRange(_outstanding);
_outstanding.Clear();

_hasFlushed = true;
}

private List<Envelope>? _sent;

public async Task AssertAnyRequiredResponseWasGenerated()
{
if (hasRequestedReply() && _channel is not InvocationCallback && isMissingRequestedReply())
Expand All @@ -108,7 +112,7 @@ public async Task AssertAnyRequiredResponseWasGenerated()
if (_outstanding.Any())
{
failureDescription += "Actual cascading messages were " +
_outstanding.Select(x => x.MessageType).Join(", ");
_outstanding.Concat(_sent ?? []).Select(x => x.MessageType).Join(", ");
}
else
{
Expand Down