Bug 1303707 - Fix collecting of formats-at-issues - r?gijs draft
authorGerald Squelart <gsquelart@mozilla.com>
Sun, 18 Sep 2016 22:24:47 -0700
changeset 415029 3fb3ecbf130e7453da6b39c9c07663f3d2963696
parent 414763 f0f15b7c6aa77a0c5750918aa0a1cb3dc82185bc
child 415033 167531137e0a1a0dfe526bf39e1a603abbc6c2ad
push id29781
push usergsquelart@mozilla.com
push dateMon, 19 Sep 2016 10:23:42 +0000
reviewersgijs
bugs1303707
milestone51.0a1
Bug 1303707 - Fix collecting of formats-at-issues - r?gijs Array.filter was given the wrong information, so we were only adding existing name, instead of adding new ones. This is not critical, as this is only useful to better find when issues are fixed, that's why I'm fixing it in a fly-by here. MozReview-Commit-ID: CGkN3BbSTge
browser/base/content/browser-media.js
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -291,17 +291,17 @@ let gDecoderDoctorHandler = {
       if (!formatsInPref) {
         Services.prefs.setCharPref(formatsPref, formats);
         histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SHOWN_FIRST);
       } else {
         // Split existing formats into an array of strings.
         let existing = formatsInPref.split(",").map(String.trim);
         // Keep given formats that were not already recorded.
         let newbies = formats.split(",").map(String.trim)
-                      .filter(x => existing.includes(x));
+                      .filter(x => !existing.includes(x));
         // And rewrite pref with the added new formats (if any).
         if (newbies.length) {
           Services.prefs.setCharPref(formatsPref,
                                      existing.concat(newbies).join(", "));
         }
       }
       histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SHOWN);