faye/faye — Issue #127: Empty errors while publishing messages with faye 0.8.0
Author: eugene57
Created: 2012-02-28 17:02:54+00:00
State: open

I've installed the latest version (0.8.0) via npm.
When publishing a message my publication.callback is not called, and publication.errback is called with error = {"code":null,"params":[],"message":""}.
Nevertheless my message is succesfully published (and I receive it).

Here is some code:

function sendMessage(msg) {
if (msg === '') {
return;
}
var publication = client.publish('/mainchat', {text: msg});
publication.callback(function() {
alert('Ok!');
});
publication.errback(function(error) {
alert('There was a problem: ' + JSON.stringify(error));
});
}

function receiveMessage(message) {
alert(message.text);
}

var client = new Faye.Client('/faye');
var subscription = client.subscribe('/mainchat', receiveMessage);
sendMessage('test');