Make sure to set a proper session id using the `session_request` socketIO event

Hello there, we have a RASA X server on AWS, and we are sending/receiving messages over socket channel.

From the docs

By default, the SocketIO channel uses the socket id as sender_id , which causes the session to restart at every page reload. session_persistence can be set to true to avoid that. In that case, the frontend is responsible for generating a session id and sending it to the Rasa Core server by emitting the event session_request with {session_id: [session_id]} immediately after the connect event

and we are initializing a connection from useEffect and omitting userId as session_id

  // connect to server
  useEffect(() => {
    socket.on('connect', () => {
      console.log('SOCKET: connected to the socket server', socket.connected, socket.id)
      socket.emit('session_request', { session_id: userId })
    })
    socket.on('error', (err) => {
      console.log('SOCKET: errors', err)
    })
    socket.on('connect_error', (error) => {
      console.log('SOCKET: connect_error ---->', error)
    })
  }, [])

But when we connect to the server we see

UserWarning: A message without a valid session_id was received. This message will be ignored. Make sure to set a proper session-id using the session_request socketIO event.

What is a proper session id which RASA expects us to send?

Solution to this problem was, the user_id which we have is something like this

9b91ffa3-35d2-44b7-9782-92ae9f17de2e

and RASA want’s us to send him this

9b91ffa335d244b7978292ae9f17de2e,

hope this can help someone.