Skip to content

Conversation

edaniels
Copy link
Contributor

No description provided.

@edaniels edaniels requested a review from a team as a code owner October 10, 2024 21:25
@edaniels edaniels requested review from njooma and lia-viam October 10, 2024 21:25
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/prefer-promise-reject-errors': 'warn',
'unicorn/prefer-add-event-listener': 'warn',
'@typescript-eslint/strict-boolean-expressions': [
Copy link
Contributor Author

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.

candidate: i.candidate,
};
if (i.sdpMid) {
if (i.sdpMid !== undefined) {
Copy link
Contributor Author

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

try {
await this.pc.addIceCandidate(cand);
} catch (error) {
console.log('error adding ice candidate', error); // eslint-disable-line no-console
Copy link
Contributor Author

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.

Copy link
Contributor

@ethanlookpotts ethanlookpotts left a 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

@edaniels edaniels merged commit 1449855 into viamrobotics:main Oct 11, 2024
3 checks passed
@edaniels edaniels deleted the fix_ice_cand_proto_to_wrtc branch October 11, 2024 18:15
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.

3 participants