Correct QUERY verb docs: transactional middleware is dependency-based, not verb-based#3360
Merged
Merged
Conversation
…, not verb-based (#3355) A QUERY endpoint IS wrapped in transactional middleware when it takes an IDocumentSession/DbContext under AutoApplyTransactions() - nothing in Wolverine keys off the HTTP verb. The WolverineQueryAttribute XML doc, the sample_wolverine_query_endpoint comment, and the endpoints.md tip all implied a verb-based exemption that does not exist. - Rewrite the XML doc and docs tip to state the actual rules: outbox gated on IMessageBus/IMessageContext, transactional middleware gated on IDocumentSession/DbContext; prefer IQuerySession (Marten) or [NonTransactional] (EF Core) for read-only QUERY endpoints - Strengthen query_verb_support with QUERY endpoints taking IDocumentSession (IsTransactional=true) and IQuerySession (false) so the dependency-based rule is pinned and a future verb-based special case can't sneak in silently Closes #3355 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 10, 2026
This was referenced Jul 14, 2026
Open
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 #3355.
A QUERY endpoint is wrapped in transactional middleware when it takes an
IDocumentSession/DbContextunderAutoApplyTransactions()— nothing in Wolverine keys off the HTTP verb. TheWolverineQueryAttributeXML doc, thesample_wolverine_query_endpointcomment, and the "HTTP QUERY Method" docs tip all implied a verb-based exemption that doesn't exist, and the existingquery_endpoint_is_not_wrapped_in_transactional_middlewaretest only exercised an endpoint with no dependencies at all, so it couldn't catch the misstatement.Changes
WolverineQueryAttributeXML doc (what users see in IntelliSense): states the actual rules — outbox middleware requires anIMessageBus/IMessageContextdependency; transactional middleware applies when the handler takes anIDocumentSessionorDbContext; preferIQuerySession(Marten) or[NonTransactional](EF Core) for read-only QUERY endpoints.sample_wolverine_query_endpointcomment (surfaces in the docs via mdsnippets): attributes the endpoint's non-transactional status to the absence of a persistence dependency, not to the verb.docs/guide/http/endpoints.mdtip: same correction, with theIQuerySession/[NonTransactional]guidance./search/auditedtakingIDocumentSession(assertedIsTransactional == true) and/search/readonlytakingIQuerySession(assertedfalse) — pin the dependency-based rule so a verb-based special case can't be introduced silently. The existing test's comment now explains what it actually demonstrates.Verification
query_verb_supporttests green (6/6)Wolverine.Http.Testssuite green: 813 passed / 0 failed / 10 skipped🤖 Generated with Claude Code