Hello everyone, I have a strange error ```Standalo...
# apollo-kotlin
j
Hello everyone, I have a strange error
Copy code
StandaloneCoroutine was canceled
it only happens to me when a specific api is consumed this is my apollo configuration
Copy code
val logging = HttpLoggingInterceptor()
logging.level = HttpLoggingInterceptor.Level.NONE

if (BuildConfig.DEBUG) {
    logging.level = HttpLoggingInterceptor.Level.BODY
}

val okHttpClient = OkHttpClient.Builder()
    .addInterceptor(logging)
    .connectTimeout(8, TimeUnit.SECONDS)
    .readTimeout(8, TimeUnit.SECONDS)
    .writeTimeout(8, TimeUnit.SECONDS)

apolloClient = ApolloClient.Builder()
    .serverUrl(
        BuildConfig.HOST
    )
    .okHttpClient(
        okHttpClient.build()
    )
    .normalizedCache(
        SqlNormalizedCacheFactory(context, "h_apollo.db"),
        writeToCacheAsynchronously = true
    )
    .addInterceptor(
        SessionInterceptor(context)
    )
    .addInterceptor(
        LanguageInterceptor()
    )
    .build()
HttpLogginInterceptor print
Copy code
<-- HTTP FAILED: java.io.IOException: Canceled
m
Hi 👋 can you share the full stacktrace?
j
Hi 👋 @mbonnin this log print
kotlinx.coroutines.JobCancellationException: StandaloneCoroutine was cancelled; job=StandaloneCoroutine{Cancelling}@4130a23
m
Is that all? It's hard to tell without more context. Maybe double check your scope. It might be that something cancels it and this error is actually expected
a
You mentioned that it’s one specific API, do you know the actual call site? I’ve seen these kinds of errors when I’ve launched something in another scope but forgot to do error handling and that just took down that coroutine but nothing else.
j
@mbonnin @annsofi I apologize it was my mistake in handling the coroutine.
a
No worries, we've all done that :)
âž• 1