GitHub Documentation

Bug on Unity Colyseus after reconnect client

  • After reconnect client, if there is any state changes, the unity client room listener won't pick up any update on room state.
    The reconnected client can send signal to server, but server update on roomstate, or broadcast, or send message to client all failed. The client stop receive any feedback. Anyone can help me?

  • administrator

    Hi @Soh-Sea-Kiat, by reconnection you mean calling ReJoin? Cheers

  • @endel Yup, after Rejoin,

    anything in try block still can pass back to client, but when client send message to the room, or any update on roomstate, client won't listen any changes anymore, seems to me server is not casting data back to reconnected client

    code block

    async onLeave (client, options) {

        console.log( " Leaving...");
        // inactivateclient
        try {
            // allow disconnected client to rejoin into this room until 20 seconds
            await this.allowReconnection(client, 300);
            // client returned! let's re-activate it.
            console.log( + " reconnect back !");
            // push updated roominfo to reconnect client
        } catch (e) {
            // 20 seconds expired. let's remove the client.

    onMessage (client, data) {

                if(data.isInit != undefined){
                    this.state.changePlayerReady(client, data.color, data.isReady);
                    this.broadcast({test: "message"});


  • administrator

    Hi @soh-sea-kiat, I see. It must be something on the client-side. Are you possibly forgetting to create a new coroutine for the ReJoin()?

    Like here:

    room.OnReadyToConnect += (sender, e) => {
        Debug.Log("Ready to connect to room!");
        StartCoroutine (room.Connect ());


  • Hi @endel I already used client.Rejoin() to get reconnect back from client side, and I can successfully reconnect back to server with a new coroutine, just that after the reconnection, I couldn't recieve any update from server side but still can room.send() data to the server.

  • Hi , i up the post because i have the same issue , after a rejoin ( successfully ) i can't send any data between server and client, thanks


© 2021 Lucid Sight, Inc