check out the migration guide here: https://github.com/balderdashy/sails/blob/master/0.11-migration-guide.md#onconnect-lifecycle-callback
onConnect callback
TL; DR;
Remove the onConnect function with config/sockets.js .
The onConnect lifecycle onConnect deprecated. Instead, if you need to do something when a new socket is connected, send a request from a recently connected client to do this. The goal of onConnect has always been to optimize performance (eliminating the need to make this initial extra round with the server), but using it can lead to confusion and race conditions. If you desperately need to eliminate the server callback, you can bind the handler directly to sails.io.on('connect', function (newlyConnectedSocket){}) in your bootstrap ( config/bootstrap.js ). However, please note that this is not recommended. If you do not encounter true performance issues, you should use the strategy mentioned above for your connectivity logic (that is, send an initial request from the client after the socket is connected). Socket requests are lightweight, so it doesn't add any tangible overhead to your application, and it helps make your code more predictable.
source share