Repository navigation
fix: Clear selectorless FDv2 state in client and server SDKs - #640
Conversation
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
Risk: medium.
Automated risk review (dry run): Medium
This PR would not be automatically approved. Human approval required.
Why: This changes live FDv2 selector handling in libs/internal/src/fdv2_protocol_handler.cpp and libs/server-sdk/src/data_systems/fdv2/fdv2_data_system.cpp, so empty payload state now omits basis and can clear a held selector on both client and server SDKs. That is a data-sync behavior change across interacting protocol and data-system pieces, so it is not Low.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-cpp-client: 3.13.3</summary> ## [3.13.3](launchdarkly-cpp-client-v3.13.2...launchdarkly-cpp-client-v3.13.3) (2026-11-18) ### Bug Fixes * Clear selectorless FDv2 state in client and server SDKs ([#640](#640)) ([6d755d9](6d755d9)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-internal bumped from 0.16.1 to 0.16.2 </details> <details><summary>launchdarkly-cpp-internal: 0.16.2</summary> ## [0.16.2](launchdarkly-cpp-internal-v0.16.1...launchdarkly-cpp-internal-v0.16.2) (2026-11-18) ### Bug Fixes * Clear selectorless FDv2 state in client and server SDKs ([#640](#640)) ([6d755d9](6d755d9)) </details> <details><summary>launchdarkly-cpp-server: 3.15.3</summary> ## [3.15.3](launchdarkly-cpp-server-v3.15.2...launchdarkly-cpp-server-v3.15.3) (2026-11-18) ### Bug Fixes * Clear selectorless FDv2 state in client and server SDKs ([#640](#640)) ([6d755d9](6d755d9)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-internal bumped from 0.16.1 to 0.16.2 </details> <details><summary>launchdarkly-cpp-server-dynamodb-source: 0.3.6</summary> ## [0.3.6](launchdarkly-cpp-server-dynamodb-source-v0.3.5...launchdarkly-cpp-server-dynamodb-source-v0.3.6) (2026-11-18) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-server bumped from 3.15.2 to 3.15.3 </details> <details><summary>launchdarkly-cpp-server-otel: 0.1.10</summary> ## [0.1.10](launchdarkly-cpp-server-otel-v0.1.9...launchdarkly-cpp-server-otel-v0.1.10) (2026-11-18) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-server bumped from 3.15.2 to 3.15.3 </details> <details><summary>launchdarkly-cpp-server-redis-source: 2.4.6</summary> ## [2.4.6](launchdarkly-cpp-server-redis-source-v2.4.5...launchdarkly-cpp-server-redis-source-v2.4.6) (2026-11-18) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-server bumped from 3.15.2 to 3.15.3 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release Please** cut that publishes patch releases across the C++ SDK monorepo. The diff is almost entirely **version and dependency bumps** (`.release-please-manifest.json`, `CMakeLists.txt`, `package.json`, embedded `Version()` strings, and matching test assertions). > > **`@launchdarkly/cpp-internal` 0.16.2** is the functional release; **client 3.13.3** and **server 3.15.3** pick it up via dependency bumps. Changelogs record bug fix **#640**: clearing **selectorless FDv2 state** in client and server SDKs. **Redis**, **DynamoDB**, and **OTel** integration packages are re-released only because they depend on **server 3.15.3**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2521291. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>


Summary
launchdarkly/ld-relay#979 serves FDv2 full transfers that carry no selector:
payload-transferred {"state":"","version":0}. The SDKs stored the empty state as a present selector, so both the polling path (params().append({"basis", ...})) and the streaming path (params().set("basis", ...)) sent an emptybasis=. The contract test that covers this is launchdarkly/sdk-test-harness#600.libs/internal/src/fdv2_protocol_handler.cpp(shared by client and server): an empty transferredstatenow produces an absent selector, so poll and stream URLs leave outbasis.libs/server-sdk/.../fdv2_data_system.cpp: when a payload arrives without a selector, the selector the SDK was holding is cleared. A no-change response still keeps it.Verification
client_impl.cpponly builds FDv1 or null sources), so the harness can't reach this code path. The client change is covered by unit tests only.Link to Devin session: https://app.devin.ai/sessions/f3b22e19bdde48f1b39f77808077390b
Open in Devin Desktop: https://app.devin.ai/desktop/session/f3b22e19bdde48f1b39f77808077390b?variant=devin
Requested by: @kinyoklion
SDK-3596
Note
Overview
Fixes FDv2 handling when the server completes a full transfer with empty
payload-transferredstate (state="",version=0). The sharedFDv2ProtocolHandlernow treats an empty transferred state as an absent selector instead of a selector with an empty string, so subsequent poll URLs no longer send a bogusbasis=query parameter.On the server SDK,
FDv2DataSystem::ApplyChangeSetnow updates the held synchronizer selector when a changeset has a real selector or when the changeset type is notkNone. That clears the stored basis after a selectorless full sync while akNone(e.g. 304) response still preserves the previous selector.Unit tests cover the protocol handler, client/server poll request building, and server data-system selector handoff.
Reviewed by Cursor Bugbot for commit 704abfa. Bugbot is set up for automated code reviews on this repo. Configure here.