Open zura-adod opened 1 week ago
Is SPFeatureToggleImpl#startPeriodicCacheRefresh() method from your application?
Yes, it's our method where we have written these lines of code:
private fun startPeriodicCacheRefresh() {
cacheRefreshJob = refreshCoroutineScope.launch(coroutineDispatchers.immediate) {
while (isActive) {
gb.refreshCache()
// Call gb?.refreshCache() every 60 seconds
delay(cacheRefreshInterval)
}
}
}
Hi, @nikantro888. We will check that and write to you.
try to wrap calling gb.refreshCache()
with Dispatchers.IO
@Bohdan-Kim thanks for your response. We will try this approach in our next release and get back to you with the results.
Hi, @zura-adod. Thank you, we will wait for that.
I would like to report a caching issue I've encountered. While I haven't been able to reproduce the exact scenario, I have observed crashes in my production app, as detailed in the attached crash report. I'm not sure if this is related to a version mismatch or a known issue.
Here are the SDK versions we're using:
growthbook = "1.1.60" growthbookNetworkDispatcher = "1.0.2" The crash appears to be related to the following:
[com.sdk.growthbook.sandbox.CachingAndroid.getContent ANR triggered by slow operations on the main thread:
kotlinx.serialization.json.Json.decodeFromString (Json.kt:100) com.sdk.growthbook.sandbox.CachingAndroid.getContent (KMMCaching.kt:61) com.sdk.growthbook.sandbox.KMMCachingKt.getData (KMMCaching.kt:23) com.sdk.growthbook.features.FeaturesViewModel.fetchFeatures (FeaturesViewModel.kt:44) com.sdk.growthbook.features.FeaturesViewModel.fetchFeatures$default (FeaturesViewModel.kt:41) com.sdk.growthbook.GrowthBookSDK.refreshCache (GrowthBookSDK.kt:81) com.space.toolkits.feature.toggle.provider.impl.SPFeatureToggleImpl$startPeriodicCacheRefresh$1.invokeSuspend (SPFeatureToggleImpl.kt:151) kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)](url)
Could anyone assist in identifying a possible fix or let me know if I might be missing something in my configuration?
Thank you for your help!