You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ENG-7948: Fix hanging frontend and other reconnection woes (#5884)
* ENG-7948: Fix hanging frontend and other reconnection woes
* Disable socketio automatic reconnection logic -- replace with manual
reconnect logic
* Try to keep the socketio socket allocated, even when it gets disconnected
for better resource management.
* Introduce new `socket.current.reconnect()` helper
* Update query param token when reconnecting
* Only allow one concurrent connection attempt
* ensureSocketConnected only reconnects if the event loop is mounted -- this
avoids issues during hot reload where some Event-emitting components may
still have a reference to the _old_ `addEvents` and `ensureSocketConnected`
was reconnecting the old socket.
* Use `.off` and null the `socket` ref when cleaning up to free memory and
avoid unwanted reconnections when the socket will be recreated.
Also addresses the following ticket:
ENG-7762: [reconnect] client is given new_token when wifi disconnects and reconnects
This issue was the result of automatic reconnect logic and manual reconnect
logic conflicting with each other and opening two sockets with the same token,
which reflex reassigns the latter to a new token, and this is typically the
socket that gets used in the app.
* useRef for `mounted` to play nice in the react world
0 commit comments