fix(response): allow server methods to not have a response
Server methods should not be required to invoke a client method in response. This change updates response messages to handle empty callData.
Fixes #5
Thanks for the pull requests @jayharris. Looks like the CI Build is failing, could you fix the issue and re-commit?
Thanks!
@tjchaplin Sorry about that. I've updated the PR. Travis is now passing.
@tjchaplin - I'm running into this issue as well. Can this get merged in and a new package deployed? Thanks!
So, I patched the fix into my local copy of SignalRJS, and noticed that when connections are initiated for client -> server calls, while the calls succeeded, they were locked in a "pending" state on the client, which blocked all subsequent calls until the request timed out.
Tracked it down to the parseMessage function in lib/hubs/hubs.js:
parseMessage : function(req,cb){
this._hubDefns.forEach(function(hub){
hub.createClientResponse(req,function(err,clientResponse,to){
if(err || !clientResponse)
return;
cb(clientResponse,to);
});
});
},
That check for !clientResponse doesn't allow the callback to fire (which is responsible for writing the HTTP 200 back to the client.) Removing that check appears to fix this issue. This might be good to include in your patch request @jayharris...as I think the issue will become more prevalent when this patch gets merged.