Repository navigation
chore(test-app): start a second environment when a second key is set - #428
Open
abelonogov-ld wants to merge 6 commits into
Open
abelonogov-ld wants to merge 6 commits into
abelonogov-ld wants to merge 6 commits into
Conversation
## Summary - Adds a `usePost` option (default `false`) to `HttpConfigurationBuilder`. When the FDv2 data system is configured, polling and streaming requests use POST with the evaluation context JSON in the request body instead of GET with the base64url context in the URL path. This keeps the context out of URL-based request logs and CDN logs. - The FDv1 fallback synchronizer sends REPORT when `usePost` is enabled, because the FDv1 endpoints do not support POST. - `useReport` no longer affects FDv2 requests. The SDK logs one warning when it is set together with the data system. Legacy (non-data-system) FDv1 behavior is unchanged. - Contract tests: the test service declares the `client-use-post` capability, maps the harness's `clientSide.usePost` parameter, and the v3 harness is bumped to v3.2.0-alpha.10 (the release that added the POST test variants). The bump also pulls in stricter events-redaction tests that expose a pre-existing bug in `launchdarkly-java-sdk-internal` (attribute names containing `/` are not escaped as attribute references in `redactedAttributes`). The three affected test groups are suppressed in `testharness-suppressions-fdv2.txt` and tracked by SDK-3338; the suppressions should be removed when that fix ships. Implements CSFDV2 Requirement 2.1.3 (usePost option) and 2.1.4 (useReport ignored with a warning under the FDv2 configuration). Verified locally: full unit suite (752 tests) green; contract tests green on an emulator (v2 suite, and v3 at v3.2.0-alpha.10 with the suppressions above - all POST variants pass). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Adds a **`usePost`** HTTP option (default off) so that when the FDv2 data system is enabled, polling and streaming send the evaluation context in a **POST** body instead of a **GET** URL with a base64 context segment—keeping context out of URL/CDN logs. FDv2 paths that previously used **REPORT** under `useReport` now use **POST**; **ETag**/`If-None-Match` caching stays on **GET** only. > > With the data system, **`useReport` no longer changes FDv2 traffic**; the builder logs a **one-time warning** that requests stay GET unless `usePost` is on. **FDv1 fallback** still has no POST endpoint, so enabling `usePost` maps to **REPORT** with a body there. > > Contract testing advertises **`client-use-post`**, wires harness `clientSide.usePost`, and bumps the v3 harness to **v3.2.0-alpha.10**. Three new v3 event-redaction cases are **suppressed** pending an internal SDK fix (SDK-3338). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 913ef16. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
🤖 I have created a release *beep* *boop* --- ## [5.18.0](5.17.0...5.18.0) (2026-10-30) ### Features * add support for `usePost` option for FDv2 ([#411](#411)) ([d5049ae](d5049ae)) --- 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 5.18.0** — version-only changes from Release Please: bumps the package version from **5.17.0** to **5.18.0** in `.release-please-manifest.json` and `gradle.properties`, and adds a matching **CHANGELOG** section dated 2026-10-30. > > The new changelog entry records the headline feature shipped in this release: **FDv2 `usePost` support** ([#411]), allowing clients to send context in the POST body instead of on the query string when configured. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3229755. 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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
launchdarkly.secondaryMobileKey in local.properties adds a secondary mobile key to the client's LDConfig. An Env spinner then chooses which environment's client the buttons, the connection status, Post 20 MB and the event storage view use. Flush, Offline, Identify and the persistence restart still reach both, as the SDK applies them to every environment. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 186c9f1. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Stacked on #427.
What
When
local.propertiessetslaunchdarkly.secondaryMobileKey, the client is started with that key as a secondary environment throughLDConfig.Builder.secondaryMobileKeys. An Env spinner next to Persistence chooses which environment's client the buttons use, throughLDClient.getForMobileKey. Without the key the spinner stays hidden and nothing changes.The selected environment is used by:
These reach both environments whichever is selected, because the SDK applies
flush,setOffline,setOnline,identifyandcloseto every environment it started: Flush, Offline, Identify, and the restart a persistence change makes. The status line says so.The buttons now get their client through
doSafeClientAction(client -> ...)instead of readingldClientafter a null check. Status and flag listeners are registered on every environment and show the selected one's connection. The choice is saved in shared preferences like the persistence choice.Testing
On the API 23 emulator with both keys set:
Note
Overview
Release 5.18.0 bumps version metadata and documents FDv2
usePostsupport in the changelog.The SDK adds
HttpConfigurationBuilder.usePost/shouldUsePost()so FDv2 streaming and polling send evaluation context in an HTTP POST body instead of the old FDv2 REPORT path or a base64 context segment on GET. With the data system enabled,useReportis documented as ineffective for FDv2 (one-time warning); FDv1 fallback still uses REPORT whenusePostis on.LDConfig.Builder.payloadFilter()validates a filter key and threads it through data-source build inputs as afilterquery parameter on FDv1/FDv2 streaming and polling. Contract tests and the Makefile adopt harness v3.2.0-alpha.10 and new conformance tags (client-use-post,filtering).The test app can start a secondary environment via
launchdarkly.secondaryMobileKeyand an Env spinner so eval/track/kill flows, connection status, storage inspection, and oversized posts target the selected client while flush/offline/identify/close still apply to all started environments.Reviewed by Cursor Bugbot for commit 81c6f30. Bugbot is set up for automated code reviews on this repo. Configure here.