Compare commits

...

3 Commits

Author SHA1 Message Date
Kevin Jahns
76ebd3043d Deploy 11.0.3 2016-04-27 12:04:30 +01:00
Kevin Jahns
b958b72f1d Deploy 11.0.2 2016-04-26 21:28:18 +02:00
Kevin Jahns
89a920df68 Deploy 11.0.1 2016-04-26 15:34:16 +02:00
5 changed files with 13 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "yjs", "name": "yjs",
"version": "11.0.0", "version": "11.0.3",
"homepage": "y-js.org", "homepage": "y-js.org",
"authors": [ "authors": [
"Kevin Jahns <kevin.jahns@rwth-aachen.de>" "Kevin Jahns <kevin.jahns@rwth-aachen.de>"

10
y.es6
View File

@@ -54,7 +54,7 @@ module.exports = function (Y/* :any */) {
this.broadcastedHB = false this.broadcastedHB = false
this.syncStep2 = Promise.resolve() this.syncStep2 = Promise.resolve()
this.broadcastOpBuffer = [] this.broadcastOpBuffer = []
this.protocolVersion = 10 this.protocolVersion = 11
} }
reconnect () { reconnect () {
} }
@@ -2709,15 +2709,17 @@ module.exports = function (Y /* : any*/) {
if (op.struct === 'Insert') { if (op.struct === 'Insert') {
for (var i = this.waiting.length - 1; i >= 0; i--) { for (var i = this.waiting.length - 1; i >= 0; i--) {
let w = this.waiting[i] let w = this.waiting[i]
// TODO: do I handle split operations correctly here? Super unlikely, but yeah..
// Also: can this case happen? Can op be inserted in the middle of a larger op that is in $waiting?
if (w.struct === 'Insert') { if (w.struct === 'Insert') {
if (Y.utils.compareIds(op.left, w.id)) { if (Y.utils.matchesId(w, op.left)) {
// include the effect of op in w // include the effect of op in w
w.right = op.id w.right = op.id
// exclude the effect of w in op // exclude the effect of w in op
op.left = w.left op.left = w.left
} else if (Y.utils.compareIds(op.right, w.id)) { } else if (Y.utils.compareIds(w.id, op.right)) {
// similar.. // similar..
w.left = op.id w.left = Y.utils.getLastId(op)
op.right = w.right op.right = w.right
} }
} }

File diff suppressed because one or more lines are too long

8
y.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long