Title: SentryApolloInterceptor implements ApolloInterceptor but crashes app · Issue #3661 · getsentry/sentry-java · GitHub
Open Graph Title: SentryApolloInterceptor implements ApolloInterceptor but crashes app · Issue #3661 · getsentry/sentry-java
X Title: SentryApolloInterceptor implements ApolloInterceptor but crashes app · Issue #3661 · getsentry/sentry-java
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 s...
Open Graph 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 lib...
X 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 lib...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/3661
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SentryApolloInterceptor implements ApolloInterceptor but crashes app","articleBody":"### Integration\n\nsentry-android\n\n### Build System\n\nGradle\n\n### AGP Version\n\n8.5.0\n\n### Proguard\n\nEnabled\n\n### Version\n\n7.14.0\n\n### Steps to Reproduce\n\n1) Use Apollo GraphQL version: 4.0.0 and com.apollographql.apollo:apollo-runtime library\n2) Use Sentry latest version and use sentry-apollo library\n3) Add SentryApolloInterceptor to your ApolloClient.Builder() with .addInterceptor(SentryApolloInterceptor())\n4) Run the app to emulator\n\n### Expected Result\n\nApp should run, right?\n\n### Actual Result\n\nApp crashes why?\n\nSentryApolloInterceptor implements ApolloInterceptor.\nWhat is ApolloInterceptor?\n\n```\ninterface ApolloInterceptor {\n fun \u003cD : Operation.Data> intercept(request: ApolloRequest\u003cD>, chain: ApolloInterceptorChain): Flow\u003cApolloResponse\u003cD>>\n}\n```\n\nWe have `override fun interceptAsync()` instead of `override fun intercept()` in SentryApolloInterceptor class, which leads to following crash:\n\n```\njava.lang.AbstractMethodError: abstract method \"kotlinx.coroutines.flow.Flow com.apollographql.apollo.interceptor.ApolloInterceptor.intercept(com.apollographql.apollo.api.ApolloRequest, com.apollographql.apollo.interceptor.ApolloInterceptorChain)\"\n \tat com.apollographql.apollo.interceptor.DefaultInterceptorChain.proceed(ApolloInterceptor.kt:23)\n \tat com.apollographql.apollo.ApolloClient.apolloResponses$apollo_runtime_debug(ApolloClient.kt:322)\n \tat com.apollographql.apollo.ApolloClient$executeAsFlowInternal$flow$1$2.invokeSuspend(ApolloClient.kt:260)\n \tat kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)\n \tat kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)\n \tat kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)\n \tat kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)\n \tat kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)\n \tat kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)\n \tat kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)\n \tat kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)\n \tSuppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@3b7b1dc, Dispatchers.Main.immediate]\n```\n","author":{"url":"https://github.com/DroidPulkit","@type":"Person","name":"DroidPulkit"},"datePublished":"2024-08-27T17:28:30Z","url":"https://github.com/getsentry/sentry-java/issues/3661"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8b8d19a5-68e8-6a69-c796-d1b460678d65 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6D0:92F6:3A5F18:53721C:6B04708F |
| html-safe-nonce | 21b80a5110d5834fc4d66dbee7f2e7b81adae97eeff2e6da5098e9b45b1653ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkQwOjkyRjY6M0E1RjE4OjUzNzIxQzo2QjA0NzA4RiIsInZpc2l0b3JfaWQiOiI4ODM4OTA1NjcwMzI2ODQxNDg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 69b76444e63f720dbc73828b12472826af41e79f8359ad10a8ba12860f53e118 |
| hovercard-subject-tag | issue:2489968780 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/3661/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5204dd27bab8408bdb5a1ffdf36789dc6b85a9cb8f4431dd979bda819c0b1e0/getsentry/sentry-java/issues/3661 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5204dd27bab8408bdb5a1ffdf36789dc6b85a9cb8f4431dd979bda819c0b1e0/getsentry/sentry-java/issues/3661 |
| og:image:alt | 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 lib... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DroidPulkit |
| hostname | github.com |
| expected-hostname | github.com |
| None | ae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cfb5f24c6e01d85f70804652a5107e5cac03a161 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width