Reputation: 1034
Randomly, It happens that I'm not getting notifications via signalr and in Chrome console I can see:
EventSource failed loading: GET "https://my.website.net/signalr/connect?transport=serverSentEvents&clientProtocol=1.5&connectionToken=xxxxxxxxxxxxxxxxxxxxxxxxxx&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=3".
Any way to retry the connection or to understand where is the issue ?
I'm using ASP.NET SignalR JavaScript Library v2.2.2
Upvotes: 1
Views: 1835
Reputation: 1495
Chrome did a recent update that seems to have broken SignalR completely (typically, just as a client said "let's make the messaging system better!")
I have made a couple of changes which seems to have fixed the issue:
Update SignalR NuGet package to latest version (2.4.2)
Ensure the client-side script is the latest version if you are not using NuGet for client-side
Stick an auto-reconnect in if you don't have one:
$.connection.hub.disconnected(function()
{
setTimeout(function()
{
$.connection.hub.start();
}, 1000);
});
Couple of related items:
https://www.reddit.com/r/dotnet/comments/mfkvj4/chrome_disconnects_signalr_hub/ https://github.com/SignalR/SignalR/issues/4536
Upvotes: 0