feat: Support usePost for FDv2 polling and streaming requests - #401
Draft
kinyoklion wants to merge 2 commits into
Draft
kinyoklion wants to merge 2 commits into
kinyoklion wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The FDv2 data sources reused the FDv1
useReportoption: with it set, the polling requestor and the streaming synchronizer sentREPORTto/sdk/poll/evaland/sdk/stream/eval. The client-side FDv2 spec listsPOSTas the body-carrying method for those paths (the polling path does not acceptREPORT), requires ausePostoption, and saysuseReportshould be ignored with a warning when the FDv2 configuration is in use.DataSystemBuilder.usePost(boolean)(defaultfalse) switches every FDv2 polling and streaming source toPOSTwith the context JSON in the request body. The setting travels throughDataSourceBuildInputs.isUsePost(), so built-in modes and custom mode pipelines behave the same.REPORTsupport is removed from the FDv2 sources; they sendGETorPOST.usePosttoo. The FDv1 endpoints do not acceptPOST, so it usesREPORTwith the context body whenusePostis set, andGETotherwise.HttpConfigurationBuilder.useReporthas no effect when a data system is configured.FDv2DataSourceBuilderlogs a warning once that points atusePost; theuseReportjavadoc says the same.GETandREPORTvalues) collapse into one, sinceGETappends the context segment andPOSTuses the path as is.If-None-Matchhandling staysGET-only, as it was forREPORT.Contract tests: the test service declares
client-use-postand mapsclientSide.usePostontoDataSystemBuilder.usePost. The v3 harness pin in theMakefilemoves fromv3.1.0-alpha.6tov3.2.0-alpha.10, the first release with thePOSTrequest variants (launchdarkly/sdk-test-harness#445). That release also adds slash-prefixed attribute redaction tests (/ssnexpected as/~1ssninredactedAttributes) that the SDK fails today onmainas well; those three test groups are added totestharness-suppressions-fdv2.txtso the FDv2 run stays green, and are unrelated to this change.Verified locally on an emulator with the released
v3.2.0-alpha.10harness: the full v3 suite passes against this branch (808 total, 788 ran, 20 skipped, exit 0), including the 18POSTsubtests 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 withPOST. The same harness against unmodifiedmainfails exactly the 13 redaction tests that are suppressed here. SDK unit tests: 746 pass.