ACS Calling SDK doesn't provide call state "disconnected" when browser/tab is closed during call

Mihal, Klaudia 20 Reputation points
2023-07-27T08:47:02.84+00:00

Hello,

We use the calling SDK for calls between two users and found an issue.

We subscribe to the call state and wait on any change. During testing we noticed that if two participants are together in a call, one participant closes the tab or whole browser where the call is happening, the other participant starts to see a frozen picture of the participant who left (basically the last picture from camera before stopping) or sees a black screen and stays in the call as if noting happened on the other side of call. This is caused by the fact that the call state is not changed correctly to "disconnected" (came to it during debugging).

We noticed this behavior with Chrome (version 114.0.5735.133 (Official Build) (64-bit))

Did you by any chance already encounter this issue? Could you please try to reproduce it? Could happen that it will work a few times but It is not stable, basically in some cases the state is changed as soon as the tab/browser is closed and in other cases it is not changed at all.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
627 questions
0 comments No comments
{count} votes

Accepted answer
  1. ajkuma 20,706 Reputation points Microsoft Employee
    2023-07-28T17:59:00.2833333+00:00

    @Mihal, Klaudia , Thanks for posting this question.

    This is known limitation documented. It is by design as browsers, when refreshed or closed, they do not reliably allow information to be sent to a service (because the connection is being terminated). While there might be some instances where a request is successfully sent, there is no guarantee of it working consistently.

    Kindly checkout this doc section "Refreshing a page doesn't immediately remove the user from their call"

    If a user is in a call and decides to refresh the page, the Communication Services media service won't remove this user immediately from the call. It will wait for the user to rejoin. The user will be removed from the call after the media service times out. It's best to build user experiences that don't require end users to refresh the page of your application while in a call. If a user refreshes the page, reuse the same Communication Services user ID after that user returns back to the application. By rejoining with the same user ID, the user is represented as the same, existing object in the remoteParticipants collection. From the perspective of other participants in the call, the user remains in the call during the time it takes to refresh the page, up to a minute or two. If the user was sending video before refreshing, the videoStreams collection will keep the previous stream information until the service times out and removes it. In this scenario, the application might decide to observe any new streams added to the collection, and render one with the highest id.


    If the answer helped (pointed, you in the right direction) > please click Accept Answer Or please share the requested/more info to help you better.


0 additional answers

Sort by: Most helpful