From bef0d34681ec441a3fef760b614e018801a1ebfc Mon Sep 17 00:00:00 2001 From: Franco Zalamena Date: Fri, 28 Aug 2026 14:31:01 +0100 Subject: [PATCH] [SDK-565] Remove the unused encryptionEnforced field from IterableConfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://iterable.atlassian.net/browse/SDK-565 3.5.5 announced this option as removed and deleted its public setter, but a merge reinstated the field — without the setter — in 3.6.0, where it has been unsettable and unread ever since. Nothing in the SDK reads it, so removing it cannot change behaviour, and no public or protected signature changes. Adds a reflection guard because nothing in the build detects a re-added member. The guard has teeth against a future re-add, not against today's state: no test can fail while the field is merely present, since nothing reads it. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 3 +++ .../com/iterable/iterableapi/IterableConfig.java | 4 ---- .../iterable/iterableapi/IterableConfigTest.kt | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b56c84d6..c3102064b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Deprecated - `IterableConfig.Builder.setExpiringAuthTokenRefreshPeriod(Long)` — use the `double` overload instead, which accepts fractional seconds. The `Long` overload delegates to it and remains fully supported. +### Removed +- Removed the `encryptionEnforced` field from `IterableConfig`. **No action required.** 3.5.5 announced this option as removed and deleted its public setter, but a merge reinstated the field — without the setter — in 3.6.0, where it has sat unsettable and unread ever since. There has been no way to set it and no effect on SDK behaviour since 3.5.5, so no app can be affected. Storage behaviour is unchanged: use `setKeychainEncryption(boolean)` to control whether stored user data is encrypted, and `setDecryptionFailureHandler(...)` to be notified when the SDK cannot decrypt it. + ## [3.10.1] ### Fixed - Fixed a race in JWT auth refresh scheduling that could leave overlapping timers active and repeatedly call `IterableAuthHandler.onAuthTokenRequested()`. Refresh scheduling now has a single task owner, rejects stale or duplicate tasks, and logs each schedule, skip, fire, cancellation, and error with its refresh reason. diff --git a/iterableapi/src/main/java/com/iterable/iterableapi/IterableConfig.java b/iterableapi/src/main/java/com/iterable/iterableapi/IterableConfig.java index 710d7c5a7..ed4b66f5c 100644 --- a/iterableapi/src/main/java/com/iterable/iterableapi/IterableConfig.java +++ b/iterableapi/src/main/java/com/iterable/iterableapi/IterableConfig.java @@ -103,8 +103,6 @@ public class IterableConfig { */ final boolean useInMemoryStorageForInApps; - final boolean encryptionEnforced; - /** * Enables unknown user activation */ @@ -199,7 +197,6 @@ private IterableConfig(Builder builder) { allowedProtocols = builder.allowedProtocols; dataRegion = builder.dataRegion; useInMemoryStorageForInApps = builder.useInMemoryStorageForInApps; - encryptionEnforced = builder.encryptionEnforced; enableUnknownUserActivation = builder.enableUnknownUserActivation; enableForegroundCriteriaFetch = builder.enableForegroundCriteriaFetch; enableEmbeddedMessaging = builder.enableEmbeddedMessaging; @@ -233,7 +230,6 @@ public static class Builder { private boolean keychainEncryption = true; private IterableAPIMobileFrameworkInfo mobileFrameworkInfo; private IterableDecryptionFailureHandler decryptionFailureHandler; - private boolean encryptionEnforced = false; private boolean enableUnknownUserActivation = false; private boolean enableForegroundCriteriaFetch = true; private boolean enableEmbeddedMessaging = false; diff --git a/iterableapi/src/test/java/com/iterable/iterableapi/IterableConfigTest.kt b/iterableapi/src/test/java/com/iterable/iterableapi/IterableConfigTest.kt index 53e9d5eff..9be66d25a 100644 --- a/iterableapi/src/test/java/com/iterable/iterableapi/IterableConfigTest.kt +++ b/iterableapi/src/test/java/com/iterable/iterableapi/IterableConfigTest.kt @@ -174,4 +174,20 @@ class IterableConfigTest { setter.invoke(builder, null) assertEquals(60_000L, builder.build().expiringAuthTokenRefreshPeriodMillis) } + + /** + * `encryptionEnforced` was removed in 3.5.5 and then silently reinstated by a merge in 3.6.0, + * where it sat unread for four minor versions. Nothing in the build detects a re-added member, + * so this asserts its absence directly. + */ + @Test + fun encryptionEnforcedIsNotPartOfTheConfiguration() { + val members = listOf(IterableConfig::class.java, IterableConfig.Builder::class.java) + .flatMap { type -> + type.declaredFields.map { it.name } + type.declaredMethods.map { it.name } + } + .filter { it.contains("encryptionEnforced", ignoreCase = true) } + + assertTrue("encryptionEnforced was reintroduced: $members", members.isEmpty()) + } }