join rooms before on connect to avoid race conditions
function _attachRoomsSocketIO() {
        if (!io) return;

        // middleware
        io.use((socket, next) => {
            const {
                node_id: nodeId,
            } = socket.handshake.query;

            if (nodeId) {
                logger.info(`node ${nodeId} joining room on connect`);
                socket.join(nodeId);
            }

            return next();
        });
    }