feat: deprecate FDv2 payload filter builder methods - #209
Merged
Conversation
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
jsonbailey
approved these changes
Sep 2, 2026
3 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deprecates the FDv2-specific
payloadFilterbuilder methods, since payload filtering is not supported with the FDv2 data system.Closes SDK-2971, part of SDK-2575.
FDv2StreamingSynchronizerBuilder.payloadFilter,FDv2PollingSynchronizerBuilder.payloadFilterandFDv2PollingInitializerBuilder.payloadFilterare now@Deprecated.buildtime when a payload filter is configured, matching feat: deprecate FDv2 payload filter builder methods go-server-sdk#440.StreamingDataSourceBuilder/PollingDataSourceBuilderfilter APIs are untouched.dataSystem.payloadFilterwiring in the contract test service) is left for a follow-up.Implementation details
The contract test harness removed the FDv2 payload filter scenarios (launchdarkly/sdk-test-harness#431), so the public FDv2 filter surface is going away across SDKs. This PR is the deprecation step only, keeping the change non-breaking; the contract test service still maps
dataSystem.payloadFilterinto these builders, which is why they aren't removed yet.Unlike Go, Java never rejected an empty filter string (
DefaultFDv2RequestorandStreamingSynchronizerImplalready skip null/empty), so no validation change was needed here.New
DataSystemComponentsTestcovers the warning for all three builders and its absence when no filter is set. Verified with./lib/sdk/server/gradlew -p lib/sdk/server test --tests '*DataSystemComponentsTest*'andcompileJava javadoc.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
Marks
payloadFilteron the FDv2 polling initializer, polling synchronizer, and streaming synchronizer builders as@Deprecated, with Javadoc stating FDv2 does not support payload filtering and the API will be removed later.When any of those builders
build()with a non-null filter,DataSystemComponentsnow logs a WARN that filtering is unsupported and will stop being applied in a future release (aligned with the Go server SDK). Runtime behavior is unchanged for now—the filter is still passed through to requestors/synchronizers.Adds
DataSystemComponentsTestto assert the warning appears for all three builders when a filter is set, and does not appear when it is not. FDv1 data sourcepayloadFilterAPIs are not modified in this PR.Reviewed by Cursor Bugbot for commit c092305. Bugbot is set up for automated code reviews on this repo. Configure here.