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

Fix ICE end-of-candidates messages #2622

Merged
merged 3 commits into from
Aug 26, 2022

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Aug 25, 2022

We were casting a POJO to an RTCIceCandidate for the dummy
end-of-candidates candidate, but #2473
started calling .toJSON() on these objects.

Store separately whether we've seen the end of candidates rather than
adding on a dummy candidate object.

A test for this will follow, but a) I want to get this fix out and
b) I'm currently rewriting the call test file to add typing.

Fixes element-hq/element-call#553

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

This change is marked as an internal change (Task), so will not be included in the changelog.

We were casting a POJO to an RTCIceCandidate for the dummy
end-of-candidates candidate, but #2473
started calling .toJSON() on these objects.

Store separately whether we've seen the end of candidates rather than
adding on a dummy candidate object.

A test for this will follow, but a) I want to get this fix out and
b) I'm currently rewriting the call test file to add typing.

Fixes element-hq/element-call#553
@dbkr dbkr added the T-Task Tasks for the team like planning label Aug 25, 2022
@dbkr dbkr requested a review from a team as a code owner August 25, 2022 17:21
src/webrtc/call.ts Outdated Show resolved Hide resolved
src/webrtc/call.ts Outdated Show resolved Hide resolved
* @param content The candidate to queue up, or null if candidates have finished being generated
* and end-of-candidates should be signalled
*/
private queueCandidate(content: RTCIceCandidate | null): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we could avoid the step with null and set candidatesEnded right at the start?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure what you mean here - at the start of what?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking we would set candidatesEnded = true right after receiving the last candidate and avoid calling queueCandidate() with null though since that might require a bit more work (if even possible) and you're on holiday, we can go with this as is

Copy link
Member Author

Choose a reason for hiding this comment

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

oh I see - we need to schedule it to be sent too though, so this seemed the easiest way of re-using that code.

@dbkr dbkr merged commit 965f4fb into robertlong/group-call Aug 26, 2022
@dbkr dbkr deleted the dbkr/fix_ice_end_of_candidates branch August 26, 2022 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants