-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Track name is duplicated" error when unpublishing/publishing track during reconnection #1227
Comments
Update: It turns out that the track is actually being unpublished after the reconnection, it's just a race condition with the So, for now, we ended up with such workaround:
|
Is anyone able to respond to this one please? This is regularly impacting a number of calls and is having a real business impact. |
Thank you for reporting this issue and detailed explanation @jsdream. Yes this looks like a race condition that need to be handled by the SDK. I have filed an internal bug to rack this issue (JSDK-3032) @darrenmhill - Does the workaround suggested by @jsdream not work in your case? Thanks, |
Thanks for that @makarandp0! Looking forward to the proper fix within the SDK. |
We have this in place right now, but have not yet explicitly tested it under these conditions. |
Any update on this one please? I think the workaround is working ok, but ideally we'd like a native fix for this. |
This race condition causes some headaches for us, but we've worked around it by appending a random UUID to our track names and updating our track name checking logic to use That does mean that a user can briefly have 2 "camera" tracks at once, but this doesn't end up being a problem in practice. |
Is there an update here? We're running into this error with React Hot Reload during dev — workable but quite annoying. |
or sensitive account information (API keys, credentials, etc.) when reporting this issue.
Expected behavior:
Unpublishing and then publishing local track while the connection is lost should not cause any issues upon reconnection.
Actual behavior:
In our case, if we unpublish an audio track and publish a new one with the same name while there is a reconnection, upon successful reconnection we'll get a "Track name is duplicated" error.
The main problem here seems to be is that we can't reliably know either track was actually unpublished in the Twilio backend or not, as there is no 'trackUnpublished' event for the local participant. These issues I think are related: #657 and #1007.
In our setup, in order to mute participants, we completely unpublish the audio track and then republish it when the participant unmutes. So if a participant mutes/unmutes while their connection is lost they will get a "Track name is duplicated" error after their connection eventually restored.
To summarize, I think the problem is the following: when calling
localParticipant.unpublishTrack
it always removes track locally without taking into account a response from the backend, and then callinglocalParticipant.publishTrack
causes the "Track name is duplicated" error as the previous track was not really unpublished, although local state thinks so.Also, the initial idea how to fix this was to disable the 'mute' button when Twilio room is in 'reconnecting' state, but this doesn't fix the problem completely as Twilio room does not transition to the 'reconnecting' state immediately after the connection is lost, thus leaving the room for the issue to occur.
Software versions:
The text was updated successfully, but these errors were encountered: