Repository navigation
GH-5160: WolverineHttpOptions.DefaultClaimInTransaction, a global opt-in for [DeduplicatedWithResponse(ClaimInTransaction)] - #5173
Merged
Conversation
…on-wide default for [DeduplicatedWithResponse(ClaimInTransaction)] ClaimInTransaction stays opt-in, and an application can now opt in once. An endpoint that doesn't set ClaimInTransaction on its attribute takes WolverineHttpOptions.DefaultClaimInTransaction (default false). One that sets it, true or false, keeps its own choice. Same shape as DefaultDuplicateStatusCode for [Deduplicated]: a nullable backing field on the attribute, an internal ExplicitClaimInTransaction on the requirement, and the option carried onto HttpGraph. An endpoint that can't take the transactional path still falls back to claim-and-release. When it only inherited the default, that's logged at debug level instead of as a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U
This was referenced Oct 24, 2026
This was referenced Oct 25, 2026
This was referenced Nov 2, 2026
This was referenced Nov 9, 2026
This was referenced Nov 16, 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.
This follows up #5169, and answers @uniquelau's question on #5161:
ClaimInTransactionstays opt-in, and an application can now opt in once.ClaimInTransactiontakes the application default. That default isfalse, so nothing changes unless you set it.[DeduplicatedWithResponse(DeduplicationScope.User, ClaimInTransaction = false)]stays on claim-and-release even when the default is on.How
This copies the existing
DefaultDuplicateStatusCode/[Deduplicated(DuplicateStatusCode)]pattern (andEntityDefaults.OnMissingon[Entity]):DeduplicatedWithResponseAttribute.ClaimInTransactionis backed by abool?, which stays null until it is set. The public property still readsfalsewhen unset.DeduplicatedWithResponseRequirementgets an internalExplicitClaimInTransaction, alongsideExplicitDuplicateStatusCode.ToString()shows only an explicit choice.WolverineHttpOptions.DefaultClaimInTransactionis copied ontoHttpGraphinDiscoverEndpoints. The chain resolvesrequirement.ExplicitClaimInTransaction ?? _parent.DefaultClaimInTransactionwhen it is woven.UpdatedAggregate, ...) still falls back to claim-and-release.ClaimInTransactionitself, the fallback is still a warning.No breaking changes:
ClaimInTransactioncame in with #5169 and hasn't shipped in a release yet. Its public shape is unchanged.Tests
deduplicated_with_response_claim_in_transaction_defaultuses its own host withDefaultClaimInTransaction = true:ClaimInTransaction = falsekeeps claim-and-release.ClaimInTransaction = trueclaims in the transaction.ExplicitClaimInTransaction;falsegives an explicitfalse.Mutation check: when the chain ignores the global default, the "unset" test fails.
Run locally:
dotnet build wolverine.slnx -c Release -f net9.0: 0 errorsDocs:
docs/guide/http/deduplication.mdhas a new "Turning it on for every endpoint" section, with mdsnippets samples taken from the test.🤖 Generated with Claude Code
https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U