From b778f38770bc67efb440d2613063d54f2e6eb5c2 Mon Sep 17 00:00:00 2001 From: LaunchDarklyReleaseBot <86431345+LaunchDarklyReleaseBot@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:58:02 -0400 Subject: [PATCH] prepare 5.0.2 release (#228) ## [5.0.2] - 2023-09-19 ### Fixed: - Fixed a rare bug in key generation in some contexts generated by the Auto Environment Attributes feature. --------- Co-authored-by: Ember Stevens Co-authored-by: Ember Stevens <79482775+ember-stevens@users.noreply.github.com> Co-authored-by: Todd Anderson Co-authored-by: tanderson-ld <127344469+tanderson-ld@users.noreply.github.com> Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com> Co-authored-by: Kane Parkinson <93555788+kparkinson-ld@users.noreply.github.com> Co-authored-by: LaunchDarklyReleaseBot Co-authored-by: Matthew M. Keeler Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com> --- .../launchdarkly/sdk/android/AutoEnvContextModifier.java | 3 +-- .../sdk/android/AutoEnvContextModifierTest.java | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/sdk/android/AutoEnvContextModifier.java b/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/sdk/android/AutoEnvContextModifier.java index 13cc8816..499f46f5 100644 --- a/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/sdk/android/AutoEnvContextModifier.java +++ b/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/sdk/android/AutoEnvContextModifier.java @@ -140,8 +140,7 @@ private List makeRecipeList() { new ContextRecipe( ldApplicationKind, () -> LDUtil.urlSafeBase64Hash( - Objects.toString(environmentReporter.getApplicationInfo().getApplicationId(), "") + ":" - + Objects.toString(environmentReporter.getApplicationInfo().getApplicationVersion(), "") + Objects.toString(environmentReporter.getApplicationInfo().getApplicationId(), "") ), applicationCallables ), diff --git a/launchdarkly-android-client-sdk/src/test/java/com/launchdarkly/sdk/android/AutoEnvContextModifierTest.java b/launchdarkly-android-client-sdk/src/test/java/com/launchdarkly/sdk/android/AutoEnvContextModifierTest.java index aab51c58..642a990e 100644 --- a/launchdarkly-android-client-sdk/src/test/java/com/launchdarkly/sdk/android/AutoEnvContextModifierTest.java +++ b/launchdarkly-android-client-sdk/src/test/java/com/launchdarkly/sdk/android/AutoEnvContextModifierTest.java @@ -40,10 +40,7 @@ public void adheresToSchemaTest() { // it is important that we create this expected context after the code runs because there // will be persistence side effects ContextKind applicationKind = ContextKind.of(AutoEnvContextModifier.LD_APPLICATION_KIND); - String expectedApplicationKey = LDUtil.urlSafeBase64Hash( - reporter.getApplicationInfo().getApplicationId() + ":" - + reporter.getApplicationInfo().getApplicationVersion() - ); + String expectedApplicationKey = LDUtil.urlSafeBase64Hash(reporter.getApplicationInfo().getApplicationId()); LDContext expectedAppContext = LDContext.builder(applicationKind, expectedApplicationKey) .set(AutoEnvContextModifier.ENV_ATTRIBUTES_VERSION, AutoEnvContextModifier.SPEC_VERSION) .set(AutoEnvContextModifier.ATTR_ID, LDPackageConsts.SDK_NAME) @@ -180,7 +177,7 @@ public void generatedApplicationKeyWithVersionMissing() { // it is important that we create this expected context after the code runs because there // will be persistence side effects ContextKind applicationKind = ContextKind.of(AutoEnvContextModifier.LD_APPLICATION_KIND); - String expectedApplicationKey = LDUtil.urlSafeBase64Hash(reporter.getApplicationInfo().getApplicationId() + ":"); + String expectedApplicationKey = LDUtil.urlSafeBase64Hash(reporter.getApplicationInfo().getApplicationId()); LDContext expectedAppContext = LDContext.builder(applicationKind, expectedApplicationKey) .set(AutoEnvContextModifier.ENV_ATTRIBUTES_VERSION, AutoEnvContextModifier.SPEC_VERSION)