Closed Bug 1129197 Opened 10 years ago Closed 6 years ago

JSON.parse error on Response tab in netmonitor on large request

Categories

(DevTools :: Netmonitor, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: bgrins, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached image json-parse-error.png
STR: Open netmonitor Load https://datazilla.mozilla.org/talos/testdata/raw/Try-Non-PGO/9a2f99d3d954. Inspect the request in the netmonitor and click the "Response" tab See an error instead of the expected data response (see screenshot) Looks like the request is maybe being truncated.
Note: we originally saw this when inspecting one of the requests on a compare talos result: http://compare-talos.mattn.ca/dev/?oldBranch=Try&oldRevs=7032272b7292&newBranch=Try&newRev=9a2f99d3d954&submit=true. Some of the requests made by that page are previewable, others aren't.
(In reply to Brian Grinstead [:bgrins] from comment #0) > Looks like the request is maybe being truncated. Your suspicion is correct[1]. I am not sure why we do this though... I guess to save memory in case you never look at the full response? As I understand the APIs, the server would need save the full response somewhere if we ever want to display it (without requiring an extra refresh). Jeff, any thoughts? Should we just always save the full response? [1]: https://hg.mozilla.org/mozilla-central/annotate/58e4264903ba/toolkit/devtools/webconsole/network-monitor.js#l33
Flags: needinfo?(jgriffiths)
(In reply to J. Ryan Stinnett [:jryans] from comment #2) > (In reply to Brian Grinstead [:bgrins] from comment #0) > > Looks like the request is maybe being truncated. > > Your suspicion is correct[1]. > > I am not sure why we do this though... I guess to save memory in case you > never look at the full response? > > As I understand the APIs, the server would need save the full response > somewhere if we ever want to display it (without requiring an extra refresh). > > Jeff, any thoughts? Should we just always save the full response? > > [1]: > https://hg.mozilla.org/mozilla-central/annotate/58e4264903ba/toolkit/ > devtools/webconsole/network-monitor.js#l33 I think there is probably some sanity we could apply here: 1. if a JSON request passes a certain threshold, bail out on displaying it all. 1MB cut-off? Less? 2. if the user really really wants to see the whole thing in the object view, allow them to manually click on a button that then fetches them whole thing with a linked progress meter, then displays the data. Can't hurt to also display a warning: "this file sure is is darned big, things might get slow".
Flags: needinfo?(jgriffiths)
Product: Firefox → DevTools

Honza, can you confirm this got fixed? I can't seem to trigger the JSON error anymore for truncated responses.

Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(odvarko)
Resolution: --- → WORKSFORME

Correct, I am seeing "Response has been truncated" instead of an error message.
Honza

Flags: needinfo?(odvarko)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: