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
26 stars 13 forks source link

startSignalRHub(hub) produces @ngrx/signalr/error + double @ngrx/signalr/disconnected #26

Open GeorgBreithaupt opened 3 years ago

GeorgBreithaupt commented 3 years ago

Hi!

Thanks for that great work.

I have a problem with action startSignalRHub(hub).

When I call startSignalR(hub), it dispatch 3 actions:

@ngrx/signalr/error @ngrx/signalr/disconnected @ngrx/signalr/disconnected

Any idea?

Thanks!

Odonno commented 1 year ago

Hi @GeorgBreithaupt

I am not aware of this issue. In order to fix this issue, is it possible for you to provide a reproduction repository?

GeorgBreithaupt commented 1 year ago

Sorry, it was described wrong: it's not startSignalRHub but stopSignalRHub. Then always comes

Thank you!

image
vulzee commented 1 year ago

I ran into same issue. On connection close there is an error populated this._connection.onclose((error) => { this._errorSubject.next(error); this._stateSubject.next(disconnected); }); and the error subscription const errorSubscription = this._errorSubject.subscribe(() => { observer.error(new Error('The connection has been closed.')); }); in 'on' function throws an error before the observer.complete(); on line 108.

Maybe it's about the order of this events?

Skynet5d commented 1 year ago

Hi @Odonno,

First, thank you for the job you have been doing for this lib.

We just encountered the same issue today, when calling stopSignalRHub, it raises the error "The connection has been close".

Is it an issue that will be addressed soon?

Many thanks