Skip to content

Commit 5873b16

Browse files
author
Rodrigo Gomez Palacio
committed
fixup! IamFetchReadyCondition Implementation
1 parent 55a3e25 commit 5873b16

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/consistency/IamFetchReadyCondition.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,14 @@ class IamFetchReadyCondition(
2323
override fun isMet(indexedTokens: Map<String, Map<IConsistencyKeyEnum, String>>): Boolean {
2424
val tokenMap = indexedTokens[key] ?: return false
2525
val userUpdateTokenSet = tokenMap[IamFetchRywTokenKey.USER] != null
26-
val subscriptionUpdateTokenSet = tokenMap[IamFetchRywTokenKey.SUBSCRIPTION] != null
2726

2827
/**
2928
* We always update the session count so we know we will have a userUpdateToken. We don't
3029
* necessarily make a subscriptionUpdate call on every session. The following logic
31-
* is written in a way so that if somehow the subscriptionUpdateToken is set *before* the
32-
* userUpdateToken, we will wait for the userUpdateToken to also be set. This is because
33-
* we know that a userUpdate call was made and both user & subscription properties are
34-
* considered during segment calculations.
30+
* doesn't consider tokenMap[IamFetchRywTokenKey.SUBSCRIPTION] for this reason. This doesn't
31+
* mean it isn't considered if present when doing the token comparison.
3532
*/
36-
return (userUpdateTokenSet && subscriptionUpdateTokenSet) || userUpdateTokenSet
33+
return userUpdateTokenSet
3734
}
3835

3936
override fun getNewestToken(indexedTokens: Map<String, Map<IConsistencyKeyEnum, String?>>): String? {

0 commit comments

Comments
 (0)