I'm having a problem receiving chat messages in Unity?

I am trying to build a chat in Unity and I have a problem setting the UI text with the message received. I have the following code

public async void Login()
    {       login...
var messageList = new List<IApiChannelMessage>(100);
      _socket.ReceivedChannelMessage += message =>
      {   
          Debug.Log("received a new message " + message.Content);
          ShowMessage(message.Content, false);
          Debug.LogFormat("Received message: '{0}'", message);
      };

If player A sends a message, I get only the second debug on player B, the first debug and ShowMessage doesn’t work. If player B sends a message, on player B all works fine. Can you help me understand this ? Thankyou.

Hey @Developer can you share how you’re sending the channel message and connecting the socket?

I can’t think of a reason why the second log would appear but not the first.

Also, are you sure you’re not getting any exceptions?

I think I managed to get it working; On the build it’s working fine, in the Editor it doesn’t want to call the functions to change the UI. I am not getting any exceptions.

That’s odd. @Developer are you disconnecting the socket using CloseAsync when you finish running in the editor?

Yes, OnApplicationQuit I call CloseAsync. I will mark the problem solved because it’s working on build so there is no problem for me if it’s not working in editor. Thankyou.