Open reguez opened 2 years ago
@reguez can you please identify how you trigger the issue so that we can test your solution out? Specifically what you are trying to do, how do you call the api (in what context) and please add some sample code if you can.
@gpanshu
Sadly I wasn't able to reproduce the issue myself but one of the users did. I was able to extract the log from crashlytics
Fatal Exception: java.lang.IllegalStateException: Already Executed at okhttp3.internal.connection.RealCall.enqueue(RealCall.kt:161) at com.apollographql.apollo.internal.interceptor.ApolloServerInterceptor$1.run(ApolloServerInterceptor.java:91) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:920)
Other than that I couldn't pinpoint the source origin from my code base
@gpanshu when can we expect an update? Multiple clients are experiencing this issue.
@oussama-reguez could you please provide steps for reproduction?
@poojamat as explained here I couldn't reproduce the issue but from crashlytics, I see multiple crash logs
fix: ApolloServerInterceptor HTTP call is now cloned to prevent "IllegalStateException: Already executed"
Issue #, if available: IllegalStateException is raised when a Call is used multiple times
Description of changes: use call.clone().enqueue(..) for Asynchronous and call.clone().execute() for Synchronous respectively to ensure that you have a fresh, unexecuted Call for each request.