From 6fa79320a56136e09ec0b7deb4fc6f5b17e4011c Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Fri, 4 Aug 2017 20:36:07 +0200 Subject: [PATCH] disable preferUntransformed --- src/Connector.js | 10 +--------- src/Transaction.js | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Connector.js b/src/Connector.js index 162481ae..6f5f5f03 100644 --- a/src/Connector.js +++ b/src/Connector.js @@ -36,7 +36,6 @@ module.exports = function (Y/* :any */) { // this client receives operations from only one other client. // In particular, this does not work with y-webrtc. // It will work with y-websockets-client - this.preferUntransformed = opts.preferUntransformed || false if (opts.role == null || opts.role === 'master') { this.role = 'master' } else if (opts.role === 'slave') { @@ -188,9 +187,6 @@ module.exports = function (Y/* :any */) { protocolVersion: conn.protocolVersion, auth: conn.authInfo } - if (conn.preferUntransformed && Object.keys(stateSet).length === 0) { - answer.preferUntransformed = true - } conn.send(syncUser, answer) }) } else { @@ -304,11 +300,7 @@ module.exports = function (Y/* :any */) { protocolVersion: this.protocolVersion, auth: this.authInfo } - if (message.preferUntransformed === true && Object.keys(m.stateSet).length === 0) { - answer.osUntransformed = yield* this.getOperationsUntransformed() - } else { - answer.os = yield* this.getOperations(m.stateSet) - } + answer.os = yield* this.getOperations(m.stateSet) conn.send(sender, answer) if (this.forwardToSyncingClients) { conn.syncingClients.push(sender) diff --git a/src/Transaction.js b/src/Transaction.js index d21adba9..f4447b3b 100644 --- a/src/Transaction.js +++ b/src/Transaction.js @@ -96,7 +96,7 @@ module.exports = function (Y/* :any */) { send.push(Y.Struct[op.struct].encode(op)) } } - if (this.store.y.connector.isSynced && send.length > 0) { // TODO: && !this.store.forwardAppliedOperations (but then i don't send delete ops) + if (send.length > 0) { // TODO: && !this.store.forwardAppliedOperations (but then i don't send delete ops) // is connected, and this is not going to be send in addOperation this.store.y.connector.broadcastOps(send) } @@ -717,7 +717,7 @@ module.exports = function (Y/* :any */) { } * addOperation (op) { yield* this.os.put(op) - if (this.store.y.connector.isSynced && this.store.forwardAppliedOperations && typeof op.id[1] !== 'string') { + if (this.store.forwardAppliedOperations && typeof op.id[1] !== 'string') { // is connected, and this is not going to be send in addOperation this.store.y.connector.broadcastOps([op]) }