Skip to content

Working with track SID across full-reconnects #553

@SijmenHuizenga

Description

@SijmenHuizenga

We are having difficulties managing track SIDs in scenarios where a full reconnect occurs. During a reconnect, tracks are re-published with new SID's, which prevents us from call UnpublishTrack on specific tracks after the full-reconnect. Because after a full reconnect, the application’s previously stored SID is no longer valid, giving an errors when attempting to unpublish the track.

Usual Flow (No Reconnect):

  1. Video track is published with SID_A. Our application stores SID_A. ✅
  2. Time passes. ⏰
  3. The application calls UnpublishTrack(SID_A) to stop streaming the video track. ✅

Flow with Full Reconnect:

  1. Video track is published with SID_A. Our application stores SID_A. ✅
  2. Time passes. ⏰
  3. Full reconnect occurs, handled completely by the Go SDK. The video keeps streaming, but a new track SID is assigned. ✅
  4. Time passes. ⏰
  5. The application calls UnpublishTrack(SID_A) to stop streaming the video track but receives an error: "could not find track." ❌

With the amazing help of @boks1971 and 15f576a we are now listening for LocalTrackPublished events to update our SIDs after a full reconnect. In the next few days we will find out if this is stable

Some ideas to improve this process for the future:

  • Document the fact that SID's change across full-reconnects, and document how to use LocalTrackPublished together with .UnpublishTrack(). Maybe even an example?
  • Provide a method similar to UnpublishTrack that takes some kind of unique track reference which is consistent across reconnects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions