Repository navigation
feat: Add the FDv2 data source orchestrator to the client SDK - #612
Conversation
e03fed7 to
d3da070
Compare
22c46d4 to
ae8dc46
Compare
7d79b26 to
c3faa16
Compare
c3faa16 to
b53a79c
Compare
b53a79c to
f52848a
Compare
|
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. |
f52848a to
b387a57
Compare
|
Okay, I think I fixed the fence issues by adding a future that gets taken and not resolved until any outstanding writes finish. |
ab7869c to
4b40610
Compare
4b40610 to
bb64e46
Compare
56b64c8 to
d43a97c
Compare
| #include <vector> | ||
|
|
||
| namespace launchdarkly::server_side::data_systems { | ||
| namespace launchdarkly::internal::data_sources { |
There was a problem hiding this comment.
Should these be internal::data_system?
There was a problem hiding this comment.
Done. And I'll clean up the similar inconsistencies in the other files in a later step.
kinyoklion
left a comment
There was a problem hiding this comment.
Approved, but a couple comments inline for things that might need addressed.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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.
9b7fdd4 to
912d436
Compare
ee65761 to
223736f
Compare

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:
Also moves the shared orchestration primitives out of the server SDK into
libs/internalso 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.Note
Overview
Adds
FDv2DataSourceto the client SDK: anIDataSourceorchestrator that chains initializers (basis + optional inline cache load onStart()), then synchronizers with fallback/recovery timers, status reporting, environment ID, andfrom_cacheon applies. Shutdown/GuardShutdownblocks late results from overwriting store or status after identify-style restarts.Shared FDv2 orchestration moves from the server SDK into
libs/internal(Conditions, templatedSourceManager, condition interfaces). Conditions now take a reducedSourceSignalinstead of full source results; serverFDv2DataSystemis updated to classify results and link the internal library (localconditions/source_managersources 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
.gitignoreentries for.envand.claude.Reviewed by Cursor Bugbot for commit 223736f. Bugbot is set up for automated code reviews on this repo. Configure here.