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.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PackageVersion Include="JasperFx.SourceGenerator" Version="2.2.0" />
<PackageVersion Include="Marten" Version="9.2.0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.3" />
<PackageVersion Include="Polecat" Version="4.1.1" />
<PackageVersion Include="Polecat" Version="4.2.1" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.46.1" />
<PackageVersion Include="Marten.AspNetCore" Version="9.2.0" />
<PackageVersion Include="Marten.Newtonsoft" Version="9.2.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Bug_2941_document_exists_scheduled_cascade(PolecatDocumentExistsScheduled

private IHost theHost => _context.Host;

[Fact(Skip = "Requires Polecat upstream fix: see Bug_2941_read_aggregate_scheduled_cascade for details. Same SaveChangesAsync-skips-participants root cause.")]
[Fact]
public async Task document_exists_handler_schedules_its_cascading_message()
{
var tracked = await theHost
Expand All @@ -43,7 +43,7 @@ public async Task document_exists_handler_schedules_its_cascading_message()
tracked.Received.MessagesOf<PcDocExistsScheduled>().Count().ShouldBe(1);
}

[Fact(Skip = "Requires Polecat upstream fix: see Bug_2941_read_aggregate_scheduled_cascade for details.")]
[Fact]
public async Task document_does_not_exist_handler_schedules_its_cascading_message()
{
var tracked = await theHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public async Task read_aggregate_handler_publishes_its_cascading_message()
tracked.Received.MessagesOf<PcSomethingWasScheduled>().Count().ShouldBe(1);
}

[Fact(Skip = "Requires Polecat upstream fix: DocumentSessionBase.SaveChangesAsync early-returns when _workTracker has no outstanding work, which silently skips StoreIncomingEnvelopeParticipant added via Session.StoreIncoming(...) for a [ReadAggregate] handler whose body emits only a scheduled cascade (no doc ops, no streams). The Wolverine-side CanApply fix is necessary but not sufficient on Polecat. Unskip when Polecat ships a SaveChangesAsync that runs participants even when no document/stream work is outstanding. GH-2941.")]
[Fact]
public async Task read_aggregate_handler_schedules_its_cascading_message()
{
// The GH-2941 case. Without the CanApply fix this times out: the cascade is recorded as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@ public bool CanApply(IChain chain, IServiceContainer container)

// GH-2941: detect parameter attributes whose Modify() injects a non-MethodCall frame
// depending on IDocumentSession. See MartenPersistenceFrameProvider.CanApply for the full
// explanation; Polecat mirrors the Marten path structurally. NOTE: this is necessary but
// not sufficient on the Polecat side - Polecat 4.1.1's DocumentSessionBase.SaveChangesAsync
// early-returns when _workTracker has no outstanding work, which skips transaction
// participants entirely. A handler that only adds a StoreIncomingEnvelopeParticipant via
// PolecatEnvelopeTransaction.PersistIncomingAsync therefore never gets its participant
// executed, even after this fix attaches the SaveChangesAsync postprocessor. The full
// Polecat fix is upstream in Polecat's SaveChangesAsync guard.
// explanation; Polecat mirrors the Marten path structurally. Pairs with the upstream
// Polecat fix (polecat#161, shipped in Polecat 4.2.1): DocumentSessionBase.SaveChangesAsync
// now also runs queued ITransactionParticipants when there are no document operations
// outstanding, so the StoreIncomingEnvelopeParticipant added via Session.StoreIncoming(...)
// for a scheduled cascade actually executes inside the chain's session transaction.
if (ChainHasPolecatSessionAttributes(chain)) return true;

var serviceDependencies = chain
Expand Down