Repository navigation
fix: Stop sending the unsupported payload filter on FDv2 requests - #2249
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
15fb993 to
b1f7fad
Compare
| platform.requests.fetch = jest.fn(async (url: string) => { | ||
| const fallback = url.includes('/sdk/poll'); | ||
| const headers = new Map(fallback ? [['x-ld-fd-fallback', 'true']] : []); |
There was a problem hiding this comment.
There was a problem hiding this comment.
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.
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
b1f7fad to
b71fc4d
Compare
| }); | ||
| } | ||
|
|
||
| const payloadFilterKey = this.dataSystem ? undefined : validatedOptions.payloadFilterKey; |
There was a problem hiding this comment.
🔍 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| } | ||
| }); | ||
|
|
||
| const payloadFilterKey = this.dataSystem ? undefined : pristineOptions.payloadFilterKey; |
There was a problem hiding this comment.
🔍 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.
Was this helpful? React with 👍 or 👎 to provide feedback.


Summary
FDv2 streaming and polling requests carried a
filterquery parameter built from the configuredpayloadFilterKey, 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
filterparameter from each built URL. The copy is built once and every FDv2 requestor and source factory uses it.baseUrioverrides scope from the filter-free endpoints. Sources without an override now receive those endpoints explicitly instead of falling back to the configured endpoints.Related tickets
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
payloadFilterKeyis no longer wired intoServiceEndpointswhendataSystem(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 unsupportedfilterquery 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-allURLs.Reviewed by Cursor Bugbot for commit b71fc4d. Bugbot is set up for automated code reviews on this repo. Configure here.