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
--- 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);