Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
BugIssue type
Description
Integration
sentry-android
Build System
Gradle
AGP Version
8.5.0
Proguard
Enabled
Version
7.14.0
Steps to Reproduce
- Use Apollo GraphQL version: 4.0.0 and com.apollographql.apollo:apollo-runtime library
- Use Sentry latest version and use sentry-apollo library
- Add SentryApolloInterceptor to your ApolloClient.Builder() with .addInterceptor(SentryApolloInterceptor())
- Run the app to emulator
Expected Result
App should run, right?
Actual Result
App crashes why?
SentryApolloInterceptor implements ApolloInterceptor.
What is ApolloInterceptor?
interface ApolloInterceptor {
fun <D : Operation.Data> intercept(request: ApolloRequest<D>, chain: ApolloInterceptorChain): Flow<ApolloResponse<D>>
}
We have override fun interceptAsync() instead of override fun intercept() in SentryApolloInterceptor class, which leads to following crash:
java.lang.AbstractMethodError: abstract method "kotlinx.coroutines.flow.Flow com.apollographql.apollo.interceptor.ApolloInterceptor.intercept(com.apollographql.apollo.api.ApolloRequest, com.apollographql.apollo.interceptor.ApolloInterceptorChain)"
at com.apollographql.apollo.interceptor.DefaultInterceptorChain.proceed(ApolloInterceptor.kt:23)
at com.apollographql.apollo.ApolloClient.apolloResponses$apollo_runtime_debug(ApolloClient.kt:322)
at com.apollographql.apollo.ApolloClient$executeAsFlowInternal$flow$1$2.invokeSuspend(ApolloClient.kt:260)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@3b7b1dc, Dispatchers.Main.immediate]
Metadata
Metadata
Assignees
Labels
BugIssue type
Projects
- StatusShow more project fieldsNo status
Activity
markushi commentedon Aug 28, 2024
@DroidPulkit it looks like Apollo v4 introduced a change which breaks our interceptor. By any chance, did you try with Apollo v3 as well?
kahest commentedon Aug 28, 2024
Created an issue for implementing Apollo4 support: #3662
markushi commentedon Aug 28, 2024
Closing in favor of #3662
DroidPulkit commentedon Aug 28, 2024
Yeah for Apollo v3, I was using sentry-apollo3 library, I presumed, that when apollo changed their package name from apollo3 to apollo, after v4 upgrade, you folks at sentry did too. That's the reason, I choose, the sentry-apollo library.
But, now it all makes sense, that we don't have support for apollo v4 yet. Looking forward to it. Thanks
kahest commentedon Aug 29, 2024
@DroidPulkit thanks for the input, I agree it's a bit confusing atm - we updated the docs on our Apollo/Apollo3 integrations to clarify which Apollo versions they support, and we'll likely (need to) introduce a new Apollo4 integration later