Skip to content

fix: Update launchdarkly-java-sdk-internal to 1.13.0 - #272

Merged
kinyoklion merged 2 commits into
mainfrom
devin/1795105134-java-sdk-internal-1.13.0
Nov 19, 2026
Merged

kinyoklion merged 2 commits into
mainfrom
devin/1795105134-java-sdk-internal-1.13.0

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Describe the solution you've provided

Bumps launchdarklyJavaSdkInternal in lib/sdk/server/build.gradle from 1.12.2 to 1.13.0. With 1.12.2, a full transfer with an empty state produced a non-empty selector, so the server SDK sent basis on its next request.

Describe alternatives you've considered

#257 also bumps to 1.13.0, but its cooldown changes will ship in a later internal version.

Additional context

Local results on Java 8:

  • ./gradlew test in lib/sdk/server: 1987 tests, 0 failures.
  • sdk-test-harness#600, streaming/fdv2/payloads without a selector: 5/5 pass. 3 of the 5 fail on main.
  • Full v3 contract suite with the CI suppression file and persistence tests: 6311 ran, all passed.

Link to Devin session: https://app.devin.ai/sessions/fa07e76e6e3346c9b26f2eae4ff6694b
Open in Devin Desktop: https://app.devin.ai/desktop/session/fa07e76e6e3346c9b26f2eae4ff6694b?variant=devin
Requested by: @kinyoklion


Note

Overview
Bumps launchdarklyJavaSdkInternal in lib/sdk/server/build.gradle from 1.12.2 to 1.13.0, pulling in the shared internal fix for selectorless FDv2 payloads (issue #261).

Previously, a full transfer with an empty state could still yield a non-empty selector, so the server SDK incorrectly sent basis on the following streaming request. Contract tests for payloads without a selector are expected to pass after this upgrade.

Reviewed by Cursor Bugbot for commit 703704e. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@kinyoklion
kinyoklion marked this pull request as ready for review November 19, 2026 16:39
@kinyoklion
kinyoklion requested a review from a team as a code owner November 19, 2026 16:39

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low.

Automated risk review (dry run): Low

This PR would be automatically approved.

Why: One-line bump of launchdarklyJavaSdkInternal from 1.12.2 to 1.13.0 in lib/sdk/server/build.gradle; Cursor Bugbot completed with no findings.

If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@cursor cursor Bot added the risk:low label Nov 19, 2026
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion
kinyoklion merged commit 9cc5885 into main Nov 19, 2026
31 checks passed
@kinyoklion
kinyoklion deleted the devin/1795105134-java-sdk-internal-1.13.0 branch November 19, 2026 17:16
kinyoklion pushed a commit that referenced this pull request Nov 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.18.2](launchdarkly-java-server-sdk-7.18.1...launchdarkly-java-server-sdk-7.18.2)
(2026-11-20)


### Bug Fixes

* Clear empty FDv2 selectors in shared protocol handling
([#261](#261))
([576b081](576b081))
* Prevent flags in a persistent store from becoming available to mobile
keys ([#275](#275))
([32c8676](32c8676))
* Treat a null optional property in flag data as omitted
([#268](#268))
([3af465d](3af465d))
* Update launchdarkly-java-sdk-internal to 1.13.0
([#272](#272))
([9cc5885](9cc5885))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> This **release PR** bumps the LaunchDarkly Java server SDK from
**7.18.1** to **7.18.2** across Release Please metadata
(`gradle.properties`, `Version.SDK_VERSION`, and
`.release-please-manifest.json`).
> 
> The new **CHANGELOG** section records the fixes shipped in this patch:
clearing empty FDv2 selectors in shared protocol handling, blocking
persistent-store flags from being exposed to mobile keys, treating null
optional flag properties as omitted, and updating
`launchdarkly-java-sdk-internal` to 1.13.0. Those behavioral changes are
not part of this diff—only the version and release notes are updated
here.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9087581. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
kinyoklion added a commit that referenced this pull request Dec 3, 2026
<!-- TERMAG_PR_BODY_BEGIN -->
## Update, 2026-12-01

- Rebased onto `feat/overrides`, which has `main` merged into it again.
From `main` it gets the 7.19.0 to 7.19.2 releases, `java-sdk-internal`
1.14.0, and the FDv2 fix that leaves out an empty selector (#261). The
v3.2.0-alpha.21 contract tests check that fix, so CI failed three FDv2
streaming tests without it.

Changes from the review:

- The reloader and the poller run on one executor that the caller owns,
at the SDK's thread priority. The watcher keeps its own thread.
- An unexpected exception from a load is a failed load, and it is
retried. An `Error` is logged like any failure but arms no timed retry;
the next change reloads. A stack overflow while parsing a file is a
parse failure of that file, and a path that is not a regular file fails
before it is read.
- Every load sets the retry that it asks for, so the retry and its log
message always come from the latest load.
- The reloader's handler has only the apply callback. The error callback
had one implementation, an empty one in #224, because the reloader logs
every failure itself. Options that no caller used are gone too: skipping
unchanged content is always on, the retry delay must be positive, and
every load has a content digest.
- The poller Javadoc says to create it before the initial load, and the
`reloadNow` Javadoc says that loads run one at a time. #224 now starts
change detection before the initial load.
- Failure messages no longer quote file content, for the override source
and the existing file data source, in the log and in the data source
status. Neither keeps the parser's exception as the cause.
- A YAML syntax error gives SnakeYAML's problem and position, without
the quoted lines.
- A JSON syntax error gives Gson's problem and position, without the
JSON path, which can hold a value. A malformed `\u` escape also leaves
out the characters after `\u`.
- A YAML value that cannot be converted to the type that its tag names
fails without the value. For the file data source this is now a parse
failure, where the exception escaped the loader before.
- A string in a number property of an override entry fails without the
string, and every data model failure of an override entry names the flag
or segment.
- YAML files parsed at the same time no longer return each other's
documents: each parse has its own `Yaml` instance. The file data source
shared the same static instance.
- The watcher keeps watching after an unexpected exception. On macOS it
removes the overrides of a file whose directory is deleted (tested with
a scripted watch service, not run on macOS). It stops watching a
directory that no configured link leads into any more.
- The watcher Javadoc names what watching does not follow: a configured
directory replaced by rename, and a configured link whose target does
not exist yet.
- The empty JSON file message says how to remove the file's overrides:
delete the file or write `{}`.
- Verified with the v3.2.0-alpha.21 harness that CI runs, with `common`
2.6.0 and `internal` 1.15.0 published locally from `feat/overrides`:
- #220 itself builds against the released libraries, as CI builds it:
the server unit tests pass (2180, with the 72 existing skips), and the
full v3 contract tests pass (6369 tests ran), including the three FDv2
tests that failed in CI;
  - every PR in the stack compiles, with Javadoc, at its own head;
- the server unit tests pass at the top (2348, with the 72 existing
skips);
- the full v3 contract tests pass at the top (6457 tests ran). That
includes the flag overrides suite and both flag listener suites.

## Update, 2026-11-13

- Rebased onto `feat/overrides`, which now includes #218 and #219 and
has `main` merged into it. From `main` it gets the 7.18.0 release, CI on
the latest v3 contract tests, flag change listener support in the
contract test service, and the `java-sdk-internal` 1.12.1 and 1.12.2
fixes. A common 2.6.0 and internal 1.13.0 release from this branch needs
those fixes.
- New commit, "fix: Follow symbolic links when watching the override
files". In watching mode, the watcher counted only events that named a
configured file. A mounted Kubernetes ConfigMap updates its files by
swapping a `..data` link, so no event named the file and the update was
never picked up. A configured link to a file in another directory wasn't
followed either. Polling picked up both, and the Node, .NET, Python and
Ruby watchers follow these links.
- An event for another entry in a watched directory now counts when a
configured file, read through any symbolic link, leads to another file,
or its file's modification time or size changed. A busy sibling file
still costs no reload.
- The directory of each link's final target is watched too, and is found
again after every event. One that is deleted, like a ConfigMap's
previous version, is dropped instead of being retried with a warning.
- New `FileDataWatcherTest` cases cover a ConfigMap update, a change to
a link target in another directory, and a link pointed at a file in a
third directory. Three mutants each fail at least one of them: other
entries never count, target directories aren't watched, and a deleted
target directory is retried.
- Verified at the top of the stack, with `common` and `internal`
published locally from `feat/overrides`:
  - every PR in the stack compiles, with Javadoc, at its own head;
  - the server unit tests pass (2285, with the 72 existing skips);
- the full v3 contract tests pass (6321 tests). That includes the flag
overrides suite, with the deleted-entry tests of
launchdarkly/sdk-test-harness#599, and both flag listener suites.

## Summary

The flag overrides feature defined by the OVERRIDE specification needs a
file source that reloads reliably: coalesced change notifications, retry
after a failed read, retention of the last good data, sequential
reloads, support for files that do not exist yet, and files that are
rewritten in place. This change adds that infrastructure to the
integrations package for the file-based override source that follows.
The existing file data source keeps its current behavior, apart from the
parsing fixes in the 2026-12-01 update.

- `FileDataReloader` serializes reloads, debounces change signals with a
100 ms settle window, keeps the last good data on failure by not
applying, retries a failed load after one second, reports an identical
repeated failure once, and skips a reload whose content did not change.
Close never waits for an in-flight read. An exception from the apply
callback is reported like any other load failure and retried, and
nothing from that load is remembered. A load that holds an emptied file
back (below) applies nothing, reports no failure, and arms its retry for
the time the loader asks for; a failure still arms the normal retry. The
loader is told of every result that becomes the data in effect, applied
or skipped as unchanged, through `Loader.accepted`.
- `FileDataPoller` detects changes by examining each file's modification
time and size on a fixed interval, including a file that appears or
disappears. A change callback that throws is logged and polling
continues. Its `observe` is package-private, so that the loader reads a
file's state the same way, through symbolic links.
- `FileDataWatcher` watches parent directories through the file system
watch service and signals once after start so a change made between an
initial load and the start of watching is not missed. A directory that
is missing at start or deleted later is registered again on a one-second
schedule once it exists, and one change is signaled so the reload picks
up what was written meanwhile.
- `OverrideFileLoader` reads a list of files with the override source's
rules: a file that does not exist contributes no entries, entries keep
the versions that the documents specify, a value-only entry becomes a
flag that is on and serves the value by fallthrough, a document that
parses but holds a flag the model rejects is reported as a file data
error, and the result carries a per-file summary and a content digest of
each file's path, whether it exists, and its content.

### Format, encoding and empty files

The override loader chooses the parser by the file name: `.yaml` and
`.yml`, in any case, are YAML, and any other file, including one with no
extension, is JSON. The OVERRIDE spec (requirement 1.3.3, sdk-specs
#272) recommends the extension and lets an SDK whose file data source
inspects the content keep doing so; the override source is unreleased,
so it follows the extension, which lets the format decide whether an
empty file is valid.

- The text encoding is detected from a byte order mark (UTF-8 or UTF-16)
and is UTF-8 otherwise, for both formats, through SnakeYAML's
`UnicodeReader`. A UTF-32 file fails to parse, and the last good
overrides stay.
- An empty or white-space JSON file fails with `the file has no content,
which is not a JSON document`, and the last good overrides stay. An
empty JSON placeholder therefore fails the whole reload. A JSON document
that is not an object, such as `null` or `[]`, fails with `the JSON
document is not an object`.
- An empty YAML file, or YAML with only a comment or a `---` marker, is
a document with no entries.
- Compatibility with choosing by content: a JSON file in UTF-16, or in
UTF-8 with a byte order mark, still loads. JSON indented with tabs, or
with the escape `\/`, loads from a `.json` file; SnakeYAML, which reads
YAML 1.1, rejects it in a `.yaml` file.

### In-place rewrites

Applications and editors rewrite a file in place: they truncate it and
then write the new content. A load in between finds the file empty. A
YAML file can legitimately be empty, so its parser cannot tell an
emptied file from one in the middle of a rewrite. The loader keeps, for
each file, whether it contributed content to the data in effect (updated
by `accepted`), and, for a file whose content is in effect and that
loads have found empty, since when it has been empty without being
written, its state then (modification time and size, read through any
symbolic link, compared only for equality), and when a load first held
it back.

- A file whose content is not in effect, such as a placeholder or a file
whose empty state was applied, is parsed right away.
- Otherwise a new state restarts the file's delay, and the file is held
back while it has stayed empty for less than the retry delay R, and for
at most 5 R from the first load that held it back. The clock is read
after the file's own read, so a slow read of another file does not
shorten its delay. The hold asks for its retry when the first held
file's delay or bound is over, plus R/10, so that a timer that fires a
little early still finds the time over.
- A file's bound starts over only at a load that holds nothing back, for
every file that load read, whether the load is applied, skipped as
unchanged, or fails. A read with content, even content that fails to
parse, or a missing file ends the file's empty state, so its next
emptying starts a new delay even where a coarse modification time makes
it look the same.
- A load reads and classifies every configured file, also after a read
or parse failure, so files emptied together start their delays in the
same load. It then fails with the first failure; then holds files back;
and only then merges the entries, so a duplicate key or an entry that
the data model rejects cannot keep a later file from being read. A
holding load keeps the data in effect, including changes to the other
files, because a reload applies all the files or none.
- Elapsed times are differences of `System.nanoTime()` readings, which
do not overflow.

A rewrite is covered when the gap between truncating and writing is
shorter than the retry delay. Not changed: a read that sees YAML cut off
between two entries, after `flagValues:`, or inside an unquoted value
parses as valid YAML and is applied until the next reload; JSON cut off
anywhere fails to parse. Go still detects the format from the content;
Node chooses by extension case-sensitively, while this change, like
.NET, ignores case.

### The existing file data source

`FileDataSourceImpl`, `FileSynchronizer` and `FileInitializer` are
unchanged from `feat/overrides`. `FileDataSourceBase` changes only a
comment, and `FileDataException.getDescription` no longer throws when
there is no cause. `FileDataSourceParsing` gains, for the override
source: two `FlagFactory` methods that keep document versions;
`selectForPath` and `parseForPath` (extension and encoding); the
`NO_DOCUMENT` result that the YAML parser returns for content with no
document, which has all-null maps as before;
`JsonFlagFileParser.parse(Reader)`; and the two JSON rules above, which
the file data source cannot reach because it parses a file as JSON only
when it starts with `{`. `parse(InputStream)` keeps reading JSON in the
platform's default encoding for the file data source. The file data
source still requires every configured file to exist, assigns a load
version to every entry, expands a value-only entry to an on flag with a
single fallthrough variation, reloads on every watch event with no
debounce, no retry timer, and no skip, and reports every failure. Two
new test classes pin that behavior: `FileSynchronizerReloadBehaviorTest`
(identical rewrite emits another change set, every failed reload is
reported and logged as the plain description at error level, no retry
without a file change, missing file logged with the path) and
`FileDataLoadingBehaviorTest` (a model-rejected document escapes as a
`SerializationException`, and `FileDataException.getDescription` shows
the cause when there is one). The existing tests pass unmodified.

## Testing

- `OverrideFileLoaderTest`, on real files rewritten in place
(`InPlaceWrites`), with a test clock that crosses the `long` overflow:
the format by extension, empty and non-object JSON, YAML with no
document, the encoding (UTF-8 with and without a byte order mark,
UTF-16LE and UTF-16BE with one, a non-ASCII value), the hold at 0.95 R
and its end at exactly R, the requested retries, a new write restarting
the delay (also through a symbolic link), the per-file bound with one
file kept written and with files rewritten in turn or emptied in
staggered turns, the bound starting over at a load that holds nothing
back and not otherwise, a file read during another file's failure, the
fix of a file saved with a mistake or a duplicate key, the first failure
reported, the digest covering paths and presence.
- `FileDataReloaderTest` (scripted loader): a hold applies nothing,
reports nothing, and is retried after the time the loader asks for; a
failure arms the normal retry delay; `accepted` is called for applied
and unchanged results only.
- `FileDataReloaderEmptiedFileTest` (the reloader with the real loader
on real files): with a test clock and an hour-long retry delay, the
hold's end and the requested retry delays on both arming paths; with the
real clock, an emptied file held back and the rewrite applied with no
empty application in between, a file that stays empty applied by the
retry, two quick rewrites, a change to another file while one is empty,
a retry finding a second truncation, a file moved between configured
paths, the same bytes moved from `.yaml` to `.json`.
- The in-place rewrite handling was reviewed in eight rounds as #248
(general and adversarial reviews, Bugbot). Mutation check with a clean
build per mutant: 57 mutants, each failing at least one test. The
override test classes ran 12 times in a row with no failure.

[SDK-3246](https://launchdarkly.atlassian.net/browse/SDK-3246)
<!-- TERMAG_PR_BODY_END -->

<!-- termag: box=i-0575d1c54853058d7 project=java-core -->
<sub>Opened from termag</sub>

[SDK-3246]:
https://launchdarkly.atlassian.net/browse/SDK-3246?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> Adds **reload infrastructure** for the upcoming file-based flag
override source: **`FileDataReloader`** (serialized loads, 100ms
debounce, 1s retry, content-hash skip, empty-file deferral via
`EmptiedFileException`), **`FileDataPoller`** (interval mtime/size
polling), **`FileDataWatcher`** (directory watches with
symlink/ConfigMap-style updates, missing-directory retry), and
**`OverrideFileLoader`** (multi-file merge, extension-based JSON/YAML,
UTF BOM detection, in-place rewrite hold-back).
> 
> **Parsing changes** in `FileDataSourceParsing` support overrides:
parser selection by `.yaml`/`.yml`, safer error text (no quoted file
content in logs), per-parse YAML instances, `NO_DOCUMENT` for
comment-only YAML, and `FileDataException.getDescription()` fixed when
cause is null. The existing **file data source** behavior is largely
unchanged aside from those shared parsing fixes; new tests pin
synchronizer reload and loader error semantics.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9e9909b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants