{"version":3,"file":"DataChannelManager.mjs","sources":["../../../../src/room/data-channel/DataChannelManager.ts"],"sourcesContent":["import { NegotiatedDataChannelID } from '@livekit/protocol';\nimport type { PCTransportManager } from '../PCTransportManager';\nimport { FlowControlledDataChannel } from './FlowControlledDataChannel';\nimport { LossyDataChannel } from './LossyDataChannel';\nimport { ReliableDataChannel } from './ReliableDataChannel';\nimport { DataChannelKind, dataChannelHighWaterMark, dataChannelLowWaterMark } from './types';\n\nconst lossyDataChannelLabel = '_lossy';\nconst reliableDataChannelLabel = '_reliable';\nconst dataTrackDataChannelLabel = '_data_track';\n\nexport interface DataChannelManagerOptions {\n  /** Whether the owning engine has been closed — a closed engine rejects headroom waiters. */\n  isEngineClosed: () => boolean;\n  /**\n   * Whether a reconnect attempt is underway: reliable sends defer to the resume replay and lossy\n   * sends are skipped while this is true.\n   */\n  isReconnecting: () => boolean;\n  onDataMessage: (message: MessageEvent) => void;\n  onDataTrackMessage: (message: MessageEvent) => void;\n  onDataError: (event: Event) => void;\n  onChannelClose: (kind: DataChannelKind) => void;\n  /** A channel's buffer crossed its low-water mark (debounced). Drives DCBufferStatusChanged. */\n  onBufferStatusChanged: (kind: DataChannelKind, isLow: boolean) => void;\n}\n\n/** Unhooks every handler the manager may have wired onto `dc`, ahead of closing it. */\nfunction clearHandlers(dc: RTCDataChannel) {\n  dc.onbufferedamountlow = null;\n  dc.onclose = null;\n  dc.onclosing = null;\n  dc.onerror = null;\n  dc.onmessage = null;\n  dc.onopen = null;\n}\n\n/**\n * Owns the engine's data channels: the three flow-controlled publisher channel wrappers (which\n * live for the engine's lifetime and have RTCDataChannel handles attached/detached as peer\n * connections come and go) plus the subscriber-side receive handles adopted by label.\n *\n * Handle turnover goes through {@link FlowControlledDataChannel.attach}/`detach`, which close the\n * released handle and reject parked headroom waiters as a built-in — there is no separate\n * invalidation step to forget.\n */\nexport class DataChannelManager {\n  readonly reliable: ReliableDataChannel;\n\n  readonly lossy: LossyDataChannel;\n\n  readonly dataTrack: LossyDataChannel;\n\n  private reliableSub?: RTCDataChannel;\n\n  private lossySub?: RTCDataChannel;\n\n  private dataTrackSub?: RTCDataChannel;\n\n  private opts: DataChannelManagerOptions;\n\n  private negotiated = false;\n\n  constructor(opts: DataChannelManagerOptions) {\n    this.opts = opts;\n    const flowControlOptions = (kind: DataChannelKind) => ({\n      kind,\n      lowWaterMark: dataChannelLowWaterMark(kind),\n      highWaterMark: dataChannelHighWaterMark(kind),\n      isEngineClosed: opts.isEngineClosed,\n      onBufferStatusChanged: (isLow: boolean) => opts.onBufferStatusChanged(kind, isLow),\n    });\n    this.reliable = new ReliableDataChannel({\n      ...flowControlOptions(DataChannelKind.RELIABLE),\n      isDeferringSends: opts.isReconnecting,\n    });\n    this.lossy = new LossyDataChannel({\n      ...flowControlOptions(DataChannelKind.LOSSY),\n      // Classic lossy user data: a stale packet is worthless, so drop instead of queueing.\n      bufferFullBehavior: 'drop',\n      shouldSkipSends: opts.isReconnecting,\n    });\n    this.dataTrack = new LossyDataChannel({\n      ...flowControlOptions(DataChannelKind.DATA_TRACK_LOSSY),\n      // Data tracks backpressure the producer instead — it decides what to skip at frame\n      // granularity rather than the engine dropping arbitrary chunks out of frames.\n      bufferFullBehavior: 'wait',\n      shouldSkipSends: opts.isReconnecting,\n    });\n  }\n\n  /** The flow-control wrapper for `kind`. */\n  channelFor(kind: DataChannelKind): FlowControlledDataChannel {\n    switch (kind) {\n      case DataChannelKind.RELIABLE:\n        return this.reliable;\n      case DataChannelKind.LOSSY:\n        return this.lossy;\n      case DataChannelKind.DATA_TRACK_LOSSY:\n        return this.dataTrack;\n    }\n  }\n\n  /** The raw RTCDataChannel handle for `kind`, publisher side by default. */\n  getHandle(kind: DataChannelKind, subscriber: boolean = false): RTCDataChannel | undefined {\n    if (!subscriber) {\n      return this.channelFor(kind).channelHandle;\n    }\n    switch (kind) {\n      case DataChannelKind.RELIABLE:\n        return this.reliableSub;\n      case DataChannelKind.LOSSY:\n        return this.lossySub;\n      case DataChannelKind.DATA_TRACK_LOSSY:\n        return this.dataTrackSub;\n    }\n  }\n\n  get hasPublisherChannels(): boolean {\n    return Boolean(\n      this.reliable.channelHandle || this.lossy.channelHandle || this.dataTrack.channelHandle,\n    );\n  }\n\n  /** Whether the current publisher channels were created as negotiated (fixed IDs). */\n  get publisherChannelsNegotiated(): boolean {\n    return this.hasPublisherChannels && this.negotiated;\n  }\n\n  /**\n   * Creates the three publisher data channels on the given transport, wires their handlers, and\n   * attaches them to the wrappers — attaching closes any replaced channel objects and rejects the\n   * waiters still parked on them.\n   *\n   * With `negotiated`, the channels use fixed SCTP stream IDs agreed with the server instead of\n   * the in-band DCEP open handshake, so the server can send on them right away.\n   */\n  createPublisherChannels(pcManager: PCTransportManager, negotiated: boolean = false) {\n    // Recreating (the Safari null-id path, or the in-band fallback after join): attaching the new\n    // handles below closes the old ones, so unhook them first — the old channel's close must not\n    // report an unexpected close.\n    for (const channel of [this.lossy, this.reliable, this.dataTrack]) {\n      const old = channel.channelHandle;\n      if (old) {\n        clearHandlers(old);\n      }\n    }\n\n    const wire = (\n      channel: FlowControlledDataChannel,\n      dc: RTCDataChannel,\n      onMessage: (message: MessageEvent) => void,\n    ) => {\n      // also handle messages over the pub channel, for backwards compatibility\n      dc.onmessage = onMessage;\n      // handle datachannel errors\n      dc.onerror = this.opts.onDataError;\n      // detect unexpected publisher data channel closes\n      dc.onclose = () => this.opts.onChannelClose(channel.kind);\n      // set up dc buffer threshold - if this is not set, it will default to 0\n      dc.bufferedAmountLowThreshold = channel.lowWaterMark;\n      // handle buffer amount low events\n      dc.onbufferedamountlow = () => channel.refreshBufferStatus();\n      channel.attach(dc);\n    };\n\n    const idFor = (id: number) => (negotiated ? { negotiated, id } : {});\n\n    wire(\n      this.lossy,\n      pcManager.createPublisherDataChannel(lossyDataChannelLabel, {\n        ordered: false,\n        maxRetransmits: 0,\n        ...idFor(NegotiatedDataChannelID.NDCI_LOSSY),\n      }),\n      this.opts.onDataMessage,\n    );\n    wire(\n      this.reliable,\n      pcManager.createPublisherDataChannel(reliableDataChannelLabel, {\n        ordered: true,\n        ...idFor(NegotiatedDataChannelID.NDCI_RELIABLE),\n      }),\n      this.opts.onDataMessage,\n    );\n    wire(\n      this.dataTrack,\n      pcManager.createPublisherDataChannel(dataTrackDataChannelLabel, {\n        ordered: false,\n        maxRetransmits: 0,\n        ...idFor(NegotiatedDataChannelID.NDCI_DATA_TRACK),\n      }),\n      this.opts.onDataTrackMessage,\n    );\n    this.negotiated = negotiated;\n\n    this.lossy.startThresholdTuning();\n  }\n\n  /**\n   * Adopts a subscriber-side data channel by label, wiring the matching receive handler.\n   * Returns false for labels this manager doesn't own.\n   */\n  adoptSubscriberChannel(channel: RTCDataChannel): boolean {\n    let handler: (message: MessageEvent) => void;\n    if (channel.label === reliableDataChannelLabel) {\n      this.reliableSub = channel;\n      handler = this.opts.onDataMessage;\n    } else if (channel.label === lossyDataChannelLabel) {\n      this.lossySub = channel;\n      handler = this.opts.onDataMessage;\n    } else if (channel.label === dataTrackDataChannelLabel) {\n      this.dataTrackSub = channel;\n      handler = this.opts.onDataTrackMessage;\n    } else {\n      return false;\n    }\n    channel.onmessage = handler;\n    return true;\n  }\n\n  /**\n   * Tears down all channels for a peer-connection cleanup: strips handlers, closes the handles,\n   * and resets the reliable session state. Detaching the publisher handles closes them and\n   * rejects parked waiters (the spec allows `pc.close()` to transition channels to 'closed'\n   * without firing events, so waiting for browser close events is not an option).\n   */\n  teardown() {\n    // Detach the data channel handlers before closing anything. Closing a peer connection tears\n    // down the SCTP transport, which can dispatch `error`/`close` events on the still-open data\n    // channels; if our handlers are still attached at that point, handleDataError logs a spurious\n    // \"Unknown DataChannel error\" during an otherwise graceful disconnect. Removing the handlers\n    // before dc.close()/pcManager.close() makes this deterministic regardless of how/when the\n    // browser dispatches those teardown events. See livekit/client-sdk-js#1953.\n    const publisherDataChannels = [this.lossy, this.reliable, this.dataTrack];\n    const subscriberDataChannels = [this.lossySub, this.reliableSub, this.dataTrackSub];\n\n    // Publisher handles are closed by detach, which also rejects parked waiters.\n    for (const channel of publisherDataChannels) {\n      const dc = channel.channelHandle;\n      if (dc) {\n        clearHandlers(dc);\n      }\n      channel.detach('peer connections cleaned up');\n    }\n    // Subscriber handles have no wrapper, so close them directly.\n    for (const dc of subscriberDataChannels) {\n      if (dc) {\n        clearHandlers(dc);\n        dc.close();\n      }\n    }\n    this.lossySub = undefined;\n    this.reliableSub = undefined;\n    this.dataTrackSub = undefined;\n\n    // Full teardown starts the session over: drop replay state and restart sequencing.\n    this.reliable.reset();\n  }\n}\n"],"names":["lossyDataChannelLabel","reliableDataChannelLabel","dataTrackDataChannelLabel","clearHandlers","dc","onbufferedamountlow","onclose","onclosing","onerror","onmessage","onopen","DataChannelManager","constructor","opts","negotiated","flowControlOptions","kind","lowWaterMark","dataChannelLowWaterMark","highWaterMark","dataChannelHighWaterMark","isEngineClosed","onBufferStatusChanged","isLow","reliable","ReliableDataChannel","Object","assign","DataChannelKind","RELIABLE","isDeferringSends","isReconnecting","lossy","LossyDataChannel","LOSSY","bufferFullBehavior","shouldSkipSends","dataTrack","DATA_TRACK_LOSSY","channelFor","getHandle","subscriber","arguments","length","undefined","channelHandle","reliableSub","lossySub","dataTrackSub","hasPublisherChannels","Boolean","publisherChannelsNegotiated","createPublisherChannels","pcManager","channel","old","wire","onMessage","onDataError","onChannelClose","bufferedAmountLowThreshold","refreshBufferStatus","attach","idFor","id","createPublisherDataChannel","ordered","maxRetransmits","NegotiatedDataChannelID","NDCI_LOSSY","onDataMessage","NDCI_RELIABLE","NDCI_DATA_TRACK","onDataTrackMessage","startThresholdTuning","adoptSubscriberChannel","handler","label","teardown","publisherDataChannels","subscriberDataChannels","detach","close","reset"],"mappings":"qWAOA,MAAMA,qBAAqB,GAAG,QAAQ;AACtC,MAAMC,wBAAwB,GAAG,WAAW;AAC5C,MAAMC,yBAAyB,GAAG,aAAa;AAkB/C;AACA,SAASC,aAAaA,CAACC,EAAkB,EAAA;EACvCA,EAAE,CAACC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