Comparing version 0.4.7 to 0.4.8
@@ -111,3 +111,3 @@ /** | ||
var content = (this.ottype.serialize)? this.ottype.serialize(this.content) : this.content | ||
link.send('init', {contents: latest.contents, edit: latest.edit.pack()}) | ||
link.send('init', {contents: content, edit: latest.edit.pack()}) | ||
}.bind(this)) | ||
@@ -133,3 +133,4 @@ }.bind(this)) | ||
if(er) return link.emit('error', er) // XXX: send this error to the document | ||
link.send('init', {contents: latest.contents, edit: latest.edit.pack()}) | ||
var content = (this.ottype.serialize)? this.ottype.serialize(this.content) : this.content | ||
link.send('init', {contents: content, edit: latest.edit.pack()}) | ||
}.bind(this)) | ||
@@ -248,3 +249,4 @@ }.bind(this)) | ||
// add to history | ||
this.history.storeSnapshot({id: edit.id, contents: this.content, edit: edit}, function(er) { | ||
var content = this.ottype.serialize? this.ottype.serialize(this.content) : this.content | ||
this.history.storeSnapshot({id: edit.id, contents: content, edit: edit}, function(er) { | ||
if(er) { | ||
@@ -282,2 +284,9 @@ fromLink.emit('editError', er) // XXX: send this erro to the document | ||
if(missed.length > 10) { | ||
// this one apparently missed a lot of edits, looks like this is a reconnect | ||
missed.forEach(function(oldSnapshot) { | ||
fromLink.send('edit', oldSnapshot.edit.pack()) | ||
}) | ||
} | ||
cb(null, edit) | ||
@@ -284,0 +293,0 @@ }.bind(this)) |
@@ -86,5 +86,4 @@ /** | ||
Link.prototype._read = function() { | ||
if(this.sentEdit) return | ||
if(!this.queue[0]) return | ||
if(this.sentEdit) return | ||
this.sentEdit = this.queue.shift() | ||
@@ -91,0 +90,0 @@ this.send('edit', this.sentEdit.pack()) |
{ | ||
"name": "gulf", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"description": "transport-agnostic operational transformation control layer", | ||
@@ -5,0 +5,0 @@ "repository": { |
72044
896