Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Fixed bug where callback arguments were not passed to frontend
Browse files Browse the repository at this point in the history
When a backend event was sending a callback receipt, it was sending along
the original event arguments as parameters rather than the arguments that were
actually passed to the callback.
  • Loading branch information
epixa committed Nov 1, 2012
1 parent 3d7e2a4 commit 42f304b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/chuckt.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ ChuckT.prototype.process = function(message){
}
}
if (typeof chuckt.callbackid !== 'undefined') {
var conn = this.conn;
var msg = this.serialize({ callbackid: chuckt.callbackid, args: args.slice(1) });
var conn = this.conn, serialize = this.serialize;
args.push(function(){
return conn.write(msg);
return conn.write(serialize({
callbackid: chuckt.callbackid,
args: Array.prototype.slice.call(arguments)
}));
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "chuckt",
"author" : "Court Ewing",
"version" : "0.1.1",
"version" : "0.1.2",
"description" : "ChuckT is an event transport system built on the SockJS websocket API. This module is the server-side implementation of ChuckT and is designed to complement the client-side ChuckT JavaScript library.",
"keywords" : ["websockets", "websocket", "sockjs", "sockjs-node", "events", "event"],
"homepage" : "https://github.com/epixa/chuckt-node",
Expand Down

0 comments on commit 42f304b

Please sign in to comment.