Skip to content

feat: Add the FDv2 streaming synchronizer to the client SDK - #611

Open
beekld wants to merge 7 commits into
bklimt/SDK-3030/client-fdv2-pollingfrom
bklimt/SDK-3031/client-fdv2-streaming
Open

beekld wants to merge 7 commits into
bklimt/SDK-3030/client-fdv2-pollingfrom
bklimt/SDK-3031/client-fdv2-streaming

Conversation

@beekld

@beekld beekld commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the client SDK's FDv2 streaming synchronizer.

Implemented here:

  • The SSE stream reader, driving FDv2ProtocolHandler into source results.
  • Per-connect request construction, goodbye and ping handling, and response-header parsing.
  • SSE error classification into Interrupted and TerminalError.

Differences from the Android and Flutter clients:

  • Ping: this SDK drops a ping that arrives while an answering poll is in flight, where Flutter coalesces overlapping pings into one follow-up poll and Android blocks the stream thread on a synchronous poll.

Note

Overview
Adds FDv2StreamingSynchronizer to the client SDK so FDv2 flag updates can stay current over a long-lived SSE connection, exposed through the same IFDv2Synchronizer::Next() pull interface as polling.

The synchronizer builds /sdk/stream/eval requests (GET with base64 context in the path or POST with JSON body), applies basis from the latest selector on each connect, and drives FDv2ProtocolHandler to emit ChangeSet, Goodbye, Interrupted, and TerminalError results. ping events trigger a follow-up poll (overlapping pings are dropped while a poll is in flight). Response headers and goodbye payloads surface environment id and FDv1 fallback directives, with stream-level TTL overriding headers.

Also adds a ReadFDv2ResponseHeaders overload for Boost.Beast response headers, links launchdarkly::sse in client SDK tests, adds broad unit coverage via a test peer, tweaks server-sdk test mocks/formatting, and makes SSE read timeout log messages omit the duration when no timeout value is present.

Reviewed by Cursor Bugbot for commit bd73ba9. 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-3031/client-fdv2-streaming branch from fbb9f5d to 99ba021 Compare September 11, 2026 21:23
@beekld
beekld marked this pull request as ready for review September 11, 2026 21:49
@beekld
beekld requested a review from a team as a code owner September 11, 2026 21:49

@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 9c5c071. Configure here.

Comment thread libs/client-sdk/src/data_sources/fdv2/streaming_synchronizer.cpp
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