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

Do you know what happens if a request to connect to signalR takes longer than 10 seconds? #83

Closed labeled closed 1 year ago

labeled commented 1 year ago

We're using your default reconnect policy and noticing sometimes that when a request to connect hangs for longer than 10 seconds it seems to get stuck in a forever loop trying to reconnect even though state shows the status as connected. It might be that timer() queues up the next event before the first one has finished.

Odonno commented 1 year ago

https://github.com/Odonno/ngrx-signalr-core/blob/5cd4014453538d1ae9e74a231d1e291c1add4544/src/projects/ngrx-signalr-core/src/lib/effects.ts#L210

As per this line, the reconnect should abort when the hub finally connects. So if it does not, the reconnect effect is indeed stuck in a loop.

I don't see why it would still try to reconnect when the hub is connected. Is it possible for you to provide a reproduction repository?

Odonno commented 1 year ago

Per https://github.com/Odonno/ngrx-signalr-core/issues/37 issue and since v14.1.0, you can now use automatic reconnect provided by the @microsoft/signalr library. Check the readme file to see how it works.

labeled commented 1 year ago

Per #37 issue and since v14.1.0, you can now use automatic reconnect provided by the @microsoft/signalr library. Check the readme file to see how it works.

Thank you for this! We will more than likely start using that!