Skip to content

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

Merged
beekld merged 11 commits into
mainfrom
bklimt/SDK-3032/client-fdv2-orchestrator
Oct 5, 2026
Merged

beekld merged 11 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
Adds FDv2DataSource to the client SDK: an IDataSource orchestrator that chains initializers (basis + optional inline cache load on Start()), then synchronizers with fallback/recovery timers, status reporting, environment ID, and from_cache on applies. Shutdown/GuardShutdown blocks late results from overwriting store or status after identify-style restarts.

Shared FDv2 orchestration moves from the server SDK into libs/internal (Conditions, templated SourceManager, condition interfaces). Conditions now take a reduced SourceSignal instead of full source results; server FDv2DataSystem is updated to classify results and link the internal library (local conditions/source_manager sources removed).

Adds broad client unit tests for lifecycle, initializer/synchronizer phases, cache-only mode, and tier rotation; internal tests adjusted for the new APIs. Minor .gitignore entries for .env and .claude.

Reviewed by Cursor Bugbot for commit 223736f. 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.

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 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 2 times, most recently from 56b64c8 to d43a97c Compare September 24, 2026 21:29
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 Outdated
#include <vector>

namespace launchdarkly::server_side::data_systems {
namespace launchdarkly::internal::data_sources {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should these be internal::data_system?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. And I'll clean up the similar inconsistencies in the other files in a later step.

Comment thread libs/client-sdk/src/data_sources/fdv2/fdv2_data_source.cpp Outdated

@kinyoklion kinyoklion left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved, but a couple comments inline for things that might need addressed.

@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 6e354b4. 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 9b7fdd4 to 912d436 Compare October 2, 2026 23:36
@beekld
beekld removed this pull request from stack #608 October 3, 2026 01:24
@beekld
beekld force-pushed the bklimt/SDK-3032/client-fdv2-orchestrator branch from ee65761 to 223736f Compare October 5, 2026 18:00
@beekld
beekld added this pull request to stack #627 October 5, 2026 18:00
@beekld
beekld removed this pull request from stack #627 October 5, 2026 18:05
@beekld
beekld added this pull request to stack #628 October 5, 2026 18:10
@beekld
beekld removed this pull request from stack #628 October 5, 2026 19:18
@beekld
beekld added this pull request to stack #629 October 5, 2026 19:24
@beekld
beekld merged commit 7633334 into main Oct 5, 2026
53 checks passed
@beekld
beekld deleted the bklimt/SDK-3032/client-fdv2-orchestrator branch October 5, 2026 23:25
@github-actions github-actions Bot mentioned this pull request Oct 5, 2026
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.

2 participants