Fix broken browser fight logging

pull/1/head
Caleb James DeLisle 7 years ago
parent f0eb58ee95
commit 828a685ba8

@ -162,27 +162,26 @@ define([
/* pushing back over the wire is necessary, but it can
result in a feedback loop, which we call a browser
fight */
if (module.logFights) {
// what changed?
var op = TextPatcher.diff(newContentStrNoMeta, newContent2StrNoMeta);
// log the changes
TextPatcher.log(newContentStrNoMeta, op);
var sop = JSON.stringify(TextPatcher.format(newContentStrNoMeta, op));
var index = module.fights.indexOf(sop);
var fights = window.CryptPad_fights = window.CryptPad_fights || [];
var index = fights.indexOf(sop);
if (index === -1) {
module.fights.push(sop);
fights.push(sop);
console.log("Found a new type of browser disagreement");
console.log("You can inspect the list in your " +
"console at `REALTIME_MODULE.fights`");
console.log(module.fights);
console.log(fights);
} else {
console.log("Encountered a known browser disagreement: " +
"available at `REALTIME_MODULE.fights[%s]`", index);
}
}
}
}
// Notify only when the content has changed, not when someone has joined/left
if (JSONSortify(newContent) !== JSONSortify(oldContent)) {

Loading…
Cancel
Save