Skip to content

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

Merged
kinyoklion merged 2 commits into
mainfrom
rlamb/sdk-3051/fdv2-use-post
Sep 22, 2026
Merged

kinyoklion merged 2 commits into
mainfrom
rlamb/sdk-3051/fdv2-use-post

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Summary

The FDv2 data system carried an unwired usePost flag on each mode-definition entry: the requestor and streaming factories honored it, but the built-in modes hardcoded it to false and no configuration exposed it. Under FDv2 the SDK always sent the evaluation context in the URL with GET, and useReport was silently ignored.

  • DataSystemConfig.usePost (default false) switches every FDv2 polling and streaming source to POST with the context JSON in the request body, on the /sdk/poll/eval and /sdk/stream/eval paths. It replaces the per-entry usePost fields on PollingInitializer, StreamingInitializer, PollingSynchronizer and StreamingSynchronizer, which were not reachable through configuration (the data system is in early access, with no compatibility guarantees). The setting travels through SourceFactoryContext, so built-in modes and overrides behave the same.
  • On web the browser EventSource cannot send a POST. When usePost is set on such a platform the data system drops the streaming sources from every mode and logs a warning, so a streaming mode polls instead. The platform capability is a new streamingPostSupported default next to the existing streamingReportSupported.
  • useReport together with a DataSystemConfig now logs a warning that the option is ignored and points at usePost.
  • The contract test service declares client-use-post and maps clientSide.usePost onto DataSystemConfig.usePost.
  • The FDv1 fallback source also keeps the context out of the URL under usePost. The FDv1 endpoints do not accept POST (production returns 404 for POST /msdk/evalx/context and 200 for REPORT), so the fallback poller uses REPORT with the context JSON body when usePost is set, and GET otherwise.

The POST request variants come from the v3 harness change in launchdarkly/sdk-test-harness#445. With a harness built from that branch the full v3 suite passes against this branch: 844 total, 823 ran, 20 of them POST subtests. CI runs the v2 harness, which this change does not affect.

Also verified against production with a mobile key through the contract test service: in polling mode behind a logging proxy the SDK sent POST /sdk/poll/eval with the context JSON body and received the environment's flags; in a streaming-only mode (no polling initializer, no cache) with usePost the stream alone delivered the same 183 flags, matching the GET control runs.


Note

Overview
Adds DataSystemConfig.usePost (default off) so FDv2 polling and streaming send the evaluation context in a POST body instead of a GET URL path. The old per-mode-entry usePost fields are removed; the setting flows through SourceFactoryContext to all FDv2 sources.

On web, where EventSource cannot POST, enabling usePost strips streaming sources from resolved modes, logs a warning, and leaves polling so streaming modes degrade to poll. streamingPostSupported is added to platform defaults (true on IO, false on JS).

FDv1 fallback honors the same flag via REPORT + JSON body (FDv1 does not accept POST). useReport with an FDv2 data system now logs that it is ignored and points to usePost.

The Flutter contract test service advertises client-use-post and maps harness clientSide.usePost onto DataSystemConfig.usePost.

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

@kinyoklion
kinyoklion marked this pull request as ready for review September 21, 2026 22:14
@kinyoklion
kinyoklion requested a review from a team as a code owner September 21, 2026 22:14
@kinyoklion
kinyoklion force-pushed the rlamb/sdk-3051/fdv2-use-post branch from ed8292c to 5671348 Compare September 21, 2026 22:29

/// The definition for [mode]: the user's override if one was given for
/// it, otherwise the built-in default.
/// it, otherwise the built-in default, less any sources the platform

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.

nit: not understanding this comment change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are built-in defaults that get filtered based on what the platform supports.

@kinyoklion
kinyoklion merged commit e52ff32 into main Sep 22, 2026
7 checks passed
@kinyoklion
kinyoklion deleted the rlamb/sdk-3051/fdv2-use-post branch September 22, 2026 21:18
kinyoklion pushed a commit that referenced this pull request Sep 25, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.15.0](launchdarkly_common_client-v1.14.3...launchdarkly_common_client-v1.15.0)
(2026-09-22)


### Features

* Support usePost for FDv2 polling and streaming requests
([#341](#341))
([e52ff32](e52ff32))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **Release-only PR** that publishes `launchdarkly_common_client`
**1.15.0** via Release Please.
> 
> It updates `.release-please-manifest.json`,
`packages/common_client/pubspec.yaml` (1.14.3 → 1.15.0), and adds a
**1.15.0** changelog entry. The noted user-facing change in that release
is **support for `usePost` on FDv2 polling and streaming requests**
([#341](#341));
this diff does not include the implementation commits.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c314f90. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
kinyoklion added a commit that referenced this pull request Sep 25, 2026
## Summary

Propagates `usePost` support for FDv2 polling and streaming requests
(#341) out to the published Flutter SDK.

`flutter_client_sdk` pins `launchdarkly_common_client` exactly, so the
new `DataSystemConfig.usePost` option does not reach SDK users until
this pin moves. This is the only place in the repo that pins
`common_client`.

| Package | Version | Status |
| --- | --- | --- |
| `launchdarkly_common_client` | 1.15.0 | published to pub.dev (#343) |
| `launchdarkly_flutter_client_sdk` | 4.21.0 | this PR triggers the
release |

1.15.0 is live on pub.dev and `flutter pub get` resolves against it, so
there is no publish-ordering constraint: this can merge as soon as CI is
green, and the resulting release PR after it. The commit is a `feat`
because the SDK gains a new configuration option.

Same shape as the prior propagation commits: #339
(`launchdarkly_common_client` 1.14.3) and #331 (1.14.2).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> Bumps the pinned **`launchdarkly_common_client`** dependency from
**1.14.3** to **1.15.0** in `flutter_client_sdk`, so published Flutter
SDK consumers pick up the new **`DataSystemConfig.usePost`** option for
FDv2 polling and streaming (already in common client 1.15.0 on pub.dev).
> 
> There are no other source changes in this PR—only the dependency pin
update, matching prior propagation releases.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
7a2bc06. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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