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
4 changes: 3 additions & 1 deletion src/Wolverine/Runtime/MessageBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ public ValueTask BroadcastToTopicAsync(string topicName, object message, Deliver

internal async ValueTask PersistOrSendAsync(Envelope envelope)
{
if (envelope is null) return; // Not sure how this would happen

if (envelope.Sender is null)
{
throw new InvalidOperationException("Envelope has not been routed");
Expand Down Expand Up @@ -310,7 +312,7 @@ internal async ValueTask PersistOrSendAsync(params Envelope[] outgoing)
// the sender is currently latched
var envelopes = outgoing.Where(isDurable).ToArray();
foreach (var envelope in envelopes.Where(x =>
x.Sender is { Latched: true } && x.Status == EnvelopeStatus.Outgoing))
x is { Sender: { Latched: true }, Status: EnvelopeStatus.Outgoing }))
envelope.OwnerId = TransportConstants.AnyNode;

await Transaction.PersistAsync(envelopes);
Expand Down
4 changes: 3 additions & 1 deletion src/Wolverine/Runtime/MessageContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public async Task FlushOutgoingMessagesAsync()
$"This MessageContext does not allow multiple calls to {nameof(FlushOutgoingMessagesAsync)} because {nameof(MultiFlushMode)} = {MultiFlushMode}");
}
}


await AssertAnyRequiredResponseWasGenerated();

Expand All @@ -120,6 +119,9 @@ public async Task FlushOutgoingMessagesAsync()

foreach (var envelope in Outstanding)
{
// https://github.com/JasperFx/wolverine/issues/2006
if (envelope == null) continue;

try
{
if (envelope.IsScheduledForLater(DateTimeOffset.UtcNow))
Expand Down
Loading