Closed
Bug 1302982
Opened 8 years ago
Closed 8 years ago
Reps does not handle long strings
Categories
(DevTools :: Shared Components, defect, P2)
Tracking
(firefox52 fixed)
RESOLVED
FIXED
Firefox 52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
STR:
1. Create a global variable in the console `longString = Array(10000).fill("a").join("");`
2. Go to the DOM Panel and search for the `longString` variable
ER:
longString value is displayed as a truncated string `"aaaaaaaaaaaaaaaaaaaaaaaaa…aaaaaaaaaaaaaaaaaaaaaaaa""aaaaaaaaaaaaaaaaaaaaaaaaa…aaaaaaaaaaaaaaaaaaaaaaaa"`
AR:
longString value is `Object`, without properties
Assignee | ||
Comment 1•8 years ago
|
||
What is happening is that when we create a large string, we get a grip which type is `longString`.
The longString grip is an object with the following form :
{
type: "longString",
initial: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...",
length: 10000,
actor: "server1.conn1.child1/longString41"
}
The initial property seems to contain the first thousand character of the complete string.
I wonder if we could simply use this initial property or if we should retrieve the complete string (like it's done here for example http://searchfox.org/mozilla-central/source/devtools/shared/webconsole/client.js#623 ).
It seems a bit of an overkill for me to do another server round-trip (even if we could do so only if initial.length < length ) because we will then truncate the string in the middle.
But in the other hand, if we only work with the initial property, we will only check the first thousand characters, and we will display an inaccurate truncation ( if longString is for example 5000 "aa" and then 5000 "bb" , we would display "aa...aa" , which is not correct).
What do you think of this Honza ?
Flags: needinfo?(odvarko)
Assignee | ||
Comment 2•8 years ago
|
||
Something I just saw, in the DOM panel, if you click on the truncated string, we show the complete string. If we only work with the `initial` property, we won't get the real full string.
Comment 3•8 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)
> What is happening is that when we create a large string, we get a grip which
> type is `longString`.
> The longString grip is an object with the following form :
>
> {
> type: "longString",
> initial: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...",
> length: 10000,
> actor: "server1.conn1.child1/longString41"
> }
>
> The initial property seems to contain the first thousand character of the
> complete string.
> I wonder if we could simply use this initial property or if we should
> retrieve the complete string (like it's done here for example
> http://searchfox.org/mozilla-central/source/devtools/shared/webconsole/
> client.js#623 ).
I think we should just use the initial property and display the '...' at the end - since that's how the string is truncated and received from the backend in the first place. We might also change/customize the back-end to truncate the string in the middle (to correspond to what we want to show in the UI).
>
> It seems a bit of an overkill for me to do another server round-trip (even
Totally agree, that's why I think the back-end should cooperate more with the front-end and truncate long strings the same way (as needed).
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #2)
> Something I just saw, in the DOM panel, if you click on the truncated
> string, we show the complete string. If we only work with the `initial`
> property, we won't get the real full string.
Yes, the DOM panel UI/UX is built on top of how the backend works. The user sees only the `initial` string initially a and if it isn't enough an extra user action (click to expand) is required.
The HTTPi UI/UX in the Console panel works similarly for responses (HTTP response is also long string). If the user expands HTTP request in the Console panel and switches into the Response tab, only `initial` part of the response is visible + there is a 'more...' link (at the end) that, if clicked, resolves the long string and shows the rest of the response.
I think we should always try (if possible) to come up with UI/UX that requires and extra action from the user to avoid automatic string-resolving initiating new round-trip. This auto-resolving kind of breaks the idea of having the long-string in the first place.
Honza
Flags: needinfo?(odvarko)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•8 years ago
|
||
Honza the patch for review is the following of https://reviewboard.mozilla.org/r/88384/ , it's better to have it here, the other bug is more console specific since we should add a way to expand a longString in it.
Assignee | ||
Comment 6•8 years ago
|
||
Comment 7•8 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #5)
> Honza the patch for review is the following of
> https://reviewboard.mozilla.org/r/88384/ ,
Hm..., the patch seems to be discarded. Is it correctly pushed to mozreview?
Honza
Flags: needinfo?(chevobbe.nicolas)
Assignee | ||
Comment 8•8 years ago
|
||
This one is fine isn't it https://reviewboard.mozilla.org/r/90458/ ?
The one I mentioned in comment 5 was on another bug that wasn't best suited for it.
Flags: needinfo?(chevobbe.nicolas)
Updated•8 years ago
|
Status: NEW → ASSIGNED
Comment 9•8 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #5)
> Honza the patch for review is the following of
> https://reviewboard.mozilla.org/r/88384/ , it's better to have it here, the
> other bug is more console specific since we should add a way to expand a
> longString in it.
I made the review, but of course the result went to bug 1310630
So, the expandability will be part of bug 1310630 ?
Honza
Assignee | ||
Comment 10•8 years ago
|
||
Thanks for the review Honza
> I made the review, but of course the result went to bug 1310630
wow, that's so weird, my bad for messing this up in the first place
> So, the expandability will be part of bug 1310630 ?
For the console, yes, and there is Bug 1314923 for the DOM Panel too.
Comment 11•8 years ago
|
||
mozreview-review |
Comment on attachment 8807231 [details]
Bug 1302982 - Add Rep for LongString;
https://reviewboard.mozilla.org/r/90458/#review91580
R+ this patch, again assuming try is green.
Honza
Attachment #8807231 -
Flags: review?(odvarko) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 13•8 years ago
|
||
Comment 14•8 years ago
|
||
Pushed by chevobbe.nicolas@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/5ffa818f1cb3
Add Rep for LongString; r=Honza
Comment 15•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•