Getting old messages after reconnect a room

edited August 2019 in Photon Chat
Hi guys,

I created two separate rooms and sent a private message from "player1" who is in "room1" to "player2" who is in "room2". Player2 received the private message successfully. After that, Player2 leave "room2" and joined "room1". After joining, Player2 received the old message from Player1 again (Player1 didn't send it again). How can I prevent this?

Thanks.

Comments

  • Hi @HisAirness,

    Thank you for choosing Photon!

    What client SDK are you using?
    What version?

    In Photon Chat, there are channels and not rooms.
    You are maybe referring to rooms from Photon Realtime or PUN as you are probably combining both products.

    Anyways, it looks like you are subscribing to the same channel and requesting history.
    A channel can have up to 100 messages in history.
    Empty channels where no one is still subscribed will be destroyed on Photon servers after a timeout.
    So either subscribe to a new channel (new name) or do not request channel history messages from the server when subscribing.
  • Hello @JohnTube ,
    The same problem also happened to us. Old messages was being received upon connection to PhotonChat is established. Player didn't subscribe to the channel yet but the message received was considered as new but it was already received by the Player. It happens randomly tho.
  • JohnTubeJohnTube mod
    edited May 20
    Hi @LoTher05,

    Thank you for choosing Photon!

    What client SDK do you use? which version?
    Did this happen with different Photon Chat AppIDs?
    Did this happen with different Photon Chat AppVersion?
    Did this happen on multiple Photon Cloud regions?
    Do you have more details about how to repro this?
    Does this happen when the client reconnects after unexpected disconnection or in an initial connection?
  • Hello @JohnTube ,

    What client SDK do you use? which version? - We're using the PhotonChatApi in PUN v1.102
    Did this happen with different Photon Chat AppIDs? - we only use 1 Photon Chat AppIDs
    Did this happen with different Photon Chat AppVersion? - it happened before but not every time, it happens occasionally and we don't know yet the reason why.
    Did this happen on multiple Photon Cloud regions? - We only use 1 region which is EU
    Do you have more details about how to repro this? - I can't say any specific but it happens to account that is always connected or online for long hours.
    Does this happen when the client reconnects after unexpected disconnection or in an initial connection? - it happens during initial connection. Tried to open the message channel with the new message > Disconnect > then the message keep arriving.

    After sometime, it will not happen and we still don't know why.
Sign In or Register to comment.