Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an internal slot for active candidate pairs. #194

Closed
wants to merge 9 commits into from

Conversation

sam-vi
Copy link
Contributor

@sam-vi sam-vi commented Jan 10, 2024

Fixes: #188.

The [[CandidatePairs]] slot in RTCIceTransport tracks candidate pairs formed by the ICE agent and surfaced to the application, and not removed via icecandidatepairremove or removeCandidatePair().

The slot is used to validate the inputs to selectCandidatePair() and removeCandidatePair().

EDIT: To help Sameer make progress while OOO, I've re-uploaded this as #197 with comments addressed.


Preview | Diff

Fixes: w3c#188.

The [[CandidatePairs]] slot in RTCIceTransport tracks candidate pairs
formed by the ICE agent and surfaced to the application, and not removed
via icecandidatepairremove or removeCandidatePair().

The slot is used to validate the inputs to selectCandidatePair() and
removeCandidatePair().
sam-vi added a commit to sam-vi/webrtc-extensions that referenced this pull request Jan 10, 2024
This depends on several other PRs to be merged first:
- w3c#170: Addition of removeCandidatePair method
- w3c#192: Definition of candidate match algo
  - alternately, w3c/webrtc-pc#2906 to enforce RTCIceCandidate object
    equality
- w3c#193: Definition of candidate pair match algo
- w3c#194: Addition of CandidatePairs internal slot
sam-vi added a commit to sam-vi/webrtc-extensions that referenced this pull request Jan 10, 2024
This depends on several other PRs to be merged first:
- w3c#170: Addition of removeCandidatePair method
- w3c#192: Definition of candidate match algo
  - alternately, w3c/webrtc-pc#2906 to enforce RTCIceCandidate object
    equality
- w3c#193: Definition of candidate pair match algo
- w3c#194: Addition of CandidatePairs internal slot
sam-vi added a commit to sam-vi/webrtc-extensions that referenced this pull request Jan 12, 2024
This depends on several other PRs to be merged first:
- w3c#170: Addition of removeCandidatePair method
- w3c#192: Definition of candidate match algo
  - alternately, w3c/webrtc-pc#2906 to enforce RTCIceCandidate object
    equality
- w3c#193: Definition of candidate pair match algo
- w3c#194: Addition of CandidatePairs internal slot
sam-vi added a commit to sam-vi/webrtc-extensions that referenced this pull request Jan 12, 2024
Instead, there should be a requirement on the user agent to validate the
application's input.

This requirement is added by w3c#194.
sam-vi added a commit to sam-vi/webrtc-extensions that referenced this pull request Jan 12, 2024
This depends on several other PRs to be merged first:
- w3c#170: Addition of removeCandidatePair method
- w3c#192: Definition of candidate match algo
  - alternately, w3c/webrtc-pc#2906 to enforce RTCIceCandidate object
    equality
- w3c#193: Definition of candidate pair match algo
- w3c#194: Addition of CandidatePairs internal slot
@sam-vi sam-vi marked this pull request as ready for review January 12, 2024 13:43
Copy link
Collaborator

@henbos henbos left a comment

Choose a reason for hiding this comment

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

LGTM

index.html Show resolved Hide resolved
index.html Outdated
Comment on lines 750 to 757
Let |transport:RTCIceTransport| be the {{RTCIceTransport}} object associated with |candidatePair|.
</p>
</li>
<li>
<p>
[= list/Append =] |candidatePair| to {{RTCIceTransport/[[CandidatePairs]]}}.
</p>
</li>
Copy link
Member

@jan-ivar jan-ivar Jan 18, 2024

Choose a reason for hiding this comment

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

Github won't let me comment on the line directly above this section, which is:

<p>
  Let |candidatePair:RTCIceCandidatePair| be the candidate pair that was [= formed =].
</p>

While readers can hover over the candidatePair variable to learn its type, I think we need to spell out in prose what the type is now, since to a non-interactive reader candidatePair reads like an internal concept so far in this algorithm. We need to expound on its type before adding it to [[CandidatePairs]] since objects there need to be usable with the new match algorithm.

Also this appears to be the right place to instantiate candidate interfaces. Something like (updated):

<p>
  Let |candidatePair:RTCIceCandidatePair| be a new {{RTCIceCandidatePair}} dictionary
  with its {{RTCIceCandidatePair/local}} and {{RTCIceCandidatePair/remote}} members
  initialized to new {{RTCIceCandidate}}s representing the local and remote part of the
  [= formed =] pair respectively.
</p>

Copy link
Collaborator

Choose a reason for hiding this comment

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

To help Sameer make progress while OOO, I re-uploaded this PR as #197 with this comment addressed

Copy link
Member

@jan-ivar jan-ivar left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup. I'd like to specify some more invariants around this internal slot.

index.html Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
</li>
<li>
<p>
[= list/Remove =] all items that [= candidate pair match | match =] |candidatePair| from [=this=].{{RTCIceTransport/[[CandidatePairs]]}}.
</p>
</li>
<li>
Copy link
Member

@jan-ivar jan-ivar Jan 18, 2024

Choose a reason for hiding this comment

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

Also, do we need to clear [[CandidatePairs]] at some point during ICE restart?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good question, I filed #196 to decide if we need to add more steps or if this is already covered by the existing removal steps, including whether or not the onicecandidatepairremoved should fire?

henbos and others added 2 commits January 25, 2024 13:22
Co-authored-by: Jan-Ivar Bruaroey <jan-ivar@users.noreply.github.com>
Co-authored-by: Jan-Ivar Bruaroey <jan-ivar@users.noreply.github.com>
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
henbos and others added 2 commits January 25, 2024 13:24
Co-authored-by: Jan-Ivar Bruaroey <jan-ivar@users.noreply.github.com>
@alvestrand
Copy link
Collaborator

Merged as #197

@alvestrand alvestrand closed this Jan 25, 2024
@sam-vi sam-vi deleted the samvi-188-pairs-slot branch March 11, 2024 15: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.

Maintain an internal slot of candidate pairs that are valid inputs to RTCIceTransport operations
4 participants