SocketCluster / socketcluster-client

JavaScript client for SocketCluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In sctransport.js, consider emitting disconnect/connectAbort event after calling _abortAllPendingEventsDueToBadConnection

jondubois opened this issue · comments

Ideally disconnection should happen after events have been cancelled.
Right now this is not the case: https://github.com/SocketCluster/socketcluster-client/blob/master/lib/sctransport.js#L211

First, check that switching the order doesn't cause any negative side effects.

This ordering of events on the transport object is necessary to allow the socket to handle the disconnect cleanup operations at a higher level before they are cleaned up at the lower (transport) lever.