Odonno / ngrx-signalr-core

A library to handle realtime SignalR (.NET Core) events using @angular, rxjs and the @ngrx library
https://www.npmjs.com/package/ngrx-signalr-core
MIT License
27 stars 13 forks source link

Repeated @ngrx/signalr/error action when restarting hub after error on hub startup #54

Closed donohoea closed 2 years ago

donohoea commented 2 years ago

First off thanks for this awesome library we love it!

We've run into an issue when our access token is expired and we attempt to start a hub.

The attempt to start a connection returns an error and dispatches the @ngrx/signalr/error with a payload that includes: errror: { statusCode: 401 } This is all as expected thus far. But we then take actions to refresh our access token and make it available to through the hub Options and dispatch the @ngrx/signalr/startHub which results in the following actions being dispatch @ngrx/signalr/error which is the exact same as the previous error action dispatched including the 401 code, this is followed by a @ngrx/signalr/connected action.

The hub is connected to successfully but the extra error action is a bug and causes us further problems. Please see related PR for a proposed solution that seems to have fixed it for us.

Odonno commented 2 years ago

Thank you Alan for your contribution.

The v12.0.1 is now available.

donohoea commented 2 years ago

No problem. Thanks for merging it so quickly!