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

Large json responses result in bad user experience #82

Closed
ColtonIdle opened this issue Aug 9, 2019 · 9 comments · Fixed by #172
Closed

Large json responses result in bad user experience #82

ColtonIdle opened this issue Aug 9, 2019 · 9 comments · Fixed by #172
Labels
bug Something isn't working help wanted Extra attention is needed work-in-progress This Issue/PR is currently under development

Comments

@ColtonIdle
Copy link
Sponsor

ColtonIdle commented Aug 9, 2019

Some of the backends I work with send really large amounts of data.

Here is a sample: https://data.cityofnewyork.us/api/views/kku6-nxdu/rows.json

Moving from the request to response tab is slow, and trying to "Share as text" is also impossible. It'd be great to keep this on the roadmap for improvement.

Edit: Occurs in latest stable and beta

Edit 2: Maybe just show the first x amount of lines, but still provide a way to export or view the json as a file?

@cortinico
Copy link
Member

Part of this issue was addressed by @redwarp in #72

Edit 2: Maybe just show the first x amount of lines, but still provide a way to export or view the json as a file?

You can set the maxContentLength on the ChuckerInterceptor to truncate the body if needed (but still you won't be able to export or share the full body afterwards).

Curious to hear what others think about this

@cortinico cortinico added the help wanted Extra attention is needed label Aug 9, 2019
@ColtonIdle
Copy link
Sponsor Author

Gotcha. I think after a certain size maybe 500k or something the text just gets treated as a file. Then in the response tab it can say "Response exceed x" with a button that opens the file in another file viewer. Also, the share as text would turn into a "Share as file" button?

@cortinico
Copy link
Member

Sounds more like as a feature-request.
Definitely valuable to implement :)

@redwarp
Copy link
Collaborator

redwarp commented Aug 10, 2019

Actually, being able to open any response as a file with another viewer sounds like a great idea!

@kmayoral
Copy link
Contributor

Just tried out this library and it looks great, but the one thing keeping me from migrating over from Chuck is this issue where large json responses cause Chucker to hang and then eventually crash after you try and swipe from the Overview tab to either the Request or Response tab (probably when the data starts to get loaded into the Response tab).

Chuck is able to show these responses (even if there is no ability to search) so for now, I'll have to stay with Chuck.

Looking forward to trying this library again in the future, it looks great!

@ColtonIdle
Copy link
Sponsor Author

Just bumping this. Tried using Chucker on a new project and it's completely useless because of large json. It just ANRs. 😭

@cortinico
Copy link
Member

Just bumping this. Tried using Chucker on a new project and it's completely useless because of large json. It just ANRs.

Thanks for bumping. Is this still happening? If yes, which version are you using? 3.0.1?

@ColtonIdle
Copy link
Sponsor Author

@cortinico yes this is still happening. I am using 3.0.1

@cortinico cortinico added the bug Something isn't working label Jan 2, 2020
@cortinico
Copy link
Member

cortinico commented Jan 2, 2020

Ok so after some investigation, turns out the issue is on the TransactionPayloadFragment. When dealing with big payloads, we hang the UI thread by setting the text of a TextView with a huge String:

I do have a proposed fix for this, that unfortunately has a couple of drawbacks.

Chuck is able to show these responses (even if there is no ability to search)
so for now, I'll have to stay with Chuck.

@kmayoral I've tried Chuck with the HTTP request that was suggested on top of this thread (https://data.cityofnewyork.us/api/views/kku6-nxdu/rows.json) and the behavior is exactly the same. Are you sure of this?

@vbuberen vbuberen added the work-in-progress This Issue/PR is currently under development label Jan 8, 2020
cortinico added a commit that referenced this issue Jan 12, 2020
Currently Chucker UI hangs when the HTTP request/response body is too
big. The issue is caused by having to put a bunch of text inside a
single TextView.

This commit refactors the request/response body screen to use a
RecyclerView to load single lines. In this way the UI is much smoother
and the experience is generally better.

Fixes #82
vbuberen pushed a commit that referenced this issue Jan 12, 2020
* Fixing handling of big body payloads

Currently Chucker UI hangs when the HTTP request/response body is too
big. The issue is caused by having to put a bunch of text inside a
single TextView.

This commit refactors the request/response body screen to use a
RecyclerView to load single lines. In this way the UI is much smoother
and the experience is generally better.

Fixes #82
* Fix search highlighting the wrong line
kmayoral pushed a commit to kmayoral/chucker that referenced this issue Jan 21, 2020
* Fixing handling of big body payloads

Currently Chucker UI hangs when the HTTP request/response body is too
big. The issue is caused by having to put a bunch of text inside a
single TextView.

This commit refactors the request/response body screen to use a
RecyclerView to load single lines. In this way the UI is much smoother
and the experience is generally better.

Fixes ChuckerTeam#82
* Fix search highlighting the wrong line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed work-in-progress This Issue/PR is currently under development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants