Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://developer.huawei.com/repo/" }
maven { url "https://artifactory-external.vkpartner.ru/artifactory/maven" }
maven { url "https://nexus-external.vkteam.ru/repository/maven/" }
}
dependencies {
classpath libs.bundles.buildscript.plugins
Expand All @@ -16,7 +16,7 @@ allprojects {
google()
mavenCentral()
maven { url "https://developer.huawei.com/repo/" }
maven { url "https://artifactory-external.vkpartner.ru/artifactory/maven" }
maven { url "https://nexus-external.vkteam.ru/repository/maven/" }
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
mavenLocal()
}
Expand Down
2 changes: 1 addition & 1 deletion example/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencyResolutionManagement {
repositories {
google()
maven { url 'https://developer.huawei.com/repo/' }
maven { url "https://artifactory-external.vkpartner.ru/artifactory/maven" }
maven { url "https://nexus-external.vkteam.ru/repository/maven/" }
mavenCentral()
mavenLocal()
}
Expand Down
10 changes: 8 additions & 2 deletions sdk/src/main/java/cloud/mindbox/mobile_sdk/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ internal fun InApp.firstOverlayVariant(): InAppType? =
* cooldown all exist to hold shows back, and an `unlimited` in-app is outside that accounting in
* both directions — it records nothing, and nothing recorded restrains it.
*/
internal fun InApp.countsShows(): Boolean = frequency.delay !is Frequency.Delay.Unlimited
internal fun InApp.countsShows(): Boolean = frequency.countsShows()

internal fun Frequency.countsShows(): Boolean = delay !is Frequency.Delay.Unlimited

internal fun <T> newConcurrentSet(): MutableSet<T> =
Collections.newSetFromMap(ConcurrentHashMap())
Expand All @@ -333,7 +335,11 @@ internal fun <T> newConcurrentSet(): MutableSet<T> =
* decision is taken by the caller and passed in as [isTagsFeatureEnabled].
*/
internal fun InApp.gatedTags(isTagsFeatureEnabled: Boolean): Map<String, String>? =
tags?.takeIf { it.isNotEmpty() && isTagsFeatureEnabled }
tags.gatedTags(isTagsFeatureEnabled)

/** The same gate for a tags snapshot that travels without its [InApp] (embedded content). */
internal fun Map<String, String>?.gatedTags(isTagsFeatureEnabled: Boolean): Map<String, String>? =
this?.takeIf { it.isNotEmpty() && isTagsFeatureEnabled }

internal inline fun <T> Queue<T>.pollIf(predicate: (T) -> Boolean): T? {
return peek()?.takeIf(predicate)?.let { poll() }
Expand Down
1 change: 1 addition & 0 deletions sdk/src/main/java/cloud/mindbox/mobile_sdk/Mindbox.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ public object Mindbox : MindboxLog {
BackgroundWorkManager.cancelAllWork(context)
MindboxPreferences.resetAppInfoUpdated()
mindboxScope = createMindboxScope()
MindboxDI.appModule.mobileConfigRepositoryIfCreated?.startListening()
MindboxDI.appModule.embeddedBlocksRegistryIfCreated?.startListening()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,13 @@ internal fun DataModule(
)
}

override val mobileConfigRepository: MobileConfigRepository by lazy {
override val mobileConfigRepository: MobileConfigRepository
get() = mobileConfigRepositoryLazy.value

override val mobileConfigRepositoryIfCreated: MobileConfigRepository?
get() = mobileConfigRepositoryLazy.takeIf { repository -> repository.isInitialized() }?.value

private val mobileConfigRepositoryLazy = lazy {
MobileConfigRepositoryImpl(
inAppMapper = inAppMapper,
mobileConfigSerializationManager = mobileConfigSerializationManager,
Expand Down Expand Up @@ -241,7 +247,8 @@ internal fun DataModule(
InAppFailureTrackerImpl(
timeProvider = timeProvider,
inAppRepository = inAppRepository,
featureToggleManager = featureToggleManager
featureToggleManager = featureToggleManager,
sessionStorageManager = sessionStorageManager,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ internal fun DomainModule(
minIntervalBetweenShowsLimitChecker = minIntervalBetweenShowsLimitChecker,
timeProvider = timeProvider,
sessionStorageManager = sessionStorageManager,
inAppFailureTracker = inAppFailureTracker,
)
}
override val callbackInteractor: CallbackInteractor by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ internal interface DataModule : MindboxModule {
val inAppImageSizeStorage: InAppImageSizeStorage
val sessionStorageManager: SessionStorageManager
val mobileConfigRepository: MobileConfigRepository

/** The repository only if something already asked for it — never creates one. */
val mobileConfigRepositoryIfCreated: MobileConfigRepository?
val mobileConfigSerializationManager: MobileConfigSerializationManager
val inAppWebViewPrewarmManager: InAppWebViewPrewarmManager
val webViewCachePolicy: InAppWebViewCachePolicy
Expand Down
Loading