Repository navigation
Add per-call conditional writes to ClientResource (#100) - #1697
Merged
Merged
Conversation
Conditions.unchangedSince(Response) builds If-Match from a strong tag, or If-Unmodified-Since when the modification date is strong (RFC 9110 8.8.2.2), and refuses otherwise; Conditions.ifAbsent() builds If-None-Match: *. ClientResource gets put/patch/delete overloads taking Conditions: per call, never sticky, never retried. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 25, 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.



Adds per-call conditional writes to
ClientResource(#100), additive API.Conditions.unchangedSince(Response):If-Matchfrom a strong tag, elseIf-Unmodified-Sinceonly if the date is strong (responseDateat least 1 s afterLast-Modified, RFC 9110 §8.8.2.2), elseIllegalArgumentException(never an unconditional write by accident). ARepresentationInfovariant handles the tag-only case.Conditions.ifAbsent():If-None-Match: *(create only).ClientResource.put/patch(Representation|Object, Conditions)anddelete(Conditions): conditions apply to that call only (nothing sticks to the resource) and the call is never retried; a failed condition is a 412ResourceException.Tests:
ConditionsFactoriesTestCaseandClientResourceConditionalTestCase(stub next Restlet).changes.mdupdated. Related: #1694 (Tag(String)is weak by default).Same change on the other maintained versions: 3.0: #1695, 2.7: #1696
🤖 Generated with Claude Code