Bug 1247056 - Fix collecting of formats-at-issues - r?gijs draft
authorGerald Squelart <gsquelart@mozilla.com>
Sun, 18 Sep 2016 22:24:47 -0700
changeset 415019 c48a945cb0733fbb736c25109c3003312f9ab329
parent 415018 8dd87e767089bcf24198754f1619bb4840c74511
child 415020 a369989ec6b605c62fe2d7083f5c3dfb21c775bb
push id29774
push usergsquelart@mozilla.com
push dateMon, 19 Sep 2016 07:39:16 +0000
reviewersgijs
bugs1247056
milestone51.0a1
Bug 1247056 - 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: IepHBoTqqju
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);