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(plugin-meetings): skip empty ice candidates for Firefox #4003

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@webex/plugin-meetings/src/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6323,7 +6323,7 @@ export default class Meeting extends StatelessWebexPlugin {
this.mediaProperties.webrtcMediaConnection.on(
MediaConnectionEventNames.ICE_CANDIDATE,
(event) => {
if (event.candidate) {
if (event.candidate && event.candidate.candidate && event.candidate.candidate.length > 0) {
this.iceCandidatesCount += 1;
}
}
Expand Down
50 changes: 30 additions & 20 deletions packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ import WebExMeetingsErrors from '../../../../src/common/errors/webex-meetings-er
import ParameterError from '../../../../src/common/errors/parameter';
import PasswordError from '../../../../src/common/errors/password-error';
import CaptchaError from '../../../../src/common/errors/captcha-error';
import PermissionError from '../../../../src/common/errors/permission';
import WebinarRegistrationError from '../../../../src/common/errors/webinar-registration-error';
import PermissionError from '../../../../src/common/errors/permission';
import WebinarRegistrationError from '../../../../src/common/errors/webinar-registration-error';
import IntentToJoinError from '../../../../src/common/errors/intent-to-join';
import testUtils from '../../../utils/testUtils';
import {
Expand Down Expand Up @@ -6290,14 +6290,22 @@ describe('plugin-meetings', () => {
meeting.attrs.meetingInfoProvider = {
fetchMeetingInfo: sinon
.stub()
.throws(new MeetingInfoV2WebinarRegistrationError(403021, FAKE_MEETING_INFO, 'a message')),
.throws(
new MeetingInfoV2WebinarRegistrationError(403021, FAKE_MEETING_INFO, 'a message')
),
};

await assert.isRejected(meeting.fetchMeetingInfo({sendCAevents: true}), WebinarRegistrationError);
await assert.isRejected(
meeting.fetchMeetingInfo({sendCAevents: true}),
WebinarRegistrationError
);

assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
assert.equal(meeting.meetingInfoFailureCode, 403021);
assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WEBINAR_REGISTRATION);
assert.equal(
meeting.meetingInfoFailureReason,
MEETING_INFO_FAILURE_REASON.WEBINAR_REGISTRATION
);
});
});

Expand Down Expand Up @@ -7761,11 +7769,17 @@ describe('plugin-meetings', () => {
});

it('should collect ice candidates', () => {
eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]({candidate: 'candidate'});
eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]({candidate: {candidate: 'candidate'}});

assert.equal(meeting.iceCandidatesCount, 1);
});

it('should not collect empty ice candidates', () => {
eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]({candidate: {candidate: ''}});

assert.equal(meeting.iceCandidatesCount, 0);
});

it('should not collect null ice candidates', () => {
eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]({candidate: null});

Expand Down Expand Up @@ -9160,7 +9174,6 @@ describe('plugin-meetings', () => {
webcastInstance: {
url: 'url',
},

},
};

Expand All @@ -9174,10 +9187,7 @@ describe('plugin-meetings', () => {
newLocusResources
);

assert.calledWith(
meeting.webinar.updateWebcastUrl,
newLocusResources
);
assert.calledWith(meeting.webinar.updateWebcastUrl, newLocusResources);

done();
});
Expand Down Expand Up @@ -12335,14 +12345,10 @@ describe('plugin-meetings', () => {
const testEmit = async (unmuteAllowed) => {
meeting.audio = {
handleServerLocalUnmuteRequired: sinon.stub(),
}
await meeting.locusInfo.emitScoped(
{},
LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUIRED,
{
unmuteAllowed,
}
);
};
await meeting.locusInfo.emitScoped({}, LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUIRED, {
unmuteAllowed,
});

assert.calledWith(
TriggerProxy.trigger,
Expand All @@ -12358,7 +12364,11 @@ describe('plugin-meetings', () => {
},
}
);
assert.calledOnceWithExactly(meeting.audio.handleServerLocalUnmuteRequired, meeting, unmuteAllowed)
assert.calledOnceWithExactly(
meeting.audio.handleServerLocalUnmuteRequired,
meeting,
unmuteAllowed
);
};

[true, false].forEach((unmuteAllowed) => {
Expand Down
Loading