Skip to content

feat: add FDv2 configuration builder#545

Open
beekld wants to merge 51 commits into
mainfrom
beeklimt/SDK-2100
Open

feat: add FDv2 configuration builder#545
beekld wants to merge 51 commits into
mainfrom
beeklimt/SDK-2100

Conversation

@beekld

@beekld beekld commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Adds a public FDv2Builder and wires the FDv2 data system into MakeDataSystem, so end users can opt into the FDv2 protocol via the existing config-builder pattern.

// Default FDv2 stack (streaming primary, polling fallback,
// FDv1 streaming last-resort)
auto config = ConfigBuilder("sdk-key-123")
    .DataSystem().Method(DataSystemBuilder::FDv2())
    /* ... */;

// Customised: payload filter + shorter fallback timeout, no FDv1 fallback
auto config = ConfigBuilder("sdk-key-123")
    .DataSystem().Method(
        DataSystemBuilder::FDv2()
            .Streaming(FDv2Builder::StreamingSource().Filter("mobile-flags"))
            .FallbackTimeout(std::chrono::seconds{30})
            .DisableFDv1Fallback())
    /* ... */;

Test plan

  • 5 new FDv2 builder tests in config_builder_test.cpp
  • Full server suite green (503 tests)

Note

Medium Risk
Changes how the client selects and instantiates flag data sources (new FDv2 path and factory wiring); misconfiguration could affect connectivity and fallback behavior, though default remains background sync.

Overview
FDv2 is now a selectable data system via DataSystemBuilder::Method(FDv2Builder), alongside background sync and lazy load. Public FDv2Builder (Default() / Custom()) configures polling initializers, ordered streaming/polling synchronizers, optional FDv1 fallback, and fallback/recovery timeouts; built config adds FDv2Config with per-source filter and BaseUrl overrides.

Runtime wiring: MakeDataSystem constructs FDv2DataSystem through new initializer and synchronizer factories (FDv2 polling/streaming plus FDv1 adapter factories). FDv2 poll/stream components now take a resolved base URL string (override or service endpoints) instead of full ServiceEndpoints.

Tests cover FDv2 builder defaults, synchronizer ordering, FDv1 fallback, timeouts, and base URL overrides; existing FDv2 HTTP tests updated for the new poll-request API.

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

@beekld beekld force-pushed the beeklimt/SDK-2379-4 branch from cce4172 to 458539d Compare June 4, 2026 00:53
@beekld beekld force-pushed the beeklimt/SDK-2100 branch from 3981ee7 to 4d3a6c8 Compare June 4, 2026 00:53
@beekld beekld force-pushed the beeklimt/SDK-2379-4 branch from 458539d to 5aace2f Compare June 4, 2026 21:54
@beekld beekld force-pushed the beeklimt/SDK-2100 branch 2 times, most recently from 095280a to 58392f8 Compare June 4, 2026 23:43
@beekld beekld force-pushed the beeklimt/SDK-2379-4 branch from 5aace2f to 5988ce1 Compare June 4, 2026 23:43
@beekld beekld force-pushed the beeklimt/SDK-2100 branch from 58392f8 to aaf3aa6 Compare June 4, 2026 23:51
@beekld beekld force-pushed the beeklimt/SDK-2379-4 branch from 5988ce1 to 88190bc Compare June 4, 2026 23:51
@beekld beekld force-pushed the beeklimt/SDK-2379-4 branch from 88190bc to 86b2e3d Compare June 5, 2026 18:07
@beekld beekld force-pushed the beeklimt/SDK-2100 branch from aaf3aa6 to 9bb657e Compare June 5, 2026 18:07
beekld added a commit that referenced this pull request Jun 12, 2026
@beekld beekld changed the base branch from beeklimt/SDK-2379-4 to beeklimt/SDK-2515 June 12, 2026 21:40
beekld added a commit that referenced this pull request Jun 12, 2026
beekld added a commit that referenced this pull request Jun 15, 2026
@beekld beekld marked this pull request as ready for review June 15, 2026 23:42
@beekld beekld requested a review from a team as a code owner June 15, 2026 23:42
class Streaming {
public:
Streaming& InitialReconnectDelay(std::chrono::milliseconds delay);
Streaming& Filter(std::string filter_key);

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.

The FDv2 endpoints don't support filters as far as I am aware. Instead we are depending on view keys.

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.

Base automatically changed from beeklimt/SDK-2515 to main June 16, 2026 17:57
beekld added a commit that referenced this pull request Jun 16, 2026

@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 13bdf20. Configure here.

Comment thread libs/server-sdk/src/config/builders/data_system/fdv2_builder.cpp
# Conflicts:
#	libs/server-sdk/src/client_impl.cpp
beekld added a commit that referenced this pull request Jun 16, 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