Skip to content

fix: Stop sending the unsupported payload filter on FDv2 requests - #2249

Merged
joker23 merged 1 commit into
mainfrom
skz/sdk-3559/fdv2-no-payload-filter
Nov 25, 2026
Merged

joker23 merged 1 commit into
mainfrom
skz/sdk-3559/fdv2-no-payload-filter

Conversation

@joker23

@joker23 joker23 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

FDv2 streaming and polling requests carried a filter query parameter built from the configured payloadFilterKey, but the FDv2 endpoints do not support payload filtering. FDv2 data sources now use service endpoints without the filter key, so the parameter is no longer sent. FDv1 data sources and the FDv1 fallback synchronizer keep sending the filter.

Technical design decisions

  • FDv2 sources get a copy of the service endpoints with the filter key removed, instead of stripping the filter parameter from each built URL. The copy is built once and every FDv2 requestor and source factory uses it.
  • Per-source baseUri overrides scope from the filter-free endpoints. Sources without an override now receive those endpoints explicitly instead of falling back to the configured endpoints.
  • The FDv1 fallback synchronizer keeps the configured endpoints, so its requests still carry the filter.

Related tickets

  • sdk-3559
Details

Verification: unit tests, lint, and format checks pass for @launchdarkly/js-server-sdk-common, @launchdarkly/js-client-sdk-common, and @launchdarkly/js-client-sdk. Contract tests were not run.

Opened from termag


Note

Overview
payloadFilterKey is no longer wired into ServiceEndpoints when dataSystem (FDv2) is enabled. Client and server configuration now drop the filter on FDv2 setups and log a warning if a key was configured, so FDv2 polling/streaming requests stop carrying the unsupported filter query parameter. FDv1-only clients still pass the key through unchanged.

Docs and tests were updated to match: option text clarifies that FDv2 sources (including the FDv1 fallback used under FDv2) do not send the filter, and new coverage asserts FDv1 requests include filter=… while FDv2 fallback traffic hits unfiltered /sdk/latest-all URLs.

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

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 19254 bytes
Compressed size limit: 33000
Uncompressed size: 106414 bytes

@github-actions

github-actions Bot commented Nov 24, 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: 26523 bytes
Compressed size limit: 44000
Uncompressed size: 172776 bytes

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 34717 bytes
Compressed size limit: 35500
Uncompressed size: 124041 bytes

@joker23
joker23 force-pushed the skz/sdk-3559/fdv2-no-payload-filter branch from 15fb993 to b1f7fad Compare November 24, 2026 22:57
@joker23
joker23 marked this pull request as ready for review November 24, 2026 22:57
@joker23
joker23 requested a review from a team as a code owner November 24, 2026 22:57

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 1 potential issue.

Devin Review

Comment on lines +99 to +101
platform.requests.fetch = jest.fn(async (url: string) => {
const fallback = url.includes('/sdk/poll');
const headers = new Map(fallback ? [['x-ld-fd-fallback', 'true']] : []);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 No regression check for FDv2 URLs

The fallback test accepts /sdk/poll requests even when they contain filter. No new assertion checks that FDv2 polling or streaming omits the parameter when payloadFilterKey is set.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@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. Not approved: the change exceeds the low-risk approval threshold (SDK rules 1–3 would otherwise pass: not a release PR, allowed author, no disallowed workflow changes). Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

FDv2 streaming and polling sources in the server and client SDKs now use
service endpoints without the payload filter key, so they do not send ?filter=.
FDv1 data sources and the FDv1 fallback synchronizer keep sending the filter.

Generated-by: termag
@joker23
joker23 force-pushed the skz/sdk-3559/fdv2-no-payload-filter branch from b1f7fad to b71fc4d Compare November 25, 2026 17:39

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Devin Review

});
}

const payloadFilterKey = this.dataSystem ? undefined : validatedOptions.payloadFilterKey;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Undocumented fallback change in PR summary

The PR summary says FDv1 fallback keeps its filter. The fallback test expects unfiltered requests on both default and custom hosts.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

}
});

const payloadFilterKey = this.dataSystem ? undefined : pristineOptions.payloadFilterKey;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Shared manager relies on caller normalization

Built-in SDKs normalize endpoints here. Direct callers of createFDv2DataManagerBase still get a warning for filtered endpoints, but the manager forwards them unchanged.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@joker23
joker23 merged commit 60b89ad into main Nov 25, 2026
71 checks passed
@joker23
joker23 deleted the skz/sdk-3559/fdv2-no-payload-filter branch November 25, 2026 17:52
@github-actions github-actions Bot mentioned this pull request Nov 25, 2026
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.

2 participants