Comparing version 0.4.8 to 0.4.9
@@ -58,3 +58,3 @@ /** | ||
if(er) return cb(er) | ||
document.content = ottype.deserialize? ottype.deserialize(snapshot.contents) : snapshot.contents | ||
doc.content = ottype.deserialize? ottype.deserialize(snapshot.contents) : snapshot.contents | ||
cb(null, doc) | ||
@@ -145,6 +145,3 @@ }) | ||
link.on('link:edit', function onedit(edit) { | ||
this.queue.push(function(cb) { | ||
this.receiveEdit(edit, link, cb) | ||
}.bind(this)) | ||
this.queue.start() | ||
this.receiveEdit(edit, link) | ||
}.bind(this)) | ||
@@ -198,3 +195,3 @@ | ||
*/ | ||
Document.prototype.receiveEdit = function(edit, fromLink, cb) { | ||
Document.prototype.receiveEdit = function(edit, fromLink, callback) { | ||
console.log('receiveEdit', edit) | ||
@@ -204,7 +201,19 @@ edit = Edit.unpack(edit, this.ottype) | ||
// Edit comes from master, or even better: we are master, yea baby! | ||
this.dispatchEdit(edit, fromLink, cb) | ||
this.queue.push(function(cb) { | ||
this.dispatchEdit(edit, fromLink, function() { | ||
cb() | ||
callback && callback() | ||
}) | ||
}.bind(this)) | ||
this.queue.start() | ||
}else { | ||
// check with master first | ||
this.master.sendEdit(edit, function onack(err, edit) { | ||
this.dispatchEdit(edit, fromLink, cb) | ||
this.queue.push(function(cb) { | ||
this.dispatchEdit(edit, fromLink, function() { | ||
cb() | ||
callback && callback() | ||
}) | ||
}.bind(this)) | ||
this.queue.start() | ||
}.bind(this)) | ||
@@ -211,0 +220,0 @@ } |
{ | ||
"name": "gulf", | ||
"version": "0.4.8", | ||
"version": "0.4.9", | ||
"description": "transport-agnostic operational transformation control layer", | ||
@@ -10,4 +10,4 @@ "repository": { | ||
"dependencies": { | ||
"setimmediate": "1.x" | ||
, "queue": "3.x" | ||
"setimmediate": "1.x", | ||
"queue": "3.x" | ||
}, | ||
@@ -29,9 +29,14 @@ "keywords": [ | ||
"devDependencies": { | ||
"mocha": "*" | ||
, "expect.js": "*" | ||
, "ottypes": "*" | ||
"mocha": "*", | ||
"expect.js": "*", | ||
"ottypes": "*" | ||
}, | ||
"author": "Marcel Klehr <mklehr@gmx.net>", | ||
"license": [{"type": "GPL", "url": "http://opensource.org/licenses/GPL-3.0"}], | ||
"license": [ | ||
{ | ||
"type": "GPL", | ||
"url": "http://opensource.org/licenses/GPL-3.0" | ||
} | ||
], | ||
"readmeFilename": "README.md" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72258
905