Skip to content

Conversation

@pierre-lehnen-rc
Copy link
Contributor

@pierre-lehnen-rc pierre-lehnen-rc commented Dec 22, 2025

Proposed changes (including videos or screenshots)

Changed media-signaling lib to only attempt to use a media stream once it is confirmed that the session will be participating on a call.
Without this change, if the user had multiple rocket.chat sessions, all of them would generate and play a media stream, but only one of them would have actual media reaching it so the others would generate an error log.

Issue(s)

VGA-129

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Refactor
    • Remote media stream retrieval now returns null when unavailable instead of throwing errors, improving reliability and graceful error handling in edge cases.

✏️ Tip: You can customize this high-level summary in your review settings.

@pierre-lehnen-rc pierre-lehnen-rc added this to the 8.1.0 milestone Dec 22, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 22, 2025

⚠️ No Changeset found

Latest commit: ca31c22

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

Walkthrough

The getRemoteMediaStream() method in the media-signaling API is updated to return MediaStream | null instead of MediaStream. Error-throwing paths for access control checks are replaced with null returns, affecting both the interface definition and implementation.

Changes

Cohort / File(s) Summary
API Signature Update
packages/media-signaling/src/definition/call/IClientMediaCall.ts, packages/media-signaling/src/lib/Call.ts
Updated getRemoteMediaStream() return type from MediaStream to MediaStream | null; replaced error-throwing conditions for hidden/unsigned calls and non-WebRTC services with null returns.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward API signature change affecting two related files (interface and implementation)
  • Logic modifications are consistent across files (error paths → null returns)
  • Verify null-handling expectations at call sites remain compatible

Possibly related PRs

Suggested labels

stat: ready to merge

Suggested reviewers

  • gabriellsh
  • tassoevan

Poem

🐰 A stream of hope, no longer thrown,
Now null when access stands alone,
No errors harsh, just gentle null,
The API's grace is beautiful,
Clean code hops forward with a bound! 🌙✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'improve handling of unused streams on media calls' aligns with the core change: modifying getRemoteMediaStream to return null instead of throwing errors, preventing unused sessions from generating streams.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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/improve-media-stream-handling

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.

@pierre-lehnen-rc pierre-lehnen-rc added the stat: QA assured Means it has been tested and approved by a company insider label Dec 22, 2025
@pierre-lehnen-rc pierre-lehnen-rc marked this pull request as ready for review December 22, 2025 16:03
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.63%. Comparing base (af0600c) to head (ca31c22).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37921      +/-   ##
===========================================
- Coverage    70.64%   70.63%   -0.01%     
===========================================
  Files         3143     3143              
  Lines       108684   108678       -6     
  Branches     19567    19538      -29     
===========================================
- Hits         76783    76768      -15     
- Misses       29899    29907       +8     
- Partials      2002     2003       +1     
Flag Coverage Δ
unit 71.79% <ø> (+<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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.1GiB 1.1GiB +11MiB
rocketchat 355MiB 345MiB +11MiB
omnichannel-transcript-service 132MiB 132MiB +716B
queue-worker-service 132MiB 132MiB -1.2KiB
ddp-streamer-service 126MiB 126MiB -503B
account-service 113MiB 113MiB -80B
authorization-service 111MiB 111MiB -761B
presence-service 111MiB 111MiB -695B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 17:35", "12/29 18:21 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
Loading

Statistics (last 30 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.4GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.1GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37921
  • Baseline: develop
  • Timestamp: 2025-12-29 18:21:44 UTC
  • Historical data points: 30

Updated: Mon, 29 Dec 2025 18:21:44 GMT

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 29, 2025

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

@pierre-lehnen-rc pierre-lehnen-rc added the stat: ready to merge PR tested and approved waiting for merge label Dec 29, 2025
@kodiakhq kodiakhq bot merged commit e1e6f7b into develop Dec 29, 2025
44 checks passed
@kodiakhq kodiakhq bot deleted the chore/improve-media-stream-handling branch December 29, 2025 18:43
gaolin1 pushed a commit to gaolin1/medsense.webchat that referenced this pull request Jan 6, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants