chore: adds TestDataV2 to implement Synchronizer#124
Merged
tanderson-ld merged 11 commits intomainfrom Feb 4, 2026
Merged
Conversation
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/TestData.java
Outdated
Show resolved
Hide resolved
tanderson-ld
commented
Feb 2, 2026
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/TestDataV2.java
Outdated
Show resolved
Hide resolved
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/TestDataV2.java
Show resolved
Hide resolved
lib/sdk/server/src/test/java/com/launchdarkly/sdk/server/integrations/TestDataV2Test.java
Outdated
Show resolved
Hide resolved
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/TestDataV2.java
Show resolved
Hide resolved
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/integrations/TestData.java
Show resolved
Hide resolved
kinyoklion
reviewed
Feb 3, 2026
| case INITIALIZING: | ||
| default: | ||
| // VALID and INITIALIZING do not map to FDv2 status events (same as DataSourceSynchronizerAdapter) | ||
| statusResult = null; |
Member
There was a problem hiding this comment.
For valid do we need to have a "none" changeset push?
kinyoklion
approved these changes
Feb 3, 2026
…n. (#128) <!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Touches core FDv2 data-source result consumption and introduces new callback/lifecycle semantics that could affect threading or resource cleanup if misused; behavior is covered with new integration tests but remains concurrency-sensitive. > > **Overview** > Adds **consumption completion reporting** for FDv2 results by making `FDv2SourceResult` `Closeable`, adding an optional completion callback plus `withCompletion()`, and updating `FDv2DataSource` to use try-with-resources when handling initializer/synchronizer results so callbacks reliably fire. > > Refactors `TestDataV2` to use this mechanism (wrapping results with per-synchronizer completions, switching its internal queueing to `IterableAsyncQueue`, and removing the old polling-based `awaitPropagation` helper), and adds `TestDataV2WithClientTest` to assert initialization, flag updates/deletes, rule/target behavior, status updates, and multi-client propagation. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 08f24e2. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
Requirements
Note
Medium Risk
Touches FDv2 core result handling (
FDv2SourceResultlifecycle andFDv2DataSourceprocessing), so incorrect closing/callback behavior could affect all FDv2 synchronizers; changes are mostly additive and covered by new tests.Overview
Adds
TestDataV2, a new test-only FDv2Synchronizerdata source that can emit an initial fullChangeSetand subsequent partial updates/tombstones viaupdate(),delete(),updateStatus(), and optional persistence control (shouldPersist).To support backpressure/ack semantics,
FDv2SourceResultis nowCloseableand can carry/combine completion callbacks viawithCompletion(), andFDv2DataSourceis updated to alwaystry-with-resourcesclose results from initializers/synchronizers. Tests are updated to assert correct versioning, and new unit/integration tests coverTestDataV2behavior and end-to-end usage withLDClient.Written by Cursor Bugbot for commit 4f26ccf. This will update automatically on new commits. Configure here.