awslabs / aws-mobile-appsync-sdk-android

Android SDK for AWS AppSync.
https://docs.amplify.aws/sdk/api/graphql/q/platform/android/
Apache License 2.0
105 stars 58 forks source link

App Sync SDK Crashing with java.lang.IllegalStateException #363

Open jayshildave1983 opened 3 years ago

jayshildave1983 commented 3 years ago

Describe the bug There is a crash in the interceptor for App Sync SDK in the class AppSyncSigV4SignerInterceptor.java line number 173 The chain request needs to be closed before it can be proceeded.

To Reproduce Steps to reproduce the behavior: The crash is random and happens generally when there is a retry request in place

Expected behavior The SDK should not crash while trying to do a retry request.

Screenshots Not applicable

Environment(please complete the following information):

Device Information (please complete the following information):

Additional context This came in because OKHttp used by AppSyncSDK for Networking request had a update. Details can be found here https://github.com/square/okhttp/issues/4986

Crash log with details. Fatal Exception: java.lang.IllegalStateException: cannot make a new request because the previous response is still open: please call response.close() at okhttp3.internal.connection.Transmitter.newExchange$okhttp(Transmitter.java:157) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:35) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:87) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:82) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:87) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:112) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:71) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:87) at com.amazonaws.mobileconnectors.appsync.sigv4.AppSyncSigV4SignerInterceptor.intercept(AppSyncSigV4SignerInterceptor.java:173)