From 996914893f84422de55681d3a4e065c528cdaffd Mon Sep 17 00:00:00 2001 From: Todd Anderson <127344469+tanderson-ld@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:30:33 -0600 Subject: [PATCH 1/2] fix: correcting protocol parsing logic that may lead to incorrect sanitization of an incoming message from LD servers (#288) After examining related code to a customer support case and #278, noticed this modification during iteration. Theoretical issue is that modification during iteration, even if not resulting in ConcurrentModificationExceptions, could result in unpredictable iteration and could possibly skip sanitizing certain incoming flags. Through bench testing and instrumentation testing, I was unable to reproduce the issue, but I suspect it may be dependent on the specific platform's implementation of the Map type that GSON will depend on. Will deploy this fix and work with customers to confirm if the occurrences of the issue is eliminated. --- .../com/launchdarkly/sdk/android/EnvironmentData.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/sdk/android/EnvironmentData.java b/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/sdk/android/EnvironmentData.java index e177796e..8c90b8ad 100644 --- a/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/sdk/android/EnvironmentData.java +++ b/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/sdk/android/EnvironmentData.java @@ -78,13 +78,13 @@ public static EnvironmentData fromJson(String json) throws SerializationExceptio // Normalize the data set to ensure that the flag keys are present not only as map keys, // but also in each Flag object. That is normally the case in data sent by LD, even though // it's redundant, but if for any reason it isn't we can transparently fix it. - for (Map.Entry e: dataMap.entrySet()) { - Flag f = e.getValue(); + for (Map.Entry entry: dataMap.entrySet()) { + Flag f = entry.getValue(); if (f.getKey() == null) { - f = new Flag(e.getKey(), f.getValue(), f.getVersion(), f.getFlagVersion(), + f = new Flag(entry.getKey(), f.getValue(), f.getVersion(), f.getFlagVersion(), f.getVariation(), f.isTrackEvents(), f.isTrackReason(), f.getDebugEventsUntilDate(), f.getReason(), f.getPrerequisites()); - dataMap.put(e.getKey(), f); + entry.setValue(f); } } return new EnvironmentData(dataMap); From 2a902c8f656a5ab4bb692d0b595c8e85f9796097 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 11:14:33 -0600 Subject: [PATCH 2/2] chore(main): release 5.6.1 (#289) :robot: I have created a release *beep* *boop* --- ## [5.6.1](https://github.com/launchdarkly/android-client-sdk/compare/5.6.0...5.6.1) (2025-01-21) ### Bug Fixes * correcting protocol parsing logic that may lead to incorrect sanitization of an incoming message from LD servers ([#288](https://github.com/launchdarkly/android-client-sdk/issues/288)) ([9969148](https://github.com/launchdarkly/android-client-sdk/commit/996914893f84422de55681d3a4e065c528cdaffd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d49c9e28..b66c8240 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.6.0" + ".": "5.6.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index c5e8fe00..3bf672eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to the LaunchDarkly Android SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +## [5.6.1](https://github.com/launchdarkly/android-client-sdk/compare/5.6.0...5.6.1) (2025-01-21) + + +### Bug Fixes + +* correcting protocol parsing logic that may lead to incorrect sanitization of an incoming message from LD servers ([#288](https://github.com/launchdarkly/android-client-sdk/issues/288)) ([9969148](https://github.com/launchdarkly/android-client-sdk/commit/996914893f84422de55681d3a4e065c528cdaffd)) + ## [5.6.0](https://github.com/launchdarkly/android-client-sdk/compare/5.5.0...5.6.0) (2025-01-08) diff --git a/gradle.properties b/gradle.properties index a4a2f3fd..36e9d7de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,7 @@ # org.gradle.parallel=true #x-release-please-start-version -version=5.6.0 +version=5.6.1 #x-release-please-end sonatypeUsername=