Add a comment explaining the && webSocketData[id] it wasn't immediately clear to me.

// Dont trigger function if offline or if a hard disconnect was already triggered for this instance