URLs reported to the console can be overly long
Categories
(DevTools :: Console, enhancement, P1)
Tracking
(firefox68 fixed)
| Tracking | Status | |
|---|---|---|
| firefox68 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
(Whiteboard: [console-grouping])
Attachments
(3 files, 4 obsolete files)
| Reporter | ||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
| Reporter | ||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
| Reporter | ||
Comment 8•7 years ago
|
||
| Reporter | ||
Comment 9•7 years ago
|
||
| Assignee | ||
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
| Reporter | ||
Comment 12•6 years ago
|
||
| Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 13•6 years ago
|
||
I'm going to give this a try
Updated•6 years ago
|
| Assignee | ||
Comment 14•6 years ago
|
||
| Assignee | ||
Comment 15•6 years ago
|
||
Depends on D28643
| Assignee | ||
Comment 16•6 years ago
|
||
Depends on D28644
| Assignee | ||
Comment 17•6 years ago
|
||
Ehsan, if you have some time I'd really appreciate feedback and help on the 2 C++ patches attached as it's taking me quite some time to figure things out. Thanks!
| Reporter | ||
Comment 18•6 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #17)
Ehsan, if you have some time I'd really appreciate feedback and help on the 2 C++ patches attached as it's taking me quite some time to figure things out. Thanks!
I commented on https://phabricator.services.mozilla.com/D28643. I haven't yet looked at the patches too deeply since your investigations may still change the patches but overall they looked good!
| Assignee | ||
Comment 19•6 years ago
|
||
Here's how it can looks like.
In this screenshot, URL are cropped at 100 characters. They're also actual URL, so you can click on them top open them, or right-click to copy to clipboard. Hovering a cropped URL gives the full URL as well.
I guess we can discuss where we could crop, as it still feels a bit long to me (we could maybe go to 80?).
Comment 20•6 years ago
|
||
Using NI, because Phabricator is really not helpful for poking people.
Can you take a look at
https://phabricator.services.mozilla.com/D28646#inline-163996
Comment 21•6 years ago
|
||
Sorry, I don't have good news.
Our supported surface of printf is documented on https://searchfox.org/mozilla-central/rev/d143f8ce30d1bcfee7a1227c27bf876a85f8cede/xpcom/string/nsTextFormatter.h#17-31. What the patch does is to explicitly rely on the details on how that code handles unknown parameters.
To make that at least somewhat stable, we would need to invest into compare-locales to build out printf muscles, and I really don't want to invest into that dying part of our ecosystem. It took us about a decade to get to the current stable state, where mishaps around formatters fall back safely, and introducing formatters that don't would be disappointing.
That said, I think we should at some point have a Fluent-enabled error console, which passes error meta data, fluent resource, and ID all the way to the console service, and generates the localized error message at display time. That would, among other things, allow to retranslate error messages on language switching, but probably also addresses the questions raised here for ways to do more interesting things on display. That's about as concrete as my thinking about this part of our UI and the transition to Fluent is at this point.
I have no idea how close that is to what you'd end up doing anyway, but I'm afraid it's not close.
| Assignee | ||
Comment 22•6 years ago
|
||
Thanks for your answer. I'm definitely not close to what you're suggesting.
We could drop all this platform patch, and use the StringRep to render every error message (so we get the linkification).
What I don't like with this approach is that we parse the message to detect links, which seems silly as in Gecko, we know we want to display URLs.
Also, this patch was meant to ease the work for Bug 1545888, where we could have use the placeholders easily.
Given the timeline of the grouping features we want to have, I'm not sure what to do.
I guess we could keep the property message as is, and still include those URLs as nsIScriptErrorParameter.
Then on the frontend, we won't have to parse the text as much, simply search for parts of the message that match the parameters, and swap them with a link.
It may also be a good first step towards Fluent, as we'll already have the platform side ready.
I'll try to come up with something tomorrow and we can discuss how it looks.
| Assignee | ||
Comment 23•6 years ago
|
||
Okay, I thought about this a bunch yesterday and today, and there's no solution I'm happy with, so at least I'll go with the easier one: I'll use the StringRep to render all error messages, adding a urlCropLimit prop to it. Doing that, we'll have the URL linkification for all error messages, and we can apply the cropping from the client, without losing the actual URL.
I'm not happy with it because it means we're going to parse those error messages from the client, although we know on the platform we're printing URLs (and that I spent a good amount of time on the original patch :/).
But I think that's the wiser move here, given the mismatching timelines of warning message grouping and Fluent.
Also, this will be easy to revert/adjust once we think we're ready to have message metadata sent from platform to client.
Comment 24•6 years ago
|
||
sgtm, thanks.
| Assignee | ||
Comment 25•6 years ago
|
||
This new prop allow us to define a maximum length for indivual
URLs (as opposed to cropLimit, which sets it for the whole text).
The URL regex is also modified to be able to linkify messages
wrapped in curly quotes.
Some tests are added to ensure we handle this prop as expected.
| Assignee | ||
Comment 26•6 years ago
|
||
This allows us to benefit from the linkification that
is done there. We crop the URL at 120 chars for now. We might
consider bumping this up depending on the feedback we get.
We add both a mocha and a mochitest to make sure this work as expected.
Depends on D29006
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/395e27a912b3
https://hg.mozilla.org/mozilla-central/rev/b87cdb455083
Description
•