angular-signalr-hub
angular-signalr-hub copied to clipboard
SignalR errors are swallowed
Hi, I had some hard time with the SignalR hub. I have a IIS hosted ASP.NET app where it worked fine and client was connecting to server hub and then I have a self hosted OWIN app with the same hub (added as linked file) where it did not work. I also share the script files, etc.
After quite a lot of debugging I discovered that the version of SignalR that is used in Microsoft.AspNet.SignalR.Owin
interface is 1.2:
{"Url":"/signalr", "ConnectionToken":"...", "ConnectionId":"...", "ProtocolVersion":"1.2"}
the web Microsoft.AspNet.SignalR.Owin
is using SignalR version 1.4.
{"Url":"/web/signalr", "ConnectionToken":"...", "ConnectionId":"...", "ProtocolVersion":"1.4"}
That's not a big issue, I can downgrade the web app. The problem is that the error was swallowed and not written to console until I added following code to my controller:
$hub.promise.fail(function (reason) {
console.error(reason);
});
I tried to push the code "up" to your signar-hub.js
, but it was never invoked.
Can you add this to your code and/or tell me how to make it work globally in your code.
Thanks, Karel