Commit 296311f
feat: warn that payload filtering has no effect with FDv2 (#518)
Documents and warns that `payload_filter_key` has no effect when the
FDv2 data system is used.
Closes [SDK-2973](https://launchdarkly.atlassian.net/browse/SDK-2973).
- `Config.payload_filter_key` / `AsyncConfig.payload_filter_key` docs
now state payload filtering is unsupported with FDv2
- 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**
- [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
**Related issues**
[SDK-2973](https://launchdarkly.atlassian.net/browse/SDK-2973), part of
[SDK-2575](https://launchdarkly.atlassian.net/browse/SDK-2575). Same
change as java-core#209 and go-server-sdk#440, adapted for the shared
option.
<details>
<summary>Implementation details</summary>
Unlike Go and Java, Python has no FDv2-specific filter setter —
`payload_filter_key` is a top-level option shared by FDv1 and FDv2 — so
it cannot be deprecated at the language level without also deprecating
supported FDv1 usage. Instead the docstrings call out the FDv2
limitation and `FDv2.__init__` warns once when the option is set.
The FDv2 data sources still append `?filter=` to `/sdk/poll` and
`/sdk/stream` requests. That is intentional for now: on the delivery
side, FDv2 (`internal/fdcore` in `streamer`) reads the `filter` query
param only for observability (`fdrequest.Info.HasPayloadFilter`,
surfaced as a dogfood context attribute) 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: `make lint`, `make test` (1420 passed).
</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-2973]:
https://launchdarkly.atlassian.net/browse/SDK-2973?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SDK-2973]:
https://launchdarkly.atlassian.net/browse/SDK-2973?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SDK-2575]:
https://launchdarkly.atlassian.net/browse/SDK-2575?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Overview**
> Clarifies that **`payload_filter_key`** still applies to default FDv1
streaming/polling, but **does not filter FDv2** payloads.
>
> **`Config`** and **`AsyncConfig`** docstrings (constructor param and
`payload_filter_key` property) now state that filtering is unsupported
with the FDv2 data system. **`FDv2`** and **`AsyncFDv2`** emit a
one-time **warning at construction** when a filter key is set, without
changing runtime behavior or deprecating the shared option for FDv1.
>
> Tests assert the warning appears when a filter key is configured and
is absent when it is not, for both sync and async FDv2.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
eaa3d72. 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>1 parent 514c467 commit 296311f
6 files changed
Lines changed: 46 additions & 2 deletions
File tree
- ldclient
- impl/datasystem
- testing/impl/datasystem
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
479 | 482 | | |
480 | 483 | | |
481 | 484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
684 | 687 | | |
685 | 688 | | |
686 | 689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
778 | 779 | | |
779 | 780 | | |
780 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
846 | 847 | | |
847 | 848 | | |
848 | 849 | | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
0 commit comments