socketcluster-client icon indicating copy to clipboard operation
socketcluster-client copied to clipboard

eventObject timeout has a timeout set when it's not expecting a response

Open gak10100 opened this issue 2 years ago • 0 comments

Inside the _processOutboundEvent event Objects are created and a timeout is set. The problem is that a timeout is set for event objects that aren't expecting a response.

https://github.com/SocketCluster/socketcluster-client/blob/f5514434f51369166de9e5dafba2f7da147fb93e/lib/clientsocket.js#L773-L781

Inside the _flushOutboundBuffer function Event Objects are passed off to the transport object

https://github.com/SocketCluster/socketcluster-client/blob/f5514434f51369166de9e5dafba2f7da147fb93e/lib/clientsocket.js#L709-L720

but because the event object doesn't have a callback it doesn't add it to the callbackMap

https://github.com/SocketCluster/socketcluster-client/blob/f5514434f51369166de9e5dafba2f7da147fb93e/lib/transport.js#L373C10-L387

This can lead to the timeout to hang even after the client has disconnected.

gak10100 avatar Oct 23 '23 03:10 gak10100