From 17374416fed41d3d8864e4770630d4bef7a8f808 Mon Sep 17 00:00:00 2001 From: Andrey Belonogov Date: Thu, 22 Oct 2026 18:55:20 -0700 Subject: [PATCH] fix: Update java-sdk-internal to 1.12.2 to report all-private attribute names as references java-sdk-internal 1.12.2 lists each attribute removed by allAttributesPrivate, or by redacting an anonymous context, as the attribute reference that names it. An attribute named /ssn is now reported as /~1ssn rather than /ssn, which reads back as the path to an attribute named ssn. Co-authored-by: Cursor --- launchdarkly-android-client-sdk/build.gradle | 2 +- .../android/EventProcessorPrivacyTest.java | 27 +++++++++++++++++++ shared-test-code/build.gradle | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/launchdarkly-android-client-sdk/build.gradle b/launchdarkly-android-client-sdk/build.gradle index 1903833d3..a54c846d2 100644 --- a/launchdarkly-android-client-sdk/build.gradle +++ b/launchdarkly-android-client-sdk/build.gradle @@ -79,7 +79,7 @@ ext.versions = [ "jacksonDatabind": "2.10.5.1", "junit": "4.13", "launchdarklyJavaSdkCommon": "2.4.0", - "launchdarklyJavaSdkInternal": "1.12.1", + "launchdarklyJavaSdkInternal": "1.12.2", "launchdarklyLogging": "1.1.1", "okhttp": "4.12.0", "testHelpers": "2.1.0", diff --git a/launchdarkly-android-client-sdk/src/test/java/com/launchdarkly/sdk/android/EventProcessorPrivacyTest.java b/launchdarkly-android-client-sdk/src/test/java/com/launchdarkly/sdk/android/EventProcessorPrivacyTest.java index 5ff0bcba3..17ec599c4 100644 --- a/launchdarkly-android-client-sdk/src/test/java/com/launchdarkly/sdk/android/EventProcessorPrivacyTest.java +++ b/launchdarkly-android-client-sdk/src/test/java/com/launchdarkly/sdk/android/EventProcessorPrivacyTest.java @@ -86,6 +86,33 @@ public void allAttributesPrivateLeavesOnlyTheKey() throws Exception { } } + @Test + public void allAttributesPrivateReportsEachNameAsTheReferenceThatNamesIt() throws Exception { + // redactedAttributes holds attribute references. An attribute literally named "/ssn" is + // the reference "/~1ssn"; "/ssn" would be the path to an attribute named "ssn". A name + // without a leading slash is already a reference to itself, so it is reported unchanged. + LDContext context = LDContext.builder("user-key") + .set("/ssn", "123-45-6789") + .set("/a~b", "secret") + .set("c/d", "value") + .build(); + try (HttpServer server = startEventsServer()) { + EventProcessor eventProcessor = makeEventProcessor(server, + eventsBuilder(DEFAULT_CAPACITY).allAttributesPrivate(true), true); + try { + eventProcessor.recordIdentifyEvent(context); + + LDValue delivered = requireEventOfKind(flushAndCollect(eventProcessor, server), + "identify").get("context"); + + assertEquals(LDValue.ofNull(), delivered.get("/ssn")); + assertEquals(redacted("/~1a~0b", "/~1ssn", "c/d"), redactedAttributes(delivered)); + } finally { + eventProcessor.close(); + } + } + } + @Test public void aPrivateSubAttributeRedactsOnlyThatProperty() throws Exception { try (HttpServer server = startEventsServer()) { diff --git a/shared-test-code/build.gradle b/shared-test-code/build.gradle index 9bbaa5785..176bf5f6a 100644 --- a/shared-test-code/build.gradle +++ b/shared-test-code/build.gradle @@ -12,7 +12,7 @@ ext.versions = [ "androidAnnotation": "1.2.0", "gson": "2.13.2", "junit": "4.13", - "launchdarklyJavaSdkInternal": "1.12.1", + "launchdarklyJavaSdkInternal": "1.12.2", "launchdarklyLogging": "1.1.1", ]