-
Notifications
You must be signed in to change notification settings - Fork 40
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 candidate proto to webrtc interface conversion #386
Fix ice candidate proto to webrtc interface conversion #386
Conversation
@@ -30,6 +30,12 @@ module.exports = { | |||
'@typescript-eslint/no-explicit-any': 'warn', | |||
'@typescript-eslint/prefer-promise-reject-errors': 'warn', | |||
'unicorn/prefer-add-event-listener': 'warn', | |||
'@typescript-eslint/strict-boolean-expressions': [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turning this on with the exception of booleans feels very worth it to me. I've written numerous bugs due to how optionals are checked in a truthy/falsey way.
@@ -365,30 +366,30 @@ const iceCandidateFromProto = (i: ICECandidate) => { | |||
const candidate: RTCIceCandidateInit = { | |||
candidate: i.candidate, | |||
}; | |||
if (i.sdpMid) { | |||
if (i.sdpMid !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix. We we were excluding the right properties because some of them were falsey
@@ -242,8 +242,9 @@ export class SignalingExchange { | |||
try { | |||
await this.pc.addIceCandidate(cand); | |||
} catch (error) { | |||
console.log('error adding ice candidate', error); // eslint-disable-line no-console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will report an error if this ever happens again and bubble up to the reason of dial failure instead of undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not review code but I did try it in a deployed temp environment and it works! https://github.com/viamrobotics/app/pull/6514
No description provided.