what would happen if there are two callObjects created for one user in the same browser and sam tab?


I had a bug, that is when I close the room, callObject for this room is destroyed but beacause of code mistakes, a new callObject is creating again for the same room which I've closed'. and when I create a new room, a new callObject is creating again without being destorying the existing callObject for the previous room.

when all these happens, the participant-A who is having two callObjects cannot see and cannot hear the participant-B. but participant-B can hear and can see participant-A.

also when I log callObject.participants() on participant-A side I can see only local participant details, I cannot see participant-B details. and when I log callObject.participants() on participant-B side I can see both participant-B and participant-A details.

I totally agree that this issue arises because of coding mistakes and having 2 callObjects on the participant-A side.

thought I have fixed the issue, I would really like to know, what is happening exactly in the call. I am excited to know what is happening.

I would be grateful

thanks ❤️ 🙂


  • daily_joey
    daily_joey Moderator, Dailynista admin

    Hi @svm_agilis , as you discovered the Daily API does not support creating multiple call objects in the same context.

    When a call objected is created, some references are created at the window level. If a second call object is created, the original call object's references are overwritten, which results in breaking both call objects and the behavior that you observed.

    This is obviously not ideal! We're in the process of improving this area of the API to make it easier to avoid creating multiple call objects unintentionally, which should help to prevent issues like the one you encountered in the future.

    Please let us know if you have any other questions!

  • svm_agilis

    Thanks @daily_joey 🙂