You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I raised this issue over at the Azure SignalR github (Azure/azure-signalr#943) however I suspect this is an issue with the Javascript client itself. It does however render us unable to use the ServerSentEvents transport on Azure SignalR currently.
Describe the bug
To test that our reconnection logic on the expiration of our Azure SignalR JWT worked correctly, I set the AccessTokenLifetime to 1 minute.
Whilst using WebSockets, as expected, there was no disconnection after 1 minute and the connection remained open for the duration of testing.
Whilst using LongPolling, as soon as a 401 error is received from a long poll response, the onclose event is fired allowing us to manage a reconnection.
However, whilst using SSE, the occasional ping or attempt to post a message back to the Azure SignalR server results in a 401 error that does not appear to initiate an onclose or reconnect event. As such, we have no way to know that the communication between the server has now broken, and cannot force it to renegotiate.
This makes SSE functionally unusable with Azure SignalR as our clients will permanently disconnect after the 1 hour JWT timeout.
To Reproduce
As above, using a short JWT expiry and the following javascript connection:
new signalR.HubConnectionBuilder()
.withUrl(connectionUrl,
{
transport: signalR.HttpTransportType.ServerSentEvents,
})
.withAutomaticReconnect() //optional, but neither reconnection nor onclose are occurring
.build();
Exceptions (if any)
The console fills with the following errors, however no attempt to reconnect trigger an 'onclose' or 'onreconnecting' event occurs.
With LongPolling, we receive a single error, followed by a reconnection (onclose without the withAutomaticReconnect())
Further technical details
Your Azure SignalR SDK version: Microsoft.Azure.SignalR@1.5.0
Your SignalR Client SDK version: Javascript - microsoft-signalr@3.1.3
The text was updated successfully, but these errors were encountered:
Jonno12345
changed the title
Server sent events not firing onclose/reconnect event on expiration of JWT
Signalr server sent events not firing onclose/reconnect event on expiration of JWT
Jun 30, 2020
I raised this issue over at the Azure SignalR github (Azure/azure-signalr#943) however I suspect this is an issue with the Javascript client itself. It does however render us unable to use the ServerSentEvents transport on Azure SignalR currently.
Describe the bug
To test that our reconnection logic on the expiration of our Azure SignalR JWT worked correctly, I set the AccessTokenLifetime to 1 minute.
Whilst using WebSockets, as expected, there was no disconnection after 1 minute and the connection remained open for the duration of testing.
Whilst using LongPolling, as soon as a 401 error is received from a long poll response, the onclose event is fired allowing us to manage a reconnection.
However, whilst using SSE, the occasional ping or attempt to post a message back to the Azure SignalR server results in a 401 error that does not appear to initiate an onclose or reconnect event. As such, we have no way to know that the communication between the server has now broken, and cannot force it to renegotiate.
This makes SSE functionally unusable with Azure SignalR as our clients will permanently disconnect after the 1 hour JWT timeout.
To Reproduce
As above, using a short JWT expiry and the following javascript connection:
Exceptions (if any)
The console fills with the following errors, however no attempt to reconnect trigger an 'onclose' or 'onreconnecting' event occurs.
With LongPolling, we receive a single error, followed by a reconnection (onclose without the withAutomaticReconnect())
Further technical details
The text was updated successfully, but these errors were encountered: