Fix broken browser fight logging
This commit is contained in:
@@ -162,24 +162,23 @@ define([
|
|||||||
/* pushing back over the wire is necessary, but it can
|
/* pushing back over the wire is necessary, but it can
|
||||||
result in a feedback loop, which we call a browser
|
result in a feedback loop, which we call a browser
|
||||||
fight */
|
fight */
|
||||||
if (module.logFights) {
|
// what changed?
|
||||||
// what changed?
|
var op = TextPatcher.diff(newContentStrNoMeta, newContent2StrNoMeta);
|
||||||
var op = TextPatcher.diff(newContentStrNoMeta, newContent2StrNoMeta);
|
// log the changes
|
||||||
// log the changes
|
TextPatcher.log(newContentStrNoMeta, op);
|
||||||
TextPatcher.log(newContentStrNoMeta, op);
|
var sop = JSON.stringify(TextPatcher.format(newContentStrNoMeta, op));
|
||||||
var sop = JSON.stringify(TextPatcher.format(newContentStrNoMeta, op));
|
|
||||||
|
|
||||||
var index = module.fights.indexOf(sop);
|
var fights = window.CryptPad_fights = window.CryptPad_fights || [];
|
||||||
if (index === -1) {
|
var index = fights.indexOf(sop);
|
||||||
module.fights.push(sop);
|
if (index === -1) {
|
||||||
console.log("Found a new type of browser disagreement");
|
fights.push(sop);
|
||||||
console.log("You can inspect the list in your " +
|
console.log("Found a new type of browser disagreement");
|
||||||
"console at `REALTIME_MODULE.fights`");
|
console.log("You can inspect the list in your " +
|
||||||
console.log(module.fights);
|
"console at `REALTIME_MODULE.fights`");
|
||||||
} else {
|
console.log(fights);
|
||||||
console.log("Encountered a known browser disagreement: " +
|
} else {
|
||||||
"available at `REALTIME_MODULE.fights[%s]`", index);
|
console.log("Encountered a known browser disagreement: " +
|
||||||
}
|
"available at `REALTIME_MODULE.fights[%s]`", index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user