From 2446fd7787d31d5f092af6ff02db43148d3cb455 Mon Sep 17 00:00:00 2001 From: voj-tech-j Date: Sat, 15 Aug 2026 12:14:33 +0200 Subject: [PATCH 1/2] fix: correct inverted segment condition logic in docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The API composes segment conditions as `(A OR B) AND (C OR D)` — conditions within a group are OR-ed, and groups are AND-ed together. The docs here stated the exact inverse. Verified against the server implementation, SegmentService::buildSegmentWhere: conditions are joined with `implode(' OR ', ...)` inside each group, and the resulting group clauses with `implode(' AND ', ...)`. The API reference and the product docs both agree. Comments only — no behaviour change. The same inversion was present in five SDKs, which suggests a shared source; each is being corrected separately. Co-Authored-By: Claude Opus 5 (1M context) --- .../services/audience/segments/model/SegmentConditionGroup.java | 2 +- .../audience/segments/model/SegmentConditionsInput.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/lettr/services/audience/segments/model/SegmentConditionGroup.java b/src/main/java/com/lettr/services/audience/segments/model/SegmentConditionGroup.java index f8c3354..2a514c1 100644 --- a/src/main/java/com/lettr/services/audience/segments/model/SegmentConditionGroup.java +++ b/src/main/java/com/lettr/services/audience/segments/model/SegmentConditionGroup.java @@ -6,7 +6,7 @@ import java.util.List; /** - * A group of conditions joined by AND. Multiple groups in a segment are joined by OR. + * A group of conditions joined by OR. Multiple groups in a segment are joined by AND. */ public class SegmentConditionGroup { diff --git a/src/main/java/com/lettr/services/audience/segments/model/SegmentConditionsInput.java b/src/main/java/com/lettr/services/audience/segments/model/SegmentConditionsInput.java index 0428c42..e7024f3 100644 --- a/src/main/java/com/lettr/services/audience/segments/model/SegmentConditionsInput.java +++ b/src/main/java/com/lettr/services/audience/segments/model/SegmentConditionsInput.java @@ -7,7 +7,7 @@ /** * Wrapper used as the {@code conditions} field on segment create/update requests. - * The top-level groups are joined by OR; conditions within each group are joined by AND. + * The top-level groups are joined by AND; conditions within each group are joined by OR. */ public class SegmentConditionsInput { From 03f97f062001678a33ba5131ccd27bcfbb642a05 Mon Sep 17 00:00:00 2001 From: voj-tech-j Date: Sat, 15 Aug 2026 17:38:46 +0200 Subject: [PATCH 2/2] chore: release 1.5.1 Patch release carrying the segment condition Javadoc fix. The Javadoc jar is built per Maven release, so the corrected AND/OR only reaches users once 1.5.1 is on Maven Central. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62776d9..5f75f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.5.1] - 2026-08-15 + +### Fixed + +- Corrected the segment condition documentation on `SegmentConditionGroup` and `SegmentConditionsInput`: conditions **within a group** are joined by `OR`, and **groups** are joined by `AND` — i.e. `(A OR B) AND (C OR D)`. The previous Javadoc stated the inverse. No behaviour change — the API has always evaluated segments this way, and no code paths were touched. Worth a read if you built a segment against the old description, since it may target a wider or narrower audience than you intended. + ## [1.5.0] - 2026-08-14 Covers the reworked bulk contact import (TPL-2105) and the duplicate-create fix. Everything here is additive — code written against 1.4.0 keeps compiling and sends the exact same payloads. @@ -180,6 +186,7 @@ Initial release. - Bearer token auth, Gson-based JSON serialization - Structured exceptions: `LettrException`, `LettrApiException`, `LettrValidationException` +[1.5.1]: https://github.com/lettr/lettr-java/compare/v1.5.0...v1.5.1 [1.5.0]: https://github.com/lettr/lettr-java/compare/v1.4.0...v1.5.0 [1.4.0]: https://github.com/lettr/lettr-java/compare/v1.3.0...v1.4.0 [1.1.0]: https://github.com/lettr/lettr-java/compare/v1.0.0...v1.1.0 diff --git a/gradle.properties b/gradle.properties index 4a16dad..45a4fd1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.lettr -VERSION=1.5.0 +VERSION=1.5.1 POM_ARTIFACT_ID=lettr-java POM_NAME=Lettr Java SDK POM_DESCRIPTION=Java SDK for the Lettr Email API