You should not close the old connection until you receive a Welcome message on the new connection.
The old connection receives events up until you connect to the new URL and receive the welcome message.
Don't close old connection till new is done. Need to figure out a way to auto reconnect and just let the client know when reconnect is happening
https://dev.twitch.tv/docs/eventsub/handling-websocket-events/#reconnect-message
Note
Don't close old connection till new is done. Need to figure out a way to auto reconnect and just let the client know when reconnect is happening