Skip to content

Conversation

@mickel8
Copy link
Contributor

@mickel8 mickel8 commented Mar 10, 2025

WebRTC determines agent's role based on who sends the offer first (https://w3c.github.io/webrtc-pc/#ref-for-dfn-icerole-1 and https://www.rfc-editor.org/rfc/rfc8445#section-6.1.1). Because an agent has to be initialized at the very beginning, its role can't be set in the constructor.

This PR adds an ability to set agent's role after it was created.

Things to note:

  • adding remote candidate or gathering local candidates won't be possible until the role is set. This is to prevent creating checklist pairs as their priority rely on agent's role
  • role can only be set once

@mickel8 mickel8 marked this pull request as ready for review March 10, 2025 12:22
@codecov
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.17%. Comparing base (977359f) to head (f6249c2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
+ Coverage   83.99%   84.17%   +0.17%     
==========================================
  Files          25       25              
  Lines        1706     1719      +13     
==========================================
+ Hits         1433     1447      +14     
+ Misses        273      272       -1     
Files with missing lines Coverage Δ
lib/ex_ice/ice_agent.ex 61.42% <100.00%> (+2.96%) ⬆️
lib/ex_ice/priv/ice_agent.ex 86.56% <100.00%> (+0.10%) ⬆️

... and 1 file with indirect coverage changes


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 977359f...f6249c2. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mickel8 mickel8 force-pushed the set-role branch 2 times, most recently from ff812d8 to 7975a31 Compare March 10, 2025 15:15
@mickel8 mickel8 merged commit b58acee into master Mar 10, 2025
4 checks passed
@mickel8 mickel8 deleted the set-role branch March 10, 2025 16:03
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.

2 participants