-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Chucker 3.1.2 re-writing the Server Response; throws IOException when used as a networkInterceptor #242
Comments
Thanks for your report. @cortinico the more such reports we have the more I want to rework interceptor in a way where we just do a copy of response for processing, while returning the original response further to the chain. Something like I showed you when we discussed the issue presented in |
Agree. Maybe we should spend some time writing some proper JUnit tests for the critical I'm curious to hear @jannisveerkamp what's your use case to use Chucker as |
Is there actually a reason to not return the original Response at the end? I just want to see every outgoing Request. When adding Chucker as an |
Hi @jannisveerkamp Your issue isn't the first of such type. For example, here is #203 , #225, which I believe are all from the same origin, so I am going to take action and do it described way. @cortinico Absolutely agree about test coverage. Since it appears again after our recent discussion in Slack, it is not not The only thing is that I am a bit overwhelmed at the moment and will be available in ~2 weeks to do this thing (hopefully, earlier). So attaching |
In my intial #226 PR I did changes where requests and responses were gzipped back again before being sent or received respectively. I shied away from it so the behaviour wouldn't be changed. Ideally, I think, Chucker should intercept raw data directly to files instead of runtime memory and do the work on these files as input streams. This would allow data to be streamed to both end consumer and a file. It would also help with large requests or responses and potentially some OOM issues. |
Hey @jannisveerkamp |
Can you elaborate more on this? Are you suggesting we first dump the raw data to file and then we move it over inside the DB? |
Not exactly. I suggest that |
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 can test it later or tomorrow. But I still think it should return the original response 💭 |
Thanks. No rush here. |
Ok, I pushed one small change to the PR to not rewrite the response at all.
I'll gladly make some PoC when I find more time as this is rather big change. |
Hey, are there plans to include this in |
Ideally yeah. We don't have a ETA yet, but this is definitely something worth to end up in the upcoming release. |
Yes, we should include it into |
Definitely valuable but not a release blocker IMHO. |
Yeah, it is not a blocker, but it was postponed quite a lot as I see it. |
✍️ Describe the bug
After updating to 3.1.2 (from 3.0.1) every request fails with an
IOException
: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
ChuckerInterceptor
as anetworkInterceptor
🔧 Expected behavior
📱 Tech info
Chucker version:
3.1.2
OkHttp version:
3.14.6
📄 Additional context
This only happens when the
ChuckerInterceptor
is added as anetworkInterceptor
.The Notification shows the correct Request with the Response.
The text was updated successfully, but these errors were encountered: