Skip to content

fix: Prevent flags in a persistent store from becoming available to mobile keys - #275

Merged
keelerm84 merged 1 commit into
mainfrom
mk/SDK-3622/client-side-availability
Nov 19, 2026
Merged

keelerm84 merged 1 commit into
mainfrom
mk/SDK-3622/client-side-availability

Conversation

@keelerm84

@keelerm84 keelerm84 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

FeatureFlag did not model clientSideAvailability, so the SDK dropped the object when it wrote a flag to Redis, Consul or DynamoDB. A reader of the store that uses the object, such as the Go SDK or the Relay Proxy, then treats the flag with the older rule and makes it available to mobile keys, even when the flag says usingMobileKey: false.

FeatureFlag now keeps the object when the flag JSON has it, and the SDK writes it back with both properties. A property missing from the object reads as false. When the object is present, clientSide takes the value of usingEnvironmentId, as in the Go SDK. A flag without the object keeps its current encoding and behavior.

The clientSide value is set when the flag is read, so serialization still uses the existing adapter with no extra cost.

The new persistent data store/<store>/client-side availability tests in the test harness (launchdarkly/sdk-test-harness#657 for v3, launchdarkly/sdk-test-harness#658 for v2) pass with this change on Redis, Consul and DynamoDB, and fail without it.

Opened from termag


Note

Overview
Fixes loss of clientSideAvailability when the Java server SDK serializes feature flags to persistent data stores, which could make flags incorrectly available to mobile clients.

FeatureFlag now models optional ClientSideAvailability (usingMobileKey, usingEnvironmentId). On deserialize, if that object is present, clientSide is derived from usingEnvironmentId (matching Go SDK behavior) and both fields are written back on serialize. Missing object properties default to false; flags without the object keep legacy clientSide-only JSON.

ModelBuilders gains clientSideAvailability(...); tests cover round-trip serialization and constructor updates.

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

…istent store

FeatureFlag did not model clientSideAvailability, so the SDK dropped the
object when it wrote a flag to Redis, Consul or DynamoDB. A Go SDK or the
Relay Proxy then read usingMobileKey as true for that flag.

FeatureFlag now keeps the object if the JSON has it. When the object is
present, clientSide takes the value of usingEnvironmentId, as in the Go
SDK, and the SDK writes the object with both properties. A flag without
the object keeps its current encoding and behavior.

Generated-by: termag
@keelerm84
keelerm84 requested a review from a team as a code owner November 19, 2026 21:08
@cursor cursor Bot added the risk:medium label Nov 19, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated risk review (dry run): Medium

This PR would not be automatically approved. Human approval required.

Why: The change in DataModel.java preserves clientSideAvailability on flags written to persistent stores, which is an authorization-related control over mobile-key availability, so this cannot be Low despite the added serialization tests. Human review is needed and no reviewers were assigned.

If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@keelerm84
keelerm84 merged commit 32c8676 into main Nov 19, 2026
35 of 39 checks passed
@keelerm84
keelerm84 deleted the mk/SDK-3622/client-side-availability branch November 19, 2026 21:21
kinyoklion pushed a commit that referenced this pull request Nov 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.18.2](launchdarkly-java-server-sdk-7.18.1...launchdarkly-java-server-sdk-7.18.2)
(2026-11-20)


### Bug Fixes

* Clear empty FDv2 selectors in shared protocol handling
([#261](#261))
([576b081](576b081))
* Prevent flags in a persistent store from becoming available to mobile
keys ([#275](#275))
([32c8676](32c8676))
* Treat a null optional property in flag data as omitted
([#268](#268))
([3af465d](3af465d))
* Update launchdarkly-java-sdk-internal to 1.13.0
([#272](#272))
([9cc5885](9cc5885))

---
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**
> This **release PR** bumps the LaunchDarkly Java server SDK from
**7.18.1** to **7.18.2** across Release Please metadata
(`gradle.properties`, `Version.SDK_VERSION`, and
`.release-please-manifest.json`).
> 
> The new **CHANGELOG** section records the fixes shipped in this patch:
clearing empty FDv2 selectors in shared protocol handling, blocking
persistent-store flags from being exposed to mobile keys, treating null
optional flag properties as omitted, and updating
`launchdarkly-java-sdk-internal` to 1.13.0. Those behavioral changes are
not part of this diff—only the version and release notes are updated
here.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9087581. 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants