Skip to content

fix: Improve media stream error handling using async/await and unified error mapping [WPB-23385]#20505

Merged
EnricoSchw merged 1 commit intodevfrom
fix/screen-share-error-WPB-23385
Feb 27, 2026
Merged

fix: Improve media stream error handling using async/await and unified error mapping [WPB-23385]#20505
EnricoSchw merged 1 commit intodevfrom
fix/screen-share-error-WPB-23385

Conversation

@EnricoSchw
Copy link
Copy Markdown
Contributor

@EnricoSchw EnricoSchw commented Feb 25, 2026

BugWPB-23385 [Web] - Screenshare in connecting status - also the user who shared had secondary device in call

Pull Request

Summary

This PR refactors requestMediaStream to use async/await in order to properly catch and normalize permission-related errors.

  • Converted requestMediaStream to async/await
  • Wrapped the getMediaStream call in a try/catch
  • Mapped PermissionError.TYPE.DENIED to a unified MediaError of type MEDIA_STREAM_PERMISSION
  • Preserved existing error behavior for all other error types

Security Checklist (required)

  • External inputs are validated & sanitized on client and/or server where applicable.
  • API responses are validated; unexpected shapes are handled safely (fallbacks or errors).
  • No unsafe HTML is rendered; if unavoidable, sanitization is applied and documented where it happens.
  • Injection risks (XSS/SQL/command) are prevented via safe APIs and/or escaping.

Accessibility (required)

Standards Acknowledgement (required)


Screenshots or demo (if the user interface changed)

Notes for reviewers

  • Trade-offs:
  • Follow-ups (linked issues):
  • Linked PRs (e.g. web-packages):

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.45%. Comparing base (f4d9a63) to head (8ef15f2).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #20505      +/-   ##
==========================================
- Coverage   45.45%   45.45%   -0.01%     
==========================================
  Files        1638     1638              
  Lines       40378    40378              
  Branches     8340     8340              
==========================================
- Hits        18354    18353       -1     
  Misses      20089    20089              
- Partials     1935     1936       +1     
Flag Coverage Δ
app_webapp 43.65% <100.00%> (-0.01%) ⬇️
lib_api_client 50.17% <ø> (ø)
lib_core 59.05% <ø> (ø)

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

Files with missing lines Coverage Δ
...rc/script/repositories/media/MediaStreamHandler.ts 33.33% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 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.

Comment thread apps/webapp/src/script/repositories/media/MediaStreamHandler.ts
@EnricoSchw EnricoSchw enabled auto-merge February 27, 2026 15:41
@screendriver screendriver force-pushed the fix/screen-share-error-WPB-23385 branch from 5057a6b to 8ef15f2 Compare February 27, 2026 15:48
@sonarqubecloud
Copy link
Copy Markdown

@EnricoSchw EnricoSchw added this pull request to the merge queue Feb 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 10
  • Failed: 0
  • Skipped: 4
  • 🔁 Flaky: 0
  • 📊 Total: 14
  • Total Runtime: 92.6s (~ 1 min 33 sec)

Merged via the queue into dev with commit 76247a0 Feb 27, 2026
54 checks passed
@EnricoSchw EnricoSchw deleted the fix/screen-share-error-WPB-23385 branch February 27, 2026 16:07
screendriver pushed a commit that referenced this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants