Skip to content

Conversation

@pierre-lehnen-rc
Copy link
Contributor

@pierre-lehnen-rc pierre-lehnen-rc commented Nov 5, 2025

Proposed changes (including videos or screenshots)

Issue(s)

VGA-47
VGA-48

Steps to test or reproduce

Further comments

Added a new flags attribute to the call initialization signal, which the server can use to instruct the client to execute certain actions or not. I'm using this to let the server determine which client may create data channels and when.

Summary by CodeRabbit

  • New Features

    • Added call flags on new-call signals and call objects (e.g., internal, create-data-channel).
    • Optional peer-to-peer data channel support for WebRTC calls, with P2P command messaging to sync mute/unmute/end.
    • Remote mute state exposed on calls and via the WebRTC processor; remote mute now synchronized between peers.
  • Refactor

    • Centralized construction of new-call signals to remove duplicated signal-building logic.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 5, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

⚠️ No Changeset found

Latest commit: c787f43

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pierre-lehnen-rc pierre-lehnen-rc marked this pull request as ready for review November 5, 2025 17:43
@pierre-lehnen-rc pierre-lehnen-rc added this to the 7.13.0 milestone Nov 5, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

Centralizes new-call signal construction into a new buildNewCallSignal(call, role) function, adds a CallFlag type and propagates flags through signals and client calls, and implements optional WebRTC data-channel handling with remote-mute synchronization gated by a create-data-channel flag.

Changes

Cohort / File(s) Summary
Signal construction centralization
ee/packages/media-calls/src/internal/SignalProcessor.ts, ee/packages/media-calls/src/internal/agents/UserActorAgent.ts
Replace duplicated inline new-call signal assembly with calls to buildNewCallSignal(call, role); remove local buildNewCallSignal implementations and inline transferredBy construction; update imports.
New signal builder module
ee/packages/media-calls/src/server/buildNewCallSignal.ts
Add buildNewCallSignal(call, role) that assembles ServerMediaSignalNewCall, computes flags, and conditionally includes replacingCallId, transferredBy, and requestedCallId.
Type definitions for flags
packages/media-signaling/src/definition/call/IClientMediaCall.ts, packages/media-signaling/src/definition/signals/server/new.ts
Add `CallFlag = 'internal'
Client-side flag & remote-mute support
packages/media-signaling/src/lib/Call.ts
Add private _flags and _remoteMute with public getters flags and remoteMute; initialize _flags from incoming signals; consolidate remote state updates via updateRemoteStates.
WebRTC data channel implementation
packages/media-signaling/src/lib/services/webrtc/Processor.ts
Add data-channel lifecycle (createDataChannel, initializeDataChannel, onDataChannel), gate creation in offer flow by create-data-channel flag, implement P2P commands (mute/unmute/end), track _remoteMute, expose isRemoteMute(), and integrate peer.ondatachannel.
Interface updates
packages/media-signaling/src/definition/services/webrtc/IWebRTCProcessor.ts
Add remoteMute: boolean to internal state map and isRemoteMute(): boolean to the processor interface.

Sequence Diagram(s)

sequenceDiagram
    participant Creator as Call Creator
    participant SignalProc as SignalProcessor
    participant Builder as buildNewCallSignal
    participant ServerSig as Server Signal
    participant Client as Client Call
    participant WebRTC as WebRTC Processor
    participant DC as DataChannel

    Creator->>SignalProc: processCallSignal(call, role)
    SignalProc->>Builder: buildNewCallSignal(call, role)
    Builder-->>SignalProc: ServerMediaSignalNewCall (includes flags)
    SignalProc->>ServerSig: sendSignal(new-call)
    ServerSig->>Client: receive new-call (flags)

    Client->>WebRTC: initialize with signal (flags)
    alt flags contains create-data-channel
        WebRTC->>WebRTC: createDataChannel()
        WebRTC->>DC: initializeDataChannel(label)
        DC-->>WebRTC: open / onmessage handlers set
    else
        WebRTC->>WebRTC: skip data channel creation
    end

    alt remote peer creates data channel
        WebRTC->>WebRTC: ondatachannel(event)
        WebRTC->>DC: initialize received channel
        DC-->>WebRTC: ready
    end

    DC-->>WebRTC: onmessage ("mute"/"unmute"/"end")
    WebRTC->>Client: update remote mute state
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review conditional inclusion of transferredBy, replacingCallId, requestedCallId in buildNewCallSignal.
  • Verify all new-call emission paths (SignalProcessor, UserActorAgent) call the centralized builder.
  • Inspect WebRTC Processor data-channel lifecycle, message parsing, label validation, and remote-mute propagation for race conditions.

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • gabriellsh

Poem

🐇 I stitched the signal, neat and small,
Flags tucked in the packet, ready to call.
A channel opened, soft and sly,
Hopping bytes from peer to peer — oh my!
The rabbit cheers — one builder for all.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: sync call's "mute" state between clients' accurately summarizes the main feature: implementing mute state synchronization between call clients using a data channel mechanism.
Linked Issues check ✅ Passed The PR implements all coding requirements from VGA-47 and VGA-48: introduces flags for server-controlled data channel creation, establishes WebRTC data channel with P2P messaging, implements mute/unmute synchronization, and exposes remoteMute state through the library.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked objectives: signal construction refactoring centralizes flag handling, new buildNewCallSignal function manages flag computation, and data channel implementation with mute state tracking aligns with VGA-47 and VGA-48 requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/voip-data-channel

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/media-signaling/src/lib/Call.ts (1)

289-289: Consider using nullish coalescing operator for consistency.

While || [] works correctly here, the nullish coalescing operator ?? [] is more semantically accurate for handling null/undefined values and aligns with modern TypeScript patterns.

Apply this diff:

-		this._flags = signal.flags || [];
+		this._flags = signal.flags ?? [];
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 82eea34 and 03c6978.

📒 Files selected for processing (7)
  • ee/packages/media-calls/src/internal/SignalProcessor.ts (3 hunks)
  • ee/packages/media-calls/src/internal/agents/UserActorAgent.ts (2 hunks)
  • ee/packages/media-calls/src/server/buildNewCallSignal.ts (1 hunks)
  • packages/media-signaling/src/definition/call/IClientMediaCall.ts (1 hunks)
  • packages/media-signaling/src/definition/signals/server/new.ts (2 hunks)
  • packages/media-signaling/src/lib/Call.ts (4 hunks)
  • packages/media-signaling/src/lib/services/webrtc/Processor.ts (7 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
packages/media-signaling/src/lib/Call.ts (1)
packages/media-signaling/src/definition/call/IClientMediaCall.ts (1)
  • CallFlag (67-67)
ee/packages/media-calls/src/server/buildNewCallSignal.ts (4)
packages/core-typings/src/mediaCalls/IMediaCall.ts (1)
  • IMediaCall (35-68)
packages/media-signaling/src/definition/call/IClientMediaCall.ts (2)
  • CallRole (17-17)
  • CallFlag (67-67)
packages/media-signaling/src/definition/signals/server/new.ts (1)
  • ServerMediaSignalNewCall (4-23)
ee/packages/media-calls/src/server/getNewCallTransferredBy.ts (1)
  • getNewCallTransferredBy (4-20)
packages/media-signaling/src/definition/signals/server/new.ts (1)
packages/media-signaling/src/definition/call/IClientMediaCall.ts (1)
  • CallFlag (67-67)
ee/packages/media-calls/src/internal/agents/UserActorAgent.ts (1)
ee/packages/media-calls/src/server/buildNewCallSignal.ts (1)
  • buildNewCallSignal (23-42)
ee/packages/media-calls/src/internal/SignalProcessor.ts (3)
ee/packages/media-calls/src/server/buildNewCallSignal.ts (1)
  • buildNewCallSignal (23-42)
packages/media-signaling/src/lib/Call.ts (1)
  • role (62-64)
ee/packages/media-calls/src/internal/agents/CallSignalProcessor.ts (1)
  • role (44-46)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🔇 Additional comments (10)
packages/media-signaling/src/definition/signals/server/new.ts (1)

1-23: Flags plumbing looks good

Importing CallFlag and exposing flags?: CallFlag[] keeps the signal aligned with the new call metadata without breaking existing payloads.

packages/media-signaling/src/definition/call/IClientMediaCall.ts (1)

67-106: Call flags surface is clear

Making CallFlag explicit and adding flags to the client call contract keeps the type system in sync with the new signaling data.

ee/packages/media-calls/src/internal/agents/UserActorAgent.ts (1)

2-82: Centralized signal builder makes sense

Routing onCallCreated through the shared buildNewCallSignal helper removes duplicate payload logic and keeps the agent aligned with the server-side defaults.

ee/packages/media-calls/src/internal/SignalProcessor.ts (1)

4-245: Good reuse of buildNewCallSignal

Switching the various call-entry paths to buildNewCallSignal keeps role-specific payloads consistent and adds the new flag list without duplicating logic.

ee/packages/media-calls/src/server/buildNewCallSignal.ts (3)

1-4: LGTM! Clean imports and dependencies.

The imports are well-organized and include all necessary types and helper functions.


23-42: LGTM! Well-structured signal builder with proper optional field handling.

The function correctly:

  • Determines self/contact based on role
  • Retrieves transferred-by information
  • Computes flags using the helper
  • Uses spread operators to conditionally include optional fields
  • Creates shallow copies of contact objects to avoid reference issues

6-21: Data channel creation logic is correctly implemented.

Verification confirms the implementation aligns with the PR objective:

  • The client properly checks the create-data-channel flag at line 397 before attempting creation
  • The callee safely returns early due to the missing flag, preventing duplicate channel creation
  • Both parties use symmetric initialization via initializeDataChannel(), enabling bidirectional communication once the channel is established
  • The WebRTC pattern (caller creates, callee receives via ondatachannel event) is correctly implemented
packages/media-signaling/src/lib/Call.ts (3)

15-15: LGTM! Import addition is correct.


185-189: LGTM! Proper encapsulation of flags.

The private field with public getter pattern correctly exposes the flags as read-only to consumers.


225-225: LGTM! Proper initialization for outbound calls.

The empty array initialization is correct for outbound calls created before receiving server data.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (2)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (2)

420-428: Handle closed data channels to allow recreation.

If the peer closes the data channel, _dataChannel continues to reference the closed instance, preventing createDataChannel from creating a new channel during subsequent negotiations. This breaks data exchange for the remainder of the call.

Apply this diff to detect and clear closed channels:

 private createDataChannel(): void {
+  if (this._dataChannel?.readyState === 'closed') {
+    this._dataChannel = null;
+  }
+
   if (this._dataChannel || !this.config.call.flags.includes('create-data-channel')) {
     return;
   }

430-450: Add onclose and onerror handlers for robustness.

The data channel lacks lifecycle and error handling:

  1. Missing onclose handler prevents clearing _dataChannel, blocking recreation (flagged in past review).
  2. Missing onerror handler leaves errors unlogged and unhandled.

Apply this diff to add both handlers:

   channel.onmessage = (event) => {
     this.config.logger?.debug('Data Channel Message', event.data);
   };

+  channel.onerror = (event) => {
+    this.config.logger?.error('Data Channel Error', event);
+  };
+
+  channel.onclose = () => {
+    this.config.logger?.debug('Data Channel Close', channel.label);
+    if (this._dataChannel === channel) {
+      this._dataChannel = null;
+    }
+  };
+
   this._dataChannel = channel;
 }
🧹 Nitpick comments (2)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (2)

463-463: Add ondatachannel cleanup in unregisterPeerEvents.

The ondatachannel handler is registered but not explicitly unregistered in unregisterPeerEvents (lines 466-481), which cleans up all other peer event handlers.

Apply this diff to add the cleanup:

   peer.onicegatheringstatechange = null as any;
   peer.onsignalingstatechange = null as any;
+  peer.ondatachannel = null as any;
 } catch {

158-168: Consider explicit data channel cleanup in stop().

While peer.close() should close all associated channels, explicitly closing and clearing _dataChannel would make the cleanup more defensive and clear.

Apply this diff to add explicit cleanup:

   this.stopped = true;
   // Stop only the remote stream; the track of the local stream may still be in use by another call so it's up to the session to stop it.
   this.remoteStream.stopAudio();
+
+  if (this._dataChannel) {
+    this._dataChannel.close();
+    this._dataChannel = null;
+  }
+
   this.unregisterPeerEvents();
   this.unregisterAudioLevelTracker();
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 03c6978 and ceebb23.

📒 Files selected for processing (1)
  • packages/media-signaling/src/lib/services/webrtc/Processor.ts (7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.07%. Comparing base (a752008) to head (c787f43).
⚠️ Report is 1 commits behind head on feat/voip-sync-audio-direction.

Additional details and impacted files

Impacted file tree graph

@@                        Coverage Diff                         @@
##           feat/voip-sync-audio-direction   #37389      +/-   ##
==================================================================
+ Coverage                           68.05%   68.07%   +0.01%     
==================================================================
  Files                                3364     3364              
  Lines                              115626   115626              
  Branches                            20869    20874       +5     
==================================================================
+ Hits                                78687    78710      +23     
+ Misses                              34251    34227      -24     
- Partials                             2688     2689       +1     
Flag Coverage Δ
e2e 57.49% <ø> (+0.01%) ⬆️
unit 72.13% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pierre-lehnen-rc pierre-lehnen-rc changed the title chore: create a data channel between clients on internal calls chore: sync call's "mute" state between clients Nov 6, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (1)

239-255: Handle the new remoteMute state in getInternalState

setRemoteMute() emits internalStateChange('remoteMute'), but getInternalState('remoteMute') currently falls through the switch and returns undefined. Any consumer reacting to the event will never see the actual boolean value. Please add an explicit branch for remoteMute.

 		switch (stateName) {
 			case 'signaling':
 				return this.peer.signalingState;
 			case 'connection':
 				return this.peer.connectionState;
 			case 'iceConnection':
 				return this.peer.iceConnectionState;
 			case 'iceGathering':
 				return this.peer.iceGatheringState;
 			case 'iceUntrickler':
 				if (this.iceGatheringTimedOut) {
 					return 'timeout';
 				}
 				return this.iceGatheringWaiters.size > 0 ? 'waiting' : 'not-waiting';
+			case 'remoteMute':
+				return this._remoteMute;
 		}
🧹 Nitpick comments (1)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (1)

563-571: Clear ondatachannel in unregisterPeerEvents

We now register peer.ondatachannel, but the teardown path doesn’t null it like the other handlers. Please clear it to keep the cleanup symmetrical.

 			peer.onicecandidateerror = null as any;
 			peer.onconnectionstatechange = null as any;
 			peer.oniceconnectionstatechange = null as any;
 			peer.onnegotiationneeded = null as any;
 			peer.onicegatheringstatechange = null as any;
 			peer.onsignalingstatechange = null as any;
+			peer.ondatachannel = null as any;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ceebb23 and 8b995f5.

📒 Files selected for processing (3)
  • packages/media-signaling/src/definition/services/webrtc/IWebRTCProcessor.ts (2 hunks)
  • packages/media-signaling/src/lib/Call.ts (8 hunks)
  • packages/media-signaling/src/lib/services/webrtc/Processor.ts (10 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/media-signaling/src/lib/Call.ts
🧰 Additional context used
🧬 Code graph analysis (1)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (1)
packages/media-signaling/src/lib/Call.ts (1)
  • muted (112-118)
🔇 Additional comments (1)
packages/media-signaling/src/definition/services/webrtc/IWebRTCProcessor.ts (1)

13-48: Remote mute accessor looks solid

Adding the remoteMute state and isRemoteMute() accessor keeps the interface aligned with the processor changes. 👍

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (1)

294-296: Add stopped state check for consistency.

Unlike isRemoteHeld() (lines 268-270), this method doesn't check the stopped state. For consistency with the existing API, consider returning false when the processor has been stopped.

Apply this diff:

 public isRemoteMute(): boolean {
+  if (this.stopped) {
+    return false;
+  }
   return this._remoteMute;
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8b995f5 and 8eb3f7c.

📒 Files selected for processing (1)
  • packages/media-signaling/src/lib/services/webrtc/Processor.ts (10 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (1)
packages/media-signaling/src/lib/Call.ts (1)
  • muted (112-118)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (9)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (9)

9-10: LGTM: Well-defined constants.

The data channel label and P2P command types are clear and properly scoped.


65-69: LGTM: Proper field declarations.

The new fields for data channel state tracking are correctly typed and follow the existing naming conventions.


132-132: LGTM: Appropriate placement.

Creating the data channel before negotiation ensures it's included in the offer when the flag is present.


149-149: LGTM: Proper mute synchronization.

Updating the remote peer's mute state after changing the local state maintains consistency.


166-166: LGTM: Clean shutdown signal.

Ending the data channel at the beginning of stop() properly notifies the remote peer before teardown.


441-444: LGTM: Safe end sequence.

Setting _dataChannelEnded before sending the command ensures the flag is set even if sending fails.


446-487: LGTM: Comprehensive data channel initialization.

The initialization properly handles:

  • Label validation to reject unexpected channels
  • Smart assignment logic that avoids overwriting open channels
  • Channel recreation on close (when appropriate)
  • Message validation and parsing

The stopped state concern in the onclose handler is already covered in the earlier review comment.


489-548: LGTM: Robust P2P command implementation.

The command handling demonstrates good practices:

  • sendP2PCommand: Guards against invalid channel states and returns success status
  • getCommandFromDataChannelMessage: Properly validates and parses with error handling
  • onP2PCommand: Clean command routing with appropriate state updates
  • setRemoteMute: Prevents redundant state changes and properly emits events
  • updateMuteForRemote: Concise synchronization of local mute state to remote peer

723-726: LGTM: Clean event handler delegation.

The handler properly delegates to initializeDataChannel(), which performs all necessary validation and setup.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (1)

433-441: Add this.stopped guard for consistency and defensive programming.

As flagged in a previous review, the guard at line 434 should check this.stopped to prevent calling this.peer.createDataChannel() on a closed RTCPeerConnection. While _dataChannelEnded provides technical protection, the class establishes a pattern elsewhere of checking this.stopped before peer operations for clarity and consistency. Based on learnings

Apply this diff:

 	private createDataChannel(): void {
-		if (this._dataChannel || this._dataChannelEnded || !this.config.call.flags.includes('create-data-channel')) {
+		if (this.stopped || this._dataChannel || this._dataChannelEnded || !this.config.call.flags.includes('create-data-channel')) {
 			return;
 		}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8eb3f7c and c787f43.

📒 Files selected for processing (1)
  • packages/media-signaling/src/lib/services/webrtc/Processor.ts (12 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (1)
packages/media-signaling/src/lib/utils/getExternalWaiter.ts (1)
  • PromiseWaiterData (1-7)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (12)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (12)

9-10: LGTM!

The data channel label and command type definitions are clear and appropriate for P2P mute synchronization.


65-69: LGTM!

The data channel state variables are properly typed and initialized.


132-132: LGTM!

Calling createDataChannel in createOffer is the appropriate place to establish the data channel during negotiation.


149-149: LGTM!

Notifying the remote peer of mute state changes via updateMuteForRemote properly synchronizes the mute state across clients.


254-256: LGTM!

The remoteMute case correctly returns the internal _remoteMute state for monitoring.


296-298: LGTM!

The public isRemoteMute method appropriately exposes the remote mute state as per VGA-48 requirements.


443-446: LGTM!

Setting _dataChannelEnded and sending the 'end' command properly signals teardown to the remote peer.


491-504: LGTM!

The sendP2PCommand method correctly guards against sending on a closed or non-existent channel and returns a boolean to indicate success.


506-521: LGTM!

The command validation and parsing logic is robust, with proper error handling for malformed messages.


523-545: LGTM!

The command routing and remote mute state management correctly handle mute/unmute/end commands, with proper change detection to avoid unnecessary event emissions.


547-550: LGTM!

The updateMuteForRemote method correctly synchronizes the local mute state with the remote peer via the data channel.


726-729: LGTM!

The onDataChannel handler appropriately delegates to initializeDataChannel for inbound data channel setup.

@tassoevan tassoevan merged commit b4dc8ba into feat/voip-sync-audio-direction Nov 7, 2025
97 of 99 checks passed
@tassoevan tassoevan deleted the chore/voip-data-channel branch November 7, 2025 21:18
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.

3 participants