mirror of https://github.com/xwiki-labs/cryptpad
Fix broken browser fight logging
This commit is contained in:
parent
f0eb58ee95
commit
828a685ba8
|
@ -162,24 +162,23 @@ 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));
|
||||
// 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);
|
||||
if (index === -1) {
|
||||
module.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);
|
||||
} else {
|
||||
console.log("Encountered a known browser disagreement: " +
|
||||
"available at `REALTIME_MODULE.fights[%s]`", index);
|
||||
}
|
||||
var fights = window.CryptPad_fights = window.CryptPad_fights || [];
|
||||
var index = fights.indexOf(sop);
|
||||
if (index === -1) {
|
||||
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(fights);
|
||||
} else {
|
||||
console.log("Encountered a known browser disagreement: " +
|
||||
"available at `REALTIME_MODULE.fights[%s]`", index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue