Appwrap: Identifying a Stale Room when building a Chat Client

223 views Asked by At

I am extending this chat client built using AppWarp Client API and App42 Backend.

After appropriate initializations and setting listeners I am successfully able to fetch all available rooms using _warpclient.getAllRooms(); and its listener:

function onGetAllRoomsDone(rooms) {
    console.log(rooms);
    for(var i=0; i<rooms.getRoomIds().length; ++i) {
        _warpclient.getLiveRoomInfo(rooms.getRoomIds()[i]);
    }
}

Problem:

However, rooms.getRoomIds() returns dynamic rooms that are stale (dead / destroyed see: dynamic rooms here). Is there a way to identify these stale rooms?

Attempts:

  • I have extensively searched their API reference but haven't found any information on how to achive this.
  • I also explored the room objects received in the callbacks onGetLiveRoomInfoDone and onGetAllRoomsDone but it doesn't contain anything relevant.
  • Their App42 Management Console doesn't provide a list of these rooms or their properties.
1

There are 1 answers

4
Suyash Mohan On

If a room has been destroyed/dead, it won't appear in getRoomIds(). It might be the room is not dead but empty. Try joining any such room, you will be able to join it. If It was dead, your join room request will fail.

A rare case can be, when you called getAllRooms(), there was someone in room and hence you got it in the result, but the before you can send the join request, it got empty and destroyed.