Enlist DbContext-injecting tuple-cascade HTTP endpoints in the EF Core outbox#3362
Merged
Merged
Conversation
…e outbox (GH-3358) The GH-3291 branch of EFCorePersistenceFrameProvider.ApplyTransactionSupport (chain, container) was gated on chain.RequiresOutbox(), which for an HttpChain only reflects an injected IMessageBus/IMessageContext dependency. A Lightweight mode HTTP endpoint that injects the DbContext and cascades purely through its return tuple can never satisfy that gate, so its cascaded messages were still dispatched by the send-now branch of MessageBus.PersistOrSendAsync before the SaveChangesAsync postprocessor committed - the third and last endpoint shape in the GH-3291/GH-3353 defect family. Drop the RequiresOutbox() gate. GH-3357's hasDatabaseBackedMessagePersistence guard makes this safe: enlisting an endpoint that never cascades is a no-op flush at commit time, and persistence-less applications keep their send-now composition (pinned by a dedicated guard-rail test). Red-first verified: the new codegen-surface test fails without the gate change. Full Wolverine.Http.Tests 817/0, EfCoreTests 186/187 (known Bug_1846 load flake), full wolverine.slnx Release build 0 warnings / 0 errors. Closes #3358 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3358. Completes the GH-3291/GH-3353 defect family (follow-up to #3298 and #3357).
The three endpoint shapes
IMessageBus, publishes explicitlyRequiresOutbox()true)DbContext, cascades via return tupleCanApplytrue)Shape 3 was empirically confirmed while filing #3358: even after #3357, the generated chain showed
enlist=False cascade=True requiresOutbox=False— the cascade dispatched by the send-now branch ofMessageBus.PersistOrSendAsyncbeforeSaveChangesAsynccommitted.Fix
Drop the
chain.RequiresOutbox()gate from the GH-3291 branch ofEFCorePersistenceFrameProvider.ApplyTransactionSupport(chain, container).HttpChain.RequiresOutbox()only reflects an injectedIMessageBus/IMessageContextdependency — a tuple-cascading endpoint can never satisfy it. The drop is safe because of #3357'shasDatabaseBackedMessagePersistenceguard:EfCoreEnvelopeTransaction's constructor would throw without a message database) — pinned by a dedicated guard-rail test.isHttpChaingate) and multi-tenanted chains keep their existing path.Tests
New
Bug_3358_lightweight_dbcontext_tuple_cascade(codegen-surface assertions, same conventions as the #3353 sibling), with the endpoint in the Marten-freeWolverine.Http.Tests.EfCoreOnlyassembly:RequiresOutbox() == false(the very shape under test), thenEnlistInOutboxAsyncpresent, no standaloneFlushOutgoingMessagespostprocessor, and enlist →SaveChangesAsync→CommitAsyncordering. Red-first verified — fails without the gate change.SaveChangesAsyncand never enlists.Verification
Wolverine.Http.Tests: 817 passed / 0 failedBug_1846load-flake; passes isolated)wolverine.slnxRelease build: 0 warnings / 0 errors🤖 Generated with Claude Code