Skip to content

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

Open
beekld wants to merge 2 commits into
mainfrom
devin/1788469172-fdv2-payload-filter-warning
Open

feat: warn that payload filtering has no effect with FDv2#1984
beekld wants to merge 2 commits into
mainfrom
devin/1788469172-fdv2-payload-filter-warning

Conversation

@beekld

@beekld beekld commented Sep 3, 2026

Copy link
Copy Markdown

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, part of 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

  • 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
Implementation details

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.

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
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).

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

Payload filtering is not supported with the FDv2 data system. Document
that on the shared payloadFilterKey option and log a warning when it is
configured alongside an FDv2 data system.

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

@devin-ai-integration devin-ai-integration Bot added the devin-pr PRs created by Devin AI label Sep 3, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@cursor review

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26360 bytes
Compressed size limit: 29000
Uncompressed size: 129188 bytes

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25571 bytes
Compressed size limit: 44000
Uncompressed size: 166117 bytes

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 32550 bytes
Compressed size limit: 34000
Uncompressed size: 116654 bytes

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 180073 bytes
Compressed size limit: 200000
Uncompressed size: 833835 bytes

@beekld
beekld marked this pull request as ready for review September 4, 2026 20:56
@beekld
beekld requested a review from a team as a code owner September 4, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr PRs created by Devin AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants