From 946289c221b2a47b96117de40a1f78e646572c8d Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 8 Apr 2013 19:46:45 +0100 Subject: [PATCH 1/2] temp patch for 1652 --- src/static/js/Changeset.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/static/js/Changeset.js b/src/static/js/Changeset.js index b16042126..6d1845220 100644 --- a/src/static/js/Changeset.js +++ b/src/static/js/Changeset.js @@ -1663,12 +1663,20 @@ exports.appendATextToAssembler = function (atext, assem) { * @param cs {Changeset} * @param pool {AtributePool} */ +var lastEvent = null; // This is just a temporary measure to ensure we don't send the exact same changeset twice +// Documentation for this is available at https://github.com/ether/etherpad-lite/issues/1652 + exports.prepareForWire = function (cs, pool) { + if(cs == lastEvent){ + throw new Error("Not sending the same event twice..."); + return false; + } var newPool = new AttributePool(); var newCs = exports.moveOpsToNewPool(cs, pool, newPool); + lastEvent = cs; return { translated: newCs, - pool: newPool + pool: newPool }; }; From bf93500214acf94fca8d323d685d3228c0b6cab9 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 8 Apr 2013 19:50:52 +0100 Subject: [PATCH 2/2] some polish for a turd --- src/static/js/Changeset.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/static/js/Changeset.js b/src/static/js/Changeset.js index 6d1845220..89ac5d750 100644 --- a/src/static/js/Changeset.js +++ b/src/static/js/Changeset.js @@ -1669,14 +1669,13 @@ var lastEvent = null; // This is just a temporary measure to ensure we don't sen exports.prepareForWire = function (cs, pool) { if(cs == lastEvent){ throw new Error("Not sending the same event twice..."); - return false; } var newPool = new AttributePool(); var newCs = exports.moveOpsToNewPool(cs, pool, newPool); lastEvent = cs; return { translated: newCs, - pool: newPool + pool: newPool }; };