Skip to content

chore: ignore not-initialized calls when calculating media session state#40867

Merged
dionisio-bot[bot] merged 1 commit into
developfrom
voice/non-initialized-busy-calls
Jun 11, 2026
Merged

chore: ignore not-initialized calls when calculating media session state#40867
dionisio-bot[bot] merged 1 commit into
developfrom
voice/non-initialized-busy-calls

Conversation

@pierre-lehnen-rc

@pierre-lehnen-rc pierre-lehnen-rc commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Proposed changes (including videos or screenshots)

The client instantiates a Call object whenever a signal is received with a callId it doesn't recognize, but that Call instance only becomes valid once a "new call" signal is received. If the new signal is never received, the call remains there, blocking the media session from initializing new calls.

With this change, calls that have not been initialized yet will be ignored by the session.

This is a bug on the lib, but there's no easy way to trigger this as a bug on the product as a whole.

Issue(s)

Derived from DMV-53

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Fixed main call selection logic to properly exclude uninitialized calls.
  • Refactor

    • Improved initialization state tracking for better call lifecycle management.

@dionisio-bot

dionisio-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8a63c2e

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 added this to the 8.6.0 milestone Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR converts ClientMediaCall.initialized from a mutable field to a read-only getter backed by a private field, and applies this state invariant to improve call filtering in session management. All initialization paths and the main call selection now use the new read-only contract.

Changes

Call Initialization State Management

Layer / File(s) Summary
Read-only initialization state in ClientMediaCall
packages/media-signaling/src/lib/Call.ts
ClientMediaCall introduces a private _initialized backing field with a public initialized getter. The constructor and both initializeOutboundCall and initializeRemoteCall methods are updated to use the backing field instead of a mutable class field.
Filter uninitialized calls in main call selection
packages/media-signaling/src/lib/Session.ts
MediaSignalingSession.getMainCall() now checks call.initialized and skips calls that have not yet been initialized, in addition to existing checks for hangup state and ignored calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective: making uninitialized calls excluded from media session state calculation, which is the primary purpose of both file changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • DMV-53: Request failed with status code 401

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.

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.12%. Comparing base (1b88937) to head (8a63c2e).
⚠️ Report is 87 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #40867    +/-   ##
=========================================
  Coverage    70.12%   70.12%            
=========================================
  Files         3341     3341            
  Lines       123558   123661   +103     
  Branches     22136    22193    +57     
=========================================
+ Hits         86642    86717    +75     
- Misses       33567    33587    +20     
- Partials      3349     3357     +8     
Flag Coverage Δ
e2e 59.33% <ø> (-0.01%) ⬇️
e2e-api 46.25% <ø> (-0.03%) ⬇️
unit 70.94% <ø> (+0.01%) ⬆️

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 marked this pull request as ready for review June 10, 2026 14:22

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

Re-trigger cubic

@pierre-lehnen-rc pierre-lehnen-rc added the stat: QA assured Means it has been tested and approved by a company insider label Jun 11, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 11, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue Jun 11, 2026
Merged via the queue into develop with commit 57c4cb7 Jun 11, 2026
48 checks passed
@dionisio-bot dionisio-bot Bot deleted the voice/non-initialized-busy-calls branch June 11, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants