Skip to content

Add per-call conditional writes to ClientResource (#100) - #1695

Merged
thboileau-git merged 1 commit into
3.0from
feature/100-client-conditional-writes
Nov 25, 2026
Merged

thboileau-git merged 1 commit into
3.0from
feature/100-client-conditional-writes

Conversation

@thboileau-git

@thboileau-git thboileau-git commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Adds per-call conditional writes to ClientResource (#100), additive API.

  • Conditions.unchangedSince(Response): If-Match from a strong tag, else If-Unmodified-Since only if the date is strong (response Date at least 1 s after Last-Modified, RFC 9110 §8.8.2.2), else IllegalArgumentException (never an unconditional write by accident). A RepresentationInfo variant handles the tag-only case.
  • Conditions.ifAbsent(): If-None-Match: * (create only).
  • ClientResource.put/patch(Representation|Object, Conditions) and delete(Conditions): conditions apply to that call only (nothing sticks to the resource) and the call is never retried; a failed condition is a 412 ResourceException.

Tests: ConditionsFactoriesTestCase and ClientResourceConditionalTestCase (stub next Restlet). changes.md updated. Related: #1694 (Tag(String) is weak by default).

Same change on the other maintained versions: 2.7: #1696, 2.6: #1697

🤖 Generated with Claude Code

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>
@sonarqubecloud

Copy link
Copy Markdown

@thboileau-git
thboileau-git merged commit 133a18d into 3.0 Nov 25, 2026
3 of 4 checks passed
@thboileau-git
thboileau-git deleted the feature/100-client-conditional-writes branch November 25, 2026 21:17
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.

1 participant