Channel & presence: client leave and rejoin a room successfully, but other client in this room can't receive notification

I am recently implementing a chat function and run into a weird problem:

  1. Firstly 2 web clients join a room successfully
  2. client 1 disconnected(by switch to other page) and leave the room – client 2 can receive related presence_diff leaving message successfully
  3. client 1 reconnected(switch back) and join the room successfully – at times(not 100%) client 2 could NOT receive related presence_diff joining message(supposed to receive), thus they can’t receive message sent from each other. But they are indeed in the same room.

Is it related to network condition? It only happened in QA’s staging env. I tested it in my local dev env and it never happened.

I have no idea where to start to debug it at all. Anybody has some hint?

Why do you require the presence state to be consistent to send messages? For a common chat application I’d expect being in the same room to be the determining factor. If the user cannot join back to the room then it would also explain why there’s no presence_diff.

Not receiving presence state change means the user can’t be seen by others. Then i found they also could not send & receive message from each other any more.