diff --git a/packages/@webex/plugin-meetings/src/meeting/index.ts b/packages/@webex/plugin-meetings/src/meeting/index.ts index a1cd18ad353..edff3f1de51 100644 --- a/packages/@webex/plugin-meetings/src/meeting/index.ts +++ b/packages/@webex/plugin-meetings/src/meeting/index.ts @@ -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; } } diff --git a/packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js b/packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js index 78d5fb58bc9..a94ea8b5737 100644 --- a/packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js +++ b/packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js @@ -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 { @@ -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 + ); }); }); @@ -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}); @@ -9160,7 +9174,6 @@ describe('plugin-meetings', () => { webcastInstance: { url: 'url', }, - }, }; @@ -9174,10 +9187,7 @@ describe('plugin-meetings', () => { newLocusResources ); - assert.calledWith( - meeting.webinar.updateWebcastUrl, - newLocusResources - ); + assert.calledWith(meeting.webinar.updateWebcastUrl, newLocusResources); done(); }); @@ -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, @@ -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) => {