Skip to content

Conversation

@kevmo314
Copy link
Contributor

Description

Adds automatic renomination as an ICE agent option which allows the ICE agent to switch to the best available link. The logic for this was scoped out of libwebrtc, which also has a 3s polling interval and continuously pings candidates.

The example is probably the best way to see how this feature works. It establishes two virtual links and then you can see it switch between them based on the RTT, which is controlled by the user.

Reference issue

Fixes #...

@kevmo314 kevmo314 requested a review from JoeTurki October 15, 2025 07:16
@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 66.12903% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.82%. Comparing base (649e13a) to head (4c025bf).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
selection.go 42.37% 33 Missing and 1 partial ⚠️
agent.go 74.33% 23 Missing and 6 partials ⚠️

❌ Your patch status has failed because the patch coverage (66.12%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #822      +/-   ##
==========================================
- Coverage   87.61%   86.82%   -0.79%     
==========================================
  Files          43       43              
  Lines        4537     4706     +169     
==========================================
+ Hits         3975     4086     +111     
- Misses        392      444      +52     
- Partials      170      176       +6     
Flag Coverage Δ
go 86.82% <66.12%> (-0.79%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@kevmo314 kevmo314 force-pushed the automatic-renomination branch from c546566 to f226eba Compare October 15, 2025 12:27
@JoeTurki
Copy link
Member

works great on nixos :)
going to test on windows tomorrow :)

@kevmo314 kevmo314 force-pushed the automatic-renomination branch from 0250d40 to 0534d2b Compare October 21, 2025 11:55
Copy link
Member

@JoeTurki JoeTurki left a comment

Choose a reason for hiding this comment

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

This is awesome. I had a lot of fun playing with it and testing it everywhere. I tried the controlling-agent example on Linux, macOS, and Windows (was so tricky). I also read through the libwebrtc implementation.

this is really cool.

agent_config.go Outdated
Comment on lines 223 to 229
// setup but will have no effect on connectivity.
AutomaticRenomination bool

// RenominationInterval is the minimum time to wait after connection before considering
// automatic renomination. This prevents excessive renominations during initial connection setup.
// If nil, defaults to 3 seconds (matching libwebrtc behavior).
RenominationInterval *time.Duration
Copy link
Member

Choose a reason for hiding this comment

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

Since we're dropping this config in the next major release, maybe let's stick with the options. If users want the new feature, they can move to the new API.
What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense to me! Removed.


## How It Works

The automatic renomination feature evaluates candidate pairs based on:
Copy link
Member

Choose a reason for hiding this comment

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

Will be cool if we provide a docker image with this example, I made a scuffed one while i was testing, can clean and commit it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that would be helpful! Can you push yours?

Definitely the hardest part of testing this is the networking setup.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah that would be helpful! Can you push yours?

cool, I'll make a PR.

@kevmo314 kevmo314 force-pushed the automatic-renomination branch 2 times, most recently from 3e2bd80 to a7f7c50 Compare October 26, 2025 01:40
@kevmo314 kevmo314 force-pushed the automatic-renomination branch from a7f7c50 to 010a95a Compare October 26, 2025 01:40
@kevmo314 kevmo314 merged commit f56f52c into master Oct 26, 2025
22 of 24 checks passed
@kevmo314 kevmo314 deleted the automatic-renomination branch October 26, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants