Skip to content

feat: warn that payload filtering has no effect with FDv2 - #434

Merged
beekld merged 5 commits into
mainfrom
devin/1788468880-fdv2-payload-filter-warning
Sep 8, 2026
Merged

feat: warn that payload filtering has no effect with FDv2#434
beekld merged 5 commits into
mainfrom
devin/1788468880-fdv2-payload-filter-warning

Conversation

@beekld

@beekld beekld commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Documents and warns that payload_filter_key has no effect when the FDv2 data system is used.

Closes SDK-2975.

  • Config#payload_filter_key docs now state payload filtering is unsupported with FDv2
  • The FDv2 data system logs a warning at construction when a filter key is configured
  • FDv1 behavior is unchanged; the shared option is not deprecated, since FDv1 still supports it

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

SDK-2975, part of SDK-2575. Same change as java-core#209, go-server-sdk#440 and python-server-sdk#518, adapted for the shared option.

Implementation details

Unlike Go and Java, Ruby has no FDv2-specific filter setter — payload_filter_key is a top-level option shared by FDv1 and FDv2 — so it cannot be deprecated without also deprecating supported FDv1 usage. Instead the attr_reader docs call out the FDv2 limitation and Impl::DataSystem::FDv2#initialize warns once when the option is set.

The FDv2 initializers/synchronizers still append ?filter= to their requests. That is intentional for now: on the delivery side, FDv2 reads the filter query param only for observability and never uses it to select a payload, so the parameter is inert rather than harmful. Dropping it would also break the environment_filter_key contract-test scenarios that the pinned harness (v3.0.0-alpha.6) still runs, requiring suppressions until the harness pin is bumped past sdk-test-harness#431. Removing the parameter belongs with that bump in the removal phase.

Testing: rubocop clean; rspec spec/impl/data_system/fdv2_datasystem_spec.rb. Note two FDv1-fallback examples in that file fail on main as well under some random seeds (mock doubles leaking across examples) — unrelated to this change.

Link to Devin session: https://app.devin.ai/sessions/ed604c6db94d452ea9f2dc35d6acc398
Open in Devin Desktop: https://app.devin.ai/desktop/session/ed604c6db94d452ea9f2dc35d6acc398?variant=devin
Requested by: @beekld


Note

Overview
Clarifies that payload_filter_key does not apply when the FDv2 data system is in use, and surfaces that at runtime so misconfiguration is visible.

Config documentation for payload_filter_key now states that payload filtering is unsupported with FDv2 and has no effect on FDv2 requests. Impl::DataSystem::FDv2 logs a warning during construction when a filter key is set; FDv1 streaming/polling behavior is unchanged and the option is not deprecated.

Specs assert the warning is emitted only when payload_filter_key is configured.

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

Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@beekld
beekld marked this pull request as ready for review September 4, 2026 20:54
@beekld
beekld requested a review from a team as a code owner September 4, 2026 20:54
@devin-ai-integration

Copy link
Copy Markdown
Contributor

The build-linux (jruby-9.4) failure is unrelated to this change: spec/impl/data_system/fdv2_datasystem_spec.rb is timing-flaky. Running that spec file on origin/main (af79a96, no changes from this branch) fails too, with a different pair of examples each run:

16 examples, 2 failures
rspec ./spec/impl/data_system/fdv2_datasystem_spec.rb:469 # ... does not fall back to FDv1 when fallback_to_fdv1 is false
rspec ./spec/impl/data_system/fdv2_datasystem_spec.rb:266 # ... shuts down data source when both primary and secondary fail

The two examples added by this PR pass consistently. I don't have permission to re-run the failed job; a maintainer re-run should clear it.

beekld added a commit to launchdarkly/js-core that referenced this pull request Sep 8, 2026
Documents that the shared `payloadFilterKey` option has no effect with
the FDv2 data system, and logs a warning when it's configured alongside
FDv2.

Closes [SDK-2974](https://launchdarkly.atlassian.net/browse/SDK-2974),
part of [SDK-2575](https://launchdarkly.atlassian.net/browse/SDK-2575).

- `payloadFilterKey` remains fully supported for FDv1, so the option
itself is neither deprecated nor removed.
- Server-side warning is emitted from `constructFDv2`; client-side
warning from the shared `createFDv2DataManagerBase` (covers browser,
react-native and node-client).
- The `?filter=` query param is still sent on FDv2 requests during this
deprecation period; the FDv2 backend path doesn't use it to select the
payload.

**Requirements**

- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's [pull request submission
guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [x] I have validated my changes against all supported platform
versions

<details>
<summary>Implementation details</summary>

**Related issues**

Follows the same approach as the Go (launchdarkly/go-server-sdk#440) and
Java (launchdarkly/java-core#209) deprecations, and the parallel Python
(launchdarkly/python-server-sdk#518) / Ruby
(launchdarkly/ruby-server-sdk#434) PRs. Payload-filter scenarios for
FDv2 were removed from the test harness in
launchdarkly/sdk-test-harness#431.

**Describe the solution you've provided**

- `packages/shared/sdk-server/src/api/options/LDOptions.ts` and
`packages/shared/sdk-client/src/api/LDOptions.ts`: doc comments note
that payload filtering isn't supported with FDv2.
- `packages/shared/sdk-server/src/LDClientImpl.ts`: warns in
`constructFDv2` when `payloadFilterKey` is configured.
- `packages/shared/sdk-client/src/datasource/FDv2DataManagerBase.ts`:
warns when `serviceEndpoints.payloadFilterKey` is configured.
Centralizing it here covers every client-side SDK, since browser,
react-native and node-client all build on this manager.

**Describe alternatives you've considered**

- Deprecating or removing the option outright: rejected, since it's
shared with FDv1 where it's still supported.
- Dropping `?filter=` from FDv2 request URLs now: deferred to the
removal phase so this change is behavior-preserving.

**Additional context**

Verified: `yarn workspace @launchdarkly/js-server-sdk-common test` (53
suites, 1022 passed) and `lint`; `yarn workspace
@launchdarkly/js-client-sdk-common test` (57 suites, 866 passed) and
`lint`.

</details>


Link to Devin session:
https://app.devin.ai/sessions/ed604c6db94d452ea9f2dc35d6acc398
Open in Devin Desktop:
https://app.devin.ai/desktop/session/ed604c6db94d452ea9f2dc35d6acc398?variant=devin
Requested by: @beekld

[SDK-2974]:
https://launchdarkly.atlassian.net/browse/SDK-2974?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SDK-2575]:
https://launchdarkly.atlassian.net/browse/SDK-2575?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> When **`payloadFilterKey`** is set while using the **FDv2 data
system**, the SDK now **logs a warning** that payload filtering is
unsupported and has **no effect** on FDv2 requests. **`payloadFilterKey`
is unchanged for FDv1** and is not removed or deprecated.
> 
> Warnings are emitted at **server** FDv2 setup in **`constructFDv2`**
(`LDClientImpl`) and at shared **client** FDv2 setup in
**`createFDv2DataManagerBase`** (browser, React Native, node-client).
**LDOptions** doc comments on client and server now state the same
limitation.
> 
> Tests cover both code paths (warn when a filter key is present, no
matching warn when absent).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
cfaa48b. 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: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@beekld
beekld merged commit fbe6fb4 into main Sep 8, 2026
10 checks passed
@beekld
beekld deleted the devin/1788468880-fdv2-payload-filter-warning branch September 8, 2026 21:16
jsonbailey pushed a commit that referenced this pull request Sep 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[8.17.0](8.16.0...8.17.0)
(2026-09-08)


### Features

* warn that payload filtering has no effect with FDv2
([#434](#434))
([fbe6fb4](fbe6fb4))


### Bug Fixes

* Stop repeating tasks promptly instead of waiting out the sleep
([#432](#432))
([b4baad3](b4baad3))

---
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 8.17.0** — bumps the SDK from `8.16.0` to `8.17.0` in
`version.rb`, `.release-please-manifest.json`, and the `SDK_VERSION`
example in `PROVENANCE.md`, and adds the **8.17.0** section to
`CHANGELOG.md`.
> 
> That changelog records two behavioral changes already merged for this
release: a **warning** when `payload_filter_key` is set while using the
FDv2 data system (filtering does not apply), and a fix so
**`RepeatingTask#stop`** wakes background workers immediately via a stop
event instead of waiting out the interval sleep (faster shutdown for
polling, big segments, etc.).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
142719c. 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants