Skip to content

feat: Support usePost for FDv2 polling and streaming requests - #401

Draft
kinyoklion wants to merge 2 commits into
mainfrom
rlamb/sdk-3179/fdv2-use-post
Draft

kinyoklion wants to merge 2 commits into
mainfrom
rlamb/sdk-3179/fdv2-use-post

Conversation

@kinyoklion

Copy link
Copy Markdown
Member

Summary

The FDv2 data sources reused the FDv1 useReport option: with it set, the polling requestor and the streaming synchronizer sent REPORT to /sdk/poll/eval and /sdk/stream/eval. The client-side FDv2 spec lists POST as the body-carrying method for those paths (the polling path does not accept REPORT), requires a usePost option, and says useReport should be ignored with a warning when the FDv2 configuration is in use.

  • DataSystemBuilder.usePost(boolean) (default false) switches every FDv2 polling and streaming source to POST with the context JSON in the request body. The setting travels through DataSourceBuildInputs.isUsePost(), so built-in modes and custom mode pipelines behave the same. REPORT support is removed from the FDv2 sources; they send GET or POST.
  • The FDv1 fallback synchronizer keeps the context out of the URL under usePost too. The FDv1 endpoints do not accept POST, so it uses REPORT with the context body when usePost is set, and GET otherwise.
  • HttpConfigurationBuilder.useReport has no effect when a data system is configured. FDv2DataSourceBuilder logs a warning once that points at usePost; the useReport javadoc says the same.
  • The two FDv2 polling path constants (identical GET and REPORT values) collapse into one, since GET appends the context segment and POST uses the path as is.
  • ETag / If-None-Match handling stays GET-only, as it was for REPORT.

Contract tests: the test service declares client-use-post and maps clientSide.usePost onto DataSystemBuilder.usePost. The v3 harness pin in the Makefile moves from v3.1.0-alpha.6 to v3.2.0-alpha.10, the first release with the POST request variants (launchdarkly/sdk-test-harness#445). That release also adds slash-prefixed attribute redaction tests (/ssn expected as /~1ssn in redactedAttributes) that the SDK fails today on main as well; those three test groups are added to testharness-suppressions-fdv2.txt so the FDv2 run stays green, and are unrelated to this change.

Verified locally on an emulator with the released v3.2.0-alpha.10 harness: the full v3 suite passes against this branch (808 total, 788 ran, 20 skipped, exit 0), including the 18 POST subtests for polling and streaming requests (method and headers, URL path, query parameters, context properties) and the auto-environment-attribute request-body tests, which now run with POST. The same harness against unmodified main fails exactly the 13 redaction tests that are suppressed here. SDK unit tests: 746 pass.

The FDv2 polling endpoint accepts POST, not REPORT, so the FDv2 sources
now send GET or POST. The new DataSystemBuilder.usePost option selects
POST and sends the evaluation context in the request body. The FDv1
fallback synchronizer sends REPORT in that case because the FDv1
endpoints do not accept POST. HttpConfigurationBuilder.useReport has no
effect under the data system and logs a warning once.
The test service declares client-use-post and maps clientSide.usePost
into the data system configuration. The v3 harness pin moves to
v3.2.0-alpha.10, the first release with the POST request variants.
That release also adds slash-prefixed attribute redaction tests that
the SDK does not pass yet; they are suppressed for the FDv2 run.

This branch has not been deployed

No deployments
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.

1 participant