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

After reconnecting - reconnected, twice events from server #100

Closed pippistro-fedro closed 1 year ago

pippistro-fedro commented 1 year ago

Using samples (realtime-feeds, realtime-feeds.API) testing automatic reconnection. version 15.1.1

  1. start api server
  2. start angular webapp
  3. stop api server you can see webapp trying to reconnect...
  4. restart api server you can see webapp reconnect to server

but every event arriving from server create 2 actions (eg. createFeed)

If you stop and restart again, you can see after reconnect... 3 actions, and so on.

It seems that the library doesn't clean past subscriptions (imho)

pippistro-fedro commented 1 year ago

I think the problem is when a reconnecting state changes to "connected": it trigger again a signalRConnected (normally used to register the events from server). Introducing a new state "reconnected" (like singalr librarye does) and a new relative action, it's possible avoid and differentiate the behavior. You can see my pull request: https://github.com/Odonno/ngrx-signalr-core/pull/101

Odonno commented 1 year ago

This is now released in the v15.1.2

Thank you for your contribution Davide

pippistro-fedro commented 1 year ago

It's a plesure, tnx for your great job. Davide

Il ven 23 giu 2023, 22:57 David Bottiau @.***> ha scritto:

This is now released in the v15.1.2

Thank you for your contribution

— Reply to this email directly, view it on GitHub https://github.com/Odonno/ngrx-signalr-core/issues/100#issuecomment-1604956418, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRZQYYKXAPOX62ETVDQSCTXMX7NNANCNFSM6AAAAAAZJLCBEY . You are receiving this because you authored the thread.Message ID: @.***>