Skip to content

fix: Clear selectorless FDv2 state in client and server SDKs - #640

Merged
kinyoklion merged 1 commit into
mainfrom
devin/1794591018-fdv2-selectorless
Nov 18, 2026
Merged

kinyoklion merged 1 commit into
mainfrom
devin/1794591018-fdv2-selectorless

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

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 empty basis=. 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 transferred state now produces an absent selector, so poll and stream URLs leave out basis.
  • 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.
  • Behavior with a real selector, and initialization, are unchanged.

Verification

  • Beast and CURL out-of-source builds succeed. The internal, server, and client unit suites pass on both (292, 573, and 219 tests).
  • Server contract service: the selectorless group from sdk-test-harness#600 passes 5/5 on both backends.
  • Client contract tests were not exercised. The client contract service doesn't wire up FDv2 (client_impl.cpp only 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-transferred state (state="", version=0). The shared FDv2ProtocolHandler now 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 bogus basis= query parameter.

On the server SDK, FDv2DataSystem::ApplyChangeSet now updates the held synchronizer selector when a changeset has a real selector or when the changeset type is not kNone. That clears the stored basis after a selectorless full sync while a kNone (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.

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@kinyoklion
kinyoklion marked this pull request as ready for review November 18, 2026 19:22
@kinyoklion
kinyoklion requested a review from a team as a code owner November 18, 2026 19:22
@cursor cursor Bot added the risk:medium label Nov 18, 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.

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.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@kinyoklion
kinyoklion merged commit 6d755d9 into main Nov 18, 2026
58 checks passed
@kinyoklion
kinyoklion deleted the devin/1794591018-fdv2-selectorless branch November 18, 2026 20:06
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
kinyoklion pushed a commit that referenced this pull request Nov 18, 2026
🤖 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants