-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Caching Issue Leading to ANR in Production #145
Comments
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 |
@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. |
Hi, @zura-adod. Did you try that? |
Hi, here is solution for that PR. After merge it will be availiable. |
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!
The text was updated successfully, but these errors were encountered: