Skip to content

Conversation

Copy link
Member

@td-famedly td-famedly left a comment

Choose a reason for hiding this comment

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

lg, do you maybe want to add a test for it? I think we could add a flag to MockWebRTCDelegate which tells it to throw an error on createPeerConnection and then we can confirm if the call is terminated as expected.

(feel free to modify the suggestion if you have better ideas!)

@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 55.96%. Comparing base (609ee1d) to head (2095a4f).

Files with missing lines Patch % Lines
lib/src/voip/call_session.dart 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2011      +/-   ##
==========================================
+ Coverage   55.89%   55.96%   +0.07%     
==========================================
  Files         146      146              
  Lines       18926    18937      +11     
==========================================
+ Hits        10579    10599      +20     
+ Misses       8347     8338       -9     
Files with missing lines Coverage Δ
lib/src/voip/utils/types.dart 16.66% <ø> (+16.66%) ⬆️
lib/src/voip/call_session.dart 45.85% <85.71%> (+1.67%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 609ee1d...2095a4f. Read the comment docs.

@coder-with-a-bushido coder-with-a-bushido changed the title fix: handle failed to create RTCPeerConnection object error in a call Handle call errors Mar 17, 2025
Logs().v('[VOIP] prepareMediaStream error => ${e.toString()}');
Logs().v('[VOIP] preparePeerConnection error => ${e.toString()}');
await _createPeerConnectionFailed(e);
rethrow;
Copy link
Member

Choose a reason for hiding this comment

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

should this rethrow here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, forgot to remove it

.getDisplayMedia(UserMediaConstraints.screenMediaConstraints);
} catch (e) {
await _getUserMediaFailed(e);
await _getDisplayMediaFailed(e);
Copy link
Member

Choose a reason for hiding this comment

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

hm this is a bit difficult to read, I don't think _getDisplayMediaFailed is reused, can we maybe remove the *failed methods and move the implementations in this block? it saves us the code jumping + might also remove the return null

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