Skip to content

Correct QUERY verb docs: transactional middleware is dependency-based, not verb-based#3360

Merged
jeremydmiller merged 1 commit into
mainfrom
chore/3355-query-verb-transactional-docs
Jul 10, 2026
Merged

Correct QUERY verb docs: transactional middleware is dependency-based, not verb-based#3360
jeremydmiller merged 1 commit into
mainfrom
chore/3355-query-verb-transactional-docs

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Closes #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 "HTTP QUERY Method" docs tip all implied a verb-based exemption that doesn't exist, and the existing query_endpoint_is_not_wrapped_in_transactional_middleware test only exercised an endpoint with no dependencies at all, so it couldn't catch the misstatement.

Changes

  • WolverineQueryAttribute XML doc (what users see in IntelliSense): states the actual rules — outbox middleware requires an IMessageBus/IMessageContext dependency; transactional middleware applies when the handler takes an IDocumentSession or DbContext; prefer IQuerySession (Marten) or [NonTransactional] (EF Core) for read-only QUERY endpoints.
  • sample_wolverine_query_endpoint comment (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.md tip: same correction, with the IQuerySession / [NonTransactional] guidance.
  • Tests: two new WolverineWebApi QUERY endpoints — /search/audited taking IDocumentSession (asserted IsTransactional == true) and /search/readonly taking IQuerySession (asserted false) — 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

  • New + existing query_verb_support tests green (6/6)
  • Full Wolverine.Http.Tests suite green: 813 passed / 0 failed / 10 skipped

🤖 Generated with Claude Code

…, 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>
@jeremydmiller
jeremydmiller merged commit fc7b94f into main Jul 10, 2026
25 checks passed
This was referenced Jul 10, 2026
This was referenced Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QUERY verb docs: a QUERY endpoint IS wrapped in transactional middleware when it takes an IDocumentSession/DbContext (follow-up to #3296)

1 participant