awslabs / awslabs/aws-mobile-appsync-sdk-android
App Sync SDK Crashing with java.lang.IllegalStateException
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 106
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
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):
- AppSync SDK Version: 3.1.1
Device Information (please complete the following information):
- Device: All
- Android Version: All
- Specific to simulators: No
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in AppSyncSigV4SignerInterceptor.java at line 173 and review the retry path alongside the crash log and referenced OkHttp issue. Check how the previous response is handled before proceeding with a retry. Done means retry requests complete without the IllegalStateException on the supported AppSync SDK version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, graphql, java
- Domain
- api, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100