diff --git a/services/web/public/js/libs/sharejs.js b/services/web/public/js/libs/sharejs.js index bed5ebab4f..f6a44e912f 100644 --- a/services/web/public/js/libs/sharejs.js +++ b/services/web/public/js/libs/sharejs.js @@ -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); diff --git a/services/web/public/src/ide/editor/Document.js b/services/web/public/src/ide/editor/Document.js index 671823ae4e..4fb9ee8010 100644 --- a/services/web/public/src/ide/editor/Document.js +++ b/services/web/public/src/ide/editor/Document.js @@ -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') )