Merge pull request #2041 from overleaf/bg-enforce-consistency-check

enforce consistency check for editors

GitOrigin-RevId: 2b8abed4519476be52563cbfecb799858f6dad0c
This commit is contained in:
Brian Gough 2019-08-06 08:41:59 +01:00 committed by sharelatex
parent de60c3d25f
commit 8237319683
2 changed files with 2 additions and 7 deletions

View file

@ -1505,6 +1505,7 @@ define(['ace/ace','libs/sha1'], function () {
var otText = doc.getText();
if (editorText !== otText) {
doc.emit('error','Text does not match in ace')
console.error('Text does not match!');
console.error('editor: ' + editorText);
return console.error('ot: ' + otText);
@ -1665,6 +1666,7 @@ define(['ace/ace','libs/sha1'], function () {
var otText = sharedoc.getText();
if (editorText !== otText) {
sharedoc.emit('error','Text does not match in CodeMirror')
console.error('Text does not match!');
console.error('editor: ' + editorText);
return console.error('ot: ' + otText);

View file

@ -97,7 +97,6 @@ define([
this.ace
)
this._checkCMConsistency = _.bind(this._checkConsistency, this, this.cm)
this.inconsistentCount = 0
this._bindToEditorEvents()
this._bindToSocketEvents()
}
@ -161,12 +160,6 @@ define([
const sharejsValue =
this.doc != null ? this.doc.getSnapshot() : undefined
if (editorValue !== sharejsValue) {
this.inconsistentCount++
} else {
this.inconsistentCount = 0
}
if (this.inconsistentCount >= 3) {
return this._onError(
new Error('Editor text does not match server text')
)