From 5873b167a7cd0c124e14b1a144d85b6d1725b09d Mon Sep 17 00:00:00 2001 From: Rodrigo Gomez Palacio Date: Fri, 27 Sep 2024 14:24:18 -0500 Subject: [PATCH] fixup! `IamFetchReadyCondition` Implementation --- .../common/consistency/IamFetchReadyCondition.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/consistency/IamFetchReadyCondition.kt b/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/consistency/IamFetchReadyCondition.kt index 329832aa5..d43e3c989 100644 --- a/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/consistency/IamFetchReadyCondition.kt +++ b/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/consistency/IamFetchReadyCondition.kt @@ -23,17 +23,14 @@ class IamFetchReadyCondition( override fun isMet(indexedTokens: Map>): Boolean { val tokenMap = indexedTokens[key] ?: return false val userUpdateTokenSet = tokenMap[IamFetchRywTokenKey.USER] != null - val subscriptionUpdateTokenSet = tokenMap[IamFetchRywTokenKey.SUBSCRIPTION] != null /** * We always update the session count so we know we will have a userUpdateToken. We don't * necessarily make a subscriptionUpdate call on every session. The following logic - * is written in a way so that if somehow the subscriptionUpdateToken is set *before* the - * userUpdateToken, we will wait for the userUpdateToken to also be set. This is because - * we know that a userUpdate call was made and both user & subscription properties are - * considered during segment calculations. + * doesn't consider tokenMap[IamFetchRywTokenKey.SUBSCRIPTION] for this reason. This doesn't + * mean it isn't considered if present when doing the token comparison. */ - return (userUpdateTokenSet && subscriptionUpdateTokenSet) || userUpdateTokenSet + return userUpdateTokenSet } override fun getNewestToken(indexedTokens: Map>): String? {