question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chucker 3.1.2 re-writing the Server Response; throws IOException when used as a networkInterceptor

See original GitHub issue

✍️ Describe the bug

After updating to 3.1.2 (from 3.0.1) every request fails with an IOException:

java.io.IOException: ID1ID2: actual 0x00007b22 != expected 0x00001f8b
System.err:     at okio.GzipSource.checkEqual(GzipSource.java:205)
System.err:     at okio.GzipSource.consumeHeader(GzipSource.java:120)
System.err:     at okio.GzipSource.read(GzipSource.java:73)
System.err:     at okio.RealBufferedSource.read(RealBufferedSource.java:51)
System.err:     at okio.ForwardingSource.read(ForwardingSource.java:35)
System.err:     at retrofit2.OkHttpCall$ExceptionCatchingResponseBody$1.read(OkHttpCall.java:288)
System.err:     at okio.RealBufferedSource.select(RealBufferedSource.java:100)

Chucker 3.0.1 returned the original Response. 3.1.x seems to process the response and returns this “processed Response” (see here).

I see the need of processing the Response and doing stuff with it. But the Interceptor has to return the original response at the end, since Chucker is only some kind of debugging ouput, which should not change the Request/Response in any way.

💣 Steps to reproduce

  • Add ChuckerInterceptor as a networkInterceptor
  • I think the Request has to be gzipped

🔧 Expected behavior

  • Chucker should not alter the Server Response

📱 Tech info

Chucker version: 3.1.2 OkHttp version: 3.14.6

📄 Additional context

This only happens when the ChuckerInterceptor is added as a networkInterceptor. The Notification shows the correct Request with the Response.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
vbuberencommented, Mar 4, 2020

Yes, we should include it into 3.2.0. As for ETA - I would say that I would love to see support of GraphQL to release the new version. It seems that I need to dive into that old PR myself, since there is completely no progress or movement for quite a long time.

1reaction
MiSikoracommented, Feb 26, 2020

Ok, I pushed one small change to the PR to not rewrite the response at all.

The idea sounds nice. If you would be able to send a draft PR for this approach we could brainstorm on this (or you can join the #chucker channel on Kotlinlang and we can discuss over there)

I’ll gladly make some PoC when I find more time as this is rather big change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

https://raw.githubusercontent.com/ChuckerTeam/chuc...
Chucker now shows partially read application responses properly. ... Fix for [#242] with Chucker throwing exceptions when used as `networkInterceptor()`.
Read more >
chapter 3 notes filled in.pdf
For example, if the original expression has a negative exponent, then rewrite the expression so that it has no negative exponents, and vice...
Read more >
How to build an HTTP interceptor for an Android app ... - Blog
We can do it by overwriting the public Response intercept(Chain chain) throws IOException; method. Our implementation will mimic the original ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found