Skip to content

Send all batchable commands in sdp offer#544

Open
roznawsk wants to merge 2 commits into
mainfrom
FCE-1232-negotiate-two-tracks-simultanously
Open

Send all batchable commands in sdp offer#544
roznawsk wants to merge 2 commits into
mainfrom
FCE-1232-negotiate-two-tracks-simultanously

Conversation

@roznawsk

@roznawsk roznawsk commented Jun 10, 2026

Copy link
Copy Markdown
Member

Description

This allows for negotiating both audio and video at the same time.

Motivation and Context

Why is this change required? What problem does it solve? If it fixes an open
issue, please link to the issue here.

Documentation impact

  • Documentation update required
  • Documentation updated in another PR
  • No documentation update required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

@linear

linear Bot commented Jun 10, 2026

Copy link
Copy Markdown

FCE-1232

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the WebRTC client’s command queue/renegotiation flow so multiple locally queued addTrack operations can be included in a single SDP offer/answer cycle (i.e., batchable commands are drained right before creating the offer).

Changes:

  • Mark addTrack commands as batchable and drain batchable commands in onOfferData before creating/sending the SDP offer.
  • Avoid sending redundant renegotiateTracks when an addTrack happens while a renegotiation is already pending.
  • Add vitest coverage for batching behavior and extend test fixtures/mocks to support the new flow.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/webrtc-client/src/CommandsQueue.ts Adds batching support and multi-notifier tracking for queued commands.
packages/webrtc-client/src/webRTCEndpoint.ts Drains batchable commands before generating an SDP offer.
packages/webrtc-client/src/tracks/LocalTrackManager.ts Skips redundant renegotiateTracks while renegotiation is already pending.
packages/webrtc-client/tests/methods/addTrackBatching.test.ts New tests covering batching and error isolation within a batched cycle.
packages/webrtc-client/tests/fixtures.ts Adds helper to build multi-track SDP answers for tests.
packages/webrtc-client/tests/mocks.ts Adjusts RTCPeerConnection mock signaling state for instability checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/webrtc-client/src/CommandsQueue.ts
Comment thread packages/webrtc-client/tests/fixtures.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Comment thread packages/webrtc-client/tests/fixtures.ts
Comment thread .yarnrc.yml
@roznawsk roznawsk marked this pull request as ready for review June 11, 2026 11:35
@roznawsk roznawsk requested a review from czerwiukk June 11, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants