Twilio-video.js: [Question/Issue] Participant disconnected due to duplicate identity?

Created on 7 Aug 2020  路  5Comments  路  Source: twilio/twilio-video.js

@manjeshbhargav @philnash

I want some detail insight related to this issue.

Q) Can we receive this error at our end, because we always reported by Twilio Support for this issue from Twilio Server logs?

We have simple implementation exactly like quick-start app when user comes to application and initiate conversation, and API call made to our server, generate token with the identity we provide while generating token token.identity = {unique-id}, and in response the API provide the token & identity to front-end app.

Now question arises in which case we are having participant duplicate identity issue?

We have very rare case that user refreshes or left and rejoin after few seconds (joining to same group , with same identity). I believe this is how it should be!

The only catch here is on refresh the API call made again to generate token so here we will be having new token against the same identity,

Q) Would that be the reason behind it?

Q) What is the impact of this issue on going conversation?

Most helpful comment

@philnash

..., but the user experience is unaffected.... 馃憤

Thanks you answered my question and thanks providing clarity on QuickStart application I will check for that.

Finally, I'm not in the position to comment on why that is not part of the SDK itself.

You answered that too, in second para 'However, the Twilio Video service does take a little while to register the disconnect before it removes the participant from the room.' 馃憤

And you guys are recording that event as an error because in case user with the same identity joins with other browser/device. All clear for me now.

All 5 comments

Hi @kumail-raza, are you saying that you are getting a 53205 error?

One thing you can do to avoid this is to ensure that when your user refreshes or navigates away from the page that you disconnect them from the room. You can see how to do this in the Twilio Video React application here. The key is to listen to both the beforeunload and pagehide events and disconnect the user from the room.

Let me know if that helps at all.

@philnash

Ok! I will use that, second can you elaborate on this more?

For e.g: User A (identity: user-a-room1) joins to a room, on refresh User A tries to connect again definitely identity this time will also be same (identity: user-a-room1).

Q) So whats the wrong here?
Q) And what will happen to User A on joining again?

Suggestion if it is to disconnect always on beforeunload and pagehide, why not have it in the Twilio JS SDK!

@kumail-raza I'm not sure about your question there. If a user refreshes refreshes the page and they rejoin the room then I would assume they have the same identity. However that is very much down to your application and how it creates access tokens and provides them to users. In the Video Quickstart application we actually use random identities, so when you refresh and rejoin a room you will have a different identity and not see this issue.

When your user refreshes the page and you don't disconnect from the room yourself they will get disconnected automatically, eventually. However, the Twilio Video service does take a little while to register the disconnect before it removes the participant from the room.

So, when you refresh and rejoin the room quickly, the existing user with that identity remains in the room and then gets kicked out as you join with the same identity again. Then you get the 53205 error, but the user experience is unaffected (well, other users in the room may see a black video screen from the user while the page is refreshing and they are rejoining).

Finally, I'm not in the position to comment on why that is not part of the SDK itself.

@philnash

..., but the user experience is unaffected.... 馃憤

Thanks you answered my question and thanks providing clarity on QuickStart application I will check for that.

Finally, I'm not in the position to comment on why that is not part of the SDK itself.

You answered that too, in second para 'However, the Twilio Video service does take a little while to register the disconnect before it removes the participant from the room.' 馃憤

And you guys are recording that event as an error because in case user with the same identity joins with other browser/device. All clear for me now.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings