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

Are various exposed RTCIceCandidate values object-comparable? #2906

Open
jan-ivar opened this issue Nov 7, 2023 · 0 comments
Open

Are various exposed RTCIceCandidate values object-comparable? #2906

jan-ivar opened this issue Nov 7, 2023 · 0 comments

Comments

@jan-ivar
Copy link
Member

jan-ivar commented Nov 7, 2023

Would you expect two calls of getLocalCandidates() to return the same objects? Two calls of getSelectedCandidatePair()?

iceTransport.getLocalCandidates()[0] == iceTransport.getLocalCandidates()[0] // true?
iceTransport.getSelectedCandidatePair().local == iceTransport.getSelectedCandidatePair().local; // true?

Probably. What about across the two?

iceTransport.getLocalCandidates().includes(iceTransport.getSelectedCandidatePair().local) // true?

Probably. What about the candidates exposed in events?

pc.onicecandidate = e => console.log(iceTransport.getLocalCandidates().includes(e.candidate)); // true?

Probably there too. This fiddle shows a mixed bag in Chrome, showing true in the first case, and false thereafter.

It's probably not too late to tighten this up, and get true for all of them. This will simplify w3c/webrtc-extensions#175.

Solution

Other than its constructor, the surface a candidate algorithm is the only place that creates an RTCIceCandidate:

image

The phrase "transport's set of candidates" looks it it should be a linkable concept, suggesting the intent here was to keep track of these objects. We should probably make this more explicit with an internal slot that the getters refer to.

sam-vi added a commit to sam-vi/webrtc-extensions that referenced this issue 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 issue 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 issue 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 issue 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
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

No branches or pull requests

1 participant