Skip to content

feat: Add the FDv2 data source orchestrator to the client SDK - #612

Open
beekld wants to merge 8 commits into
mainfrom
bklimt/SDK-3032/client-fdv2-orchestrator
Open

beekld wants to merge 8 commits into
mainfrom
bklimt/SDK-3032/client-fdv2-orchestrator

Conversation

@beekld

@beekld beekld commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the client SDK's FDv2 data source -- the orchestrator that runs initializers to load a basis, then rotates synchronizers to keep it current.

Implemented here:

  • Runs initializers to a basis, then rotates synchronizers on fallback and recovery conditions.
  • Reports data-source status, records the environment id, and tags applied data as cache- or network-sourced.

Also moves the shared orchestration primitives out of the server SDK into libs/internal so both SDKs can share them. That server change is a behavior-neutral relocation.

Notes:

  • Start() blocks on cache initialization, so cached flags are immediately evaluable. This matches the behavior of the FDv1 client. It also matches Android. However, Flutter loads the cache asynchronously instead.
  • FDv1 fallback directive handling is out of scope.

Note

Overview
Introduces FDv2DataSource for the client SDK: it chains initializers (including synchronous cache loads before Start() returns), then synchronizers with fallback/recovery conditions, applies changesets to the flag store, publishes data-source status, tracks environment id, and marks cache vs network applies. Shutdown is guarded so late results cannot overwrite a replacement source after identify.

Shared FDv2 orchestration (Conditions, SourceManager, condition interfaces) moves from the server SDK into libs/internal, under launchdarkly::internal::data_sources. Conditions now take a SourceSignal enum instead of full synchronizer results; SourceManager is a header-only template usable by both SDKs. The server FDv2DataSystem is updated to consume the shared headers (behavior-neutral relocation aside from the signal mapping).

Adds broad unit tests for the client orchestrator and adjusts internal/server tests for the new namespaces and APIs. .gitignore ignores .env and .claude.

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

@beekld
beekld added this pull request to stack #608 September 11, 2026 18:04
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from e03fed7 to d3da070 Compare September 11, 2026 21:23
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch 2 times, most recently from 22c46d4 to ae8dc46 Compare September 12, 2026 00:21
@beekld
beekld marked this pull request as ready for review September 12, 2026 00:21
@beekld
beekld requested a review from a team as a code owner September 12, 2026 00:21

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

Stale Bugbot comment from a previous run.

Comment thread libs/client-sdk/src/data_sources/fdv2/fdv2_data_source.cpp
Comment thread libs/client-sdk/src/data_sources/fdv2/fdv2_data_source.cpp
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch 2 times, most recently from 7d79b26 to c3faa16 Compare September 16, 2026 20:56

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

Stale Bugbot comment from a previous run.

Comment thread libs/client-sdk/src/data_sources/fdv2/fdv2_data_source.cpp
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from c3faa16 to b53a79c Compare September 16, 2026 21:25
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from b53a79c to f52848a Compare September 17, 2026 00:03
@beekld

beekld commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

This PR needs some more work on thread safety. Because the store can outlive the data source, the mechanism that worked in the server code isn't 100% sufficient for client code. I'll comment again when it's ready.

@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from f52848a to b387a57 Compare September 17, 2026 22:09
@beekld

beekld commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Okay, I think I fixed the fence issues by adding a future that gets taken and not resolved until any outstanding writes finish.

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b387a57. Configure here.

Comment thread libs/client-sdk/src/data_sources/fdv2/fdv2_data_source.cpp
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from ab7869c to 4b40610 Compare September 18, 2026 16:57
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from 4b40610 to bb64e46 Compare September 24, 2026 21:14
Base automatically changed from bklimt/SDK-3031/client-fdv2-streaming to main September 24, 2026 21:26
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from bb64e46 to 56b64c8 Compare September 24, 2026 21:26
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from 56b64c8 to d43a97c Compare September 24, 2026 21:29

This branch has not been deployed

No deployments
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