cmu-sei / Gameboard

2 stars 3 forks source link

SignalR multiple reconnect / console chatter #189

Open sei-bstein opened 1 year ago

sei-bstein commented 1 year ago

The current version of Gameboard (and a few versions) prior exhibit some undesirable console chatter from the SignalR web socket due to mismanagement of the connection resulting from expanding its responsibilities for sync start. Issues occur under certain session reset conditions and between some view navigations.

Repro steps for console errors on session reset from a previous browser:

  1. I join a game
  2. I close the browser
  3. I return to GB after that session has expired -- (because the session has expired, GB will not join the websocket sessions I think)
  4. Resetting the session attempts to leave those websocket sessions which likely don't exist, so errors are thrown

https://github.com/cmu-sei/Gameboard/assets/115497763/0a1c4c6b-108b-4a74-9ed3-cea406f40dcb https://github.com/cmu-sei/Gameboard/assets/115497763/b9969d00-bde5-46bb-b49e-d9c4c325fc58

sei-bstein commented 1 year ago

A lot of how we manage the SignalR connection changed substantially with the introduction of synchronized start games, and additional changes will likely come as we go forward with potential new features like the Announcements log and a view that summarizes the user's current registrations / active sessions. My proposal here is to refactor the SignalR implementation such that there is a core service that manages everything about the hub connection, including channel membership. This service would then federate events to appropriate services that are focused on a single channel on the connection (e.g. team-level, game-level, individual-level, support announcements, etc.)

sei-bstein commented 1 year ago

We've merged the branch that has these signalR improvements into gameboard's release line, and we need to prioritize this issue for PC5 to improve stability. The signalR hub is currently making more connections than it needs to, which causes some of the extra chatter and distracting display bugs.

To resolve:

sei-bstein commented 1 year ago

Partially addressed here. Brings GameHub up to the app component level and makes SignalRService a non-singleton, but need to update NotificationService (TeamHub, possibly?) to the new architecture.

sei-jbooz commented 2 months ago

I believe this is addressed, but will wait for @sei-bstein to confirm and close.