Closed Bug 1375778 Opened 7 years ago Closed 7 years ago

Convert old console filter preferences to new ones

Categories

(DevTools :: Console, enhancement, P1)

enhancement

Tracking

(firefox56 verified)

VERIFIED FIXED
Firefox 56
Iteration:
56.3 - Jul 24
Tracking Status
firefox56 --- verified

People

(Reporter: nchevobbe, Assigned: Honza)

Details

(Whiteboard: [console-html])

Attachments

(1 file)

In the new console, we introduced new preferences for filtering since we don't follow the same pattern as in the old one (no level for each category).
This means that someone who switch from old to new console might not get the filter preferences they're used to.
We should have a way to convert those old filter preferences to the new ones
Flags: qe-verify+
Priority: -- → P2
Whiteboard: [console-html]
QA Contact: iulia.cristescu
Assignee: nobody → odvarko
Status: NEW → ASSIGNED
Priority: P2 → P1
Iteration: --- → 56.3 - Jul 24
The three transformations that I think we should support:

Net->Log in the old UI should map to "Requests" in the new UI
Net->XHR in the old UI should map to "XHR" in the new UI
CSS->Warning/Error should map to "CSS" in the new UI

This can be done in migrateUI in nsBrowserGlue (https://dxr.mozilla.org/mozilla-central/source/browser/components/nsBrowserGlue.js#1713) so that it only runs once per profile.
> Net->XHR in the old UI should map to "XHR" in the new UI
This pref has the same name [1] in the old and new UI, so
no conversion is needed.

[1] devtools.webconsole.filter.netxhr

Honza
Comment on attachment 8886567 [details]
Bug 1375778 - Convert old console filter preferences to new ones;

https://reviewboard.mozilla.org/r/157388/#review162622

::: browser/components/nsBrowserGlue.js:2062
(Diff revision 1)
> +    if (currentUIVersion < 50) {
> +      // Transform prefs related to old DevTools Console.
> +      if (Services.prefs.getBoolPref("devtools.webconsole.filter.networkinfo")) {
> +        Services.prefs.setBoolPref("devtools.webconsole.filter.net", true);
> +      }
> +      if (Services.prefs.getBoolPref("devtools.webconsole.filter.csserror") ||

I think I was too aggressive here when mapping CSS errors onto this CSS button (I didn't realize that devtools.webconsole.filter.csserror is on by default, so this would force most users into having the CSS filter on, which is much more verbose).

Perhaps this should instead check only "devtools.webconsole.filter.cssparser", which maps to CSS->Warnings and is an approximation for what you will see with the CSS button in the new frontend ticked. What do you think?
Comment on attachment 8886567 [details]
Bug 1375778 - Convert old console filter preferences to new ones;

https://reviewboard.mozilla.org/r/157388/#review162624
Attachment #8886567 - Flags: review?(bgrinstead)
(In reply to Brian Grinstead [:bgrins] from comment #4)
> Perhaps this should instead check only
> "devtools.webconsole.filter.cssparser", which maps to CSS->Warnings and is
> an approximation for what you will see with the CSS button in the new
> frontend ticked. What do you think?

Yep, that make sense.
Patch updated.

Honza
Comment on attachment 8886567 [details]
Bug 1375778 - Convert old console filter preferences to new ones;

https://reviewboard.mozilla.org/r/157388/#review163056

::: browser/components/nsBrowserGlue.js:2059
(Diff revision 2)
>        Services.prefs.setIntPref("browser.onboarding.seen-tourset-version", 0);
>      }
>  
> +    if (currentUIVersion < 50) {
> +      // Transform prefs related to old DevTools Console.
> +      if (Services.prefs.getBoolPref("devtools.webconsole.filter.networkinfo")) {

At some point we are going to delete these prefs, and we won't want to throw in that case. So this looks good with the following changes:

1) File a bug to delete the old webconsole frontend and link to it in a comment here as a reminder to delete this migration
2) try/catch this whole block as in the (currentUIVersion < 47) block
Attachment #8886567 - Flags: review?(bgrinstead)
Done, created bug 1381834

Thanks for the review Brian,
Honza
Comment on attachment 8886567 [details]
Bug 1375778 - Convert old console filter preferences to new ones;

https://reviewboard.mozilla.org/r/157388/#review163530
Attachment #8886567 - Flags: review?(bgrinstead) → review+
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9ac411f620a5
Convert old console filter preferences to new ones; r=bgrins
https://hg.mozilla.org/mozilla-central/rev/9ac411f620a5
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Trying to verify this, I noticed some possible issues. Per comment 1, Net->Log from the old console should map to "Requests" in the new UI, but choosing Requests displays nothing in the new console. Also, the new UI displays the same content as the old one only when both "Requests" and "Logs" are triggered. Similar outcome is met for Net->XHR - "XHR" and CSS->Warning/Error - "CSS" cases. I used 51.0a1 (2016-08-16) for the old UI and latest Nightly 56.0a1 (2017-07-24) for the new one and simultaneously compared the results for the same site (e.g.  https://www.amazon.com/). Any thoughts about this?
Flags: needinfo?(nchevobbe)
Hi Iulia, 

Thanks for reporting that.
I filed Bug 1385791 for Requests and XHR, which seem plain bugs.

For CSS, I'll bring that up at our meeting today.
Flags: needinfo?(nchevobbe)
Based on comment 14, comment 15 and the fact that bug 1385791 is verified fixed, I will mark this bug as verified fixed as well.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: