Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with HttpCache causes HttpParseException #2107

Merged
merged 1 commit into from Mar 30, 2020

Conversation

sav007
Copy link
Contributor

@sav007 sav007 commented Mar 27, 2020

When app is freshly installed (or when there is no cached response)
When HttpLoggingInterceptor is added to OkHttp
Log level is set to BODY
The issues is that HttpLoggingInterceptor when logging response body requests whole response https://github.com/square/okhttp/blob/master/okhttp-logging-interceptor/src/main/java/okhttp3/logging/HttpLoggingInterceptor.kt#L244-L246
that causes ApolloParseInterceptor to fail as there was a bug in our http cache: we didn't properly buffer original response, so instead of giving buffered response to ApolloParseInterceptor we give it non-buffered, that obviously will fail as response already was read from the source.

Closes #1786

@sav007 sav007 self-assigned this Mar 27, 2020
@tasomaniac tasomaniac merged commit f614133 into apollographql:master Mar 30, 2020
tasomaniac pushed a commit that referenced this pull request Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting HttpParseException when using ApolloClient with HttpCache configuration
2 participants