Comparing version 0.4.2 to 0.4.3
@@ -63,2 +63,6 @@ var Link = require('./Link') | ||
this.attachLink(link) | ||
link.on('error'), function() { | ||
link.send('requestInit') | ||
}.bind(this)) | ||
@@ -76,2 +80,10 @@ link.on('close', function() { | ||
this.attachLink(link) | ||
link.on('error'), function() { | ||
this.history.latest(function(er, latest) { | ||
if(er) return link.emit('error', er) // XXX: send this error to the document | ||
var content = (this.ottype.serialize)? this.ottype.serialize(this.content) : this.content | ||
link.send('init', {content: content, initialEdit: latest.pack()}) | ||
}.bind(this)) | ||
}.bind(this)) | ||
@@ -186,3 +198,3 @@ link.on('close', function onclose() { | ||
if(fromLink) fromLink.send('ack', edit.id) | ||
return | ||
return cb() | ||
} | ||
@@ -197,3 +209,6 @@ | ||
this.sanitizeEdit(edit, fromLink, function(er, edit) { | ||
if(er) return fromLink.emit('error', er) | ||
if(er) { | ||
fromLink.emit('error', er) | ||
return cb() | ||
} | ||
@@ -204,3 +219,3 @@ try { | ||
fromLink.emit('error', er) | ||
return | ||
return cb() | ||
} | ||
@@ -207,0 +222,0 @@ |
@@ -17,4 +17,2 @@ var Duplex = require('stream').Duplex | ||
console.warn('Error in link', 'undefined'!=typeof window? er : er.stack || er) | ||
this.end() | ||
// i dunno what to do here... | ||
}.bind(this)) | ||
@@ -21,0 +19,0 @@ |
{ | ||
"name": "gulf", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Sync anything!", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
33113
716