-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: identify if a call was put on hold by the remote user #37382
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
chore: identify if a call was put on hold by the remote user #37382
Conversation
|
|
Looks like this PR is ready to merge! 🎉 |
WalkthroughThis PR adds remote hold detection to the media-signaling library. It tracks whether the remote party has placed the call on hold by analyzing audio transceiver directions during WebRTC negotiation, exposing this state through the public call API via a Changes
Sequence DiagramsequenceDiagram
participant WRTCState as WebRTC<br/>Internal State
participant Call as Call<br/>Component
participant Processor as WebRTC<br/>Processor
participant UI as UI Layer
WRTCState->>Call: onWebRTCInternalStateChange()
Call->>Call: updateRemoteHeld()
Call->>Processor: isRemoteHeld()
Processor->>Processor: getAudioTransceivers()
Processor->>Processor: Check transceiver<br/>currentDirection
Processor-->>Call: boolean (remote hold state)
alt State Changed
Call->>Call: Update _remoteHeld
Call->>UI: emit trackStateChange
end
UI->>Call: remoteHeld (getter)
Call-->>UI: boolean value
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/voip-sync-audio-direction #37382 +/- ##
==================================================================
+ Coverage 68.03% 68.05% +0.01%
==================================================================
Files 3361 3364 +3
Lines 115490 115626 +136
Branches 20771 20798 +27
==================================================================
+ Hits 78573 78688 +115
- Misses 34240 34254 +14
- Partials 2677 2684 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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/services/webrtc/Processor.ts (1)
331-335: Consider using the helper in existing code to reduce duplication.The new
getAudioTransceivers()helper extracts common logic, but the same filtering pattern exists inline at lines 109-111 (createOffer) and lines 185-187 (createAnswer). Consider refactoring those locations to use this helper.
📜 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.
📒 Files selected for processing (4)
packages/media-signaling/src/definition/call/IClientMediaCall.ts(1 hunks)packages/media-signaling/src/definition/services/webrtc/IWebRTCProcessor.ts(1 hunks)packages/media-signaling/src/lib/Call.ts(4 hunks)packages/media-signaling/src/lib/services/webrtc/Processor.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: pierre-lehnen-rc
Repo: RocketChat/Rocket.Chat PR: 36718
File: packages/media-signaling/src/lib/Call.ts:633-642
Timestamp: 2025-09-23T00:27:05.438Z
Learning: In PR #36718, pierre-lehnen-rc prefers to maintain consistency with the old architecture patterns for DTMF handling rather than implementing immediate validation improvements, deferring enhancements to future work.
🧬 Code graph analysis (1)
packages/media-signaling/src/lib/Call.ts (1)
packages/media-signaling/src/lib/services/webrtc/Processor.ts (1)
isRemoteHeld(245-270)
⏰ 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). (4)
- GitHub Check: 🔨 Test Unit / Unit Tests
- GitHub Check: 🔎 Code Check / Code Lint
- GitHub Check: 🔎 Code Check / TypeScript
- GitHub Check: 📦 Meteor Build - coverage
🔇 Additional comments (7)
packages/media-signaling/src/definition/services/webrtc/IWebRTCProcessor.ts (1)
38-38: LGTM! Clean interface extension.The addition of
isRemoteHeld()to the interface is straightforward and properly exposes the remote hold detection capability.packages/media-signaling/src/definition/call/IClientMediaCall.ts (1)
81-82: LGTM! Well-documented interface extension.The
remoteHeldfield is properly documented and follows the existing pattern for tracking call state flags.packages/media-signaling/src/lib/Call.ts (4)
127-131: LGTM! Consistent state management pattern.The private field and public getter follow the established pattern used for
mutedandheldproperties.
226-226: LGTM! Proper initialization.Initializing
_remoteHeldtofalseis correct—the call starts with the remote side not on hold.
1087-1099: LGTM! Well-structured update method.The
updateRemoteHeld()method correctly:
- Guards against missing processor
- Queries the current remote hold state
- Only updates and emits when state changes
- Emits
trackStateChangeto notify observers
1121-1121: LGTM! Proper integration point.Calling
updateRemoteHeld()fromonWebRTCInternalStateChangeensures the remote hold state is synchronized whenever WebRTC internal state changes, which is appropriate since transceiver directions can change during negotiation.
…into chore/identify-remote-held
82eea34
into
feat/voip-sync-audio-direction
Proposed changes (including videos or screenshots)
Issue(s)
VGA-41
VGA-43
Steps to test or reproduce
Further comments
Summary by CodeRabbit