Active Connections issue

How are you Team
I have issue on active connections
As we know, activeConnections is for getting all connections in one session.
I generate adding user info so by gettting all connections, I can get all user list in this session.
but sometimes this activeConnections has duplicate users
In case user refresh browser, then he get new token from backend (Node Openvidu SDK) and participate in session.
But activeConnections have old this user’s connection (maybe this connection would remove after sometimes though user doesn’t connect), and add this new connection but actually user count is 1 but activeConnections are 2
and when publish audio or video of this user, then 2 connections work as same. lol
Is there any good way to resolve this issue? @CSantosM
thanks

For example
image
when click two these buttons, then unpublish old ones and republish as audioSource: false, videoSource: false - this is because via this stream, we should detect further signal
if click these 2 buttons slowly, then no problem but click quickly then shows this error

Sorry @Jin but, to clarify this a little bit. Are you develop your own app or it’s a bug with some openvidu tutorial?

I develop my own app by using Node openvidu SDK and openvidu-browser.
on frontend, using openvidu-browser
and when admin sends signal to user, then user publish their audio and video after unpublishing original their stream.
but at this point, user can receive 2 or more signals so can publish several times
on console, kurrento media server endpoints negotiated error shows.
should I prevent by programmatically?

You must to handle this in your app. OpenVidu will send as many signal as your app order.

I one user refresh the browser, then the connection with OpenVidu is closed abruptly and OpenVidu server takes some time to detect the user is disconnected. If you want to avoid such situation, you can maintain in your app some sort of “participant ID” so when 2 participants have the same ID, just consider the last one as “active” or something like that

Thanks micael
Yes, I did like your idea at the moment.
But how to handle in case 2 user use same participant ID or same account?
If openvidu detects and remove same device duplication, it will be great :slight_smile:

1 Like

Good idea.

We will evaluate it!

1 Like