@webex/plugin-meetings 3.7.0-next.32 → 3.7.0-next.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,11 @@ declare class AnnotationChannel extends WebexPlugin implements IAnnotationChanne
36
36
  * @returns {undefined}
37
37
  */
38
38
  private listenToEvents;
39
+ /**
40
+ * Remove event listeners
41
+ * @returns {undefined}
42
+ */
43
+ deregisterEvents(): void;
39
44
  /**
40
45
  * set locusUrl
41
46
  * @param {string} locusUrl
@@ -458,7 +458,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
458
458
  }, _callee7);
459
459
  }))();
460
460
  },
461
- version: "3.7.0-next.32"
461
+ version: "3.7.0-next.33"
462
462
  });
463
463
  var _default = exports.default = Webinar;
464
464
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "@webex/eslint-config-legacy": "0.0.0",
44
44
  "@webex/jest-config-legacy": "0.0.0",
45
45
  "@webex/legacy-tools": "0.0.0",
46
- "@webex/plugin-meetings": "3.7.0-next.32",
46
+ "@webex/plugin-meetings": "3.7.0-next.33",
47
47
  "@webex/plugin-rooms": "3.7.0-next.14",
48
48
  "@webex/test-helper-chai": "3.7.0-next.9",
49
49
  "@webex/test-helper-mocha": "3.7.0-next.9",
@@ -71,7 +71,7 @@
71
71
  "@webex/internal-plugin-metrics": "3.7.0-next.9",
72
72
  "@webex/internal-plugin-support": "3.7.0-next.15",
73
73
  "@webex/internal-plugin-user": "3.7.0-next.9",
74
- "@webex/internal-plugin-voicea": "3.7.0-next.32",
74
+ "@webex/internal-plugin-voicea": "3.7.0-next.33",
75
75
  "@webex/media-helpers": "3.7.0-next.10",
76
76
  "@webex/plugin-people": "3.7.0-next.12",
77
77
  "@webex/plugin-rooms": "3.7.0-next.14",
@@ -92,5 +92,5 @@
92
92
  "//": [
93
93
  "TODO: upgrade jwt-decode when moving to node 18"
94
94
  ],
95
- "version": "3.7.0-next.32"
95
+ "version": "3.7.0-next.33"
96
96
  }
@@ -120,6 +120,22 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {
120
120
  }
121
121
  }
122
122
 
123
+ /**
124
+ * Remove event listeners
125
+ * @returns {undefined}
126
+ */
127
+ public deregisterEvents() {
128
+ if (this.hasSubscribedToEvents) {
129
+ // @ts-ignore
130
+ this.webex.internal.mercury.off('event:locus.approval_request', this.eventCommandProcessor);
131
+
132
+ // @ts-ignore
133
+ this.webex.internal.llm.off('event:relay.event', this.eventDataProcessor);
134
+
135
+ this.hasSubscribedToEvents = false;
136
+ }
137
+ }
138
+
123
139
  /**
124
140
  * set locusUrl
125
141
  * @param {string} locusUrl
@@ -5295,7 +5295,16 @@ export default class Meeting extends StatelessWebexPlugin {
5295
5295
  (this.config.receiveReactions || options.receiveReactions) &&
5296
5296
  this.isReactionsSupported()
5297
5297
  ) {
5298
- const {name} = this.members.membersCollection.get(e.data.sender.participantId);
5298
+ const member = this.members.membersCollection.get(e.data.sender.participantId);
5299
+ if (!member) {
5300
+ // @ts-ignore -- fix type
5301
+ LoggerProxy.logger.warn(
5302
+ `Meeting:index#processRelayEvent --> Skipping handling of ${REACTION_RELAY_TYPES.REACTION} for ${this.id}. participantId ${e.data.sender.participantId} does not exist in membersCollection.`
5303
+ );
5304
+ break;
5305
+ }
5306
+
5307
+ const {name} = member;
5299
5308
  const processedReaction: ProcessedReaction = {
5300
5309
  reaction: e.data.reaction,
5301
5310
  sender: {
@@ -5349,6 +5358,9 @@ export default class Meeting extends StatelessWebexPlugin {
5349
5358
  this.voiceaListenerCallbacks[VOICEAEVENTS.NEW_CAPTION]
5350
5359
  );
5351
5360
 
5361
+ // @ts-ignore
5362
+ this.webex.internal.voicea.deregisterEvents();
5363
+
5352
5364
  this.areVoiceaEventsSetup = false;
5353
5365
  this.triggerStopReceivingTranscriptionEvent();
5354
5366
  }
@@ -8699,6 +8711,11 @@ export default class Meeting extends StatelessWebexPlugin {
8699
8711
  this.stopTranscription();
8700
8712
  this.transcription = undefined;
8701
8713
  }
8714
+
8715
+ this.annotation.deregisterEvents();
8716
+
8717
+ // @ts-ignore - fix types
8718
+ this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
8702
8719
  };
8703
8720
 
8704
8721
  /**
@@ -413,6 +413,51 @@ describe('live-annotation', () => {
413
413
  });
414
414
  });
415
415
  });
416
- });
417
416
 
417
+ describe('#deregisterEvents', () => {
418
+ let llmOn;
419
+ let llmOff;
420
+ let mercuryOn;
421
+ let mercuryOff;
422
+
423
+ beforeEach(() => {
424
+ llmOn = sinon.spy(webex.internal.llm, 'on');
425
+ llmOff = sinon.spy(webex.internal.llm, 'off');
426
+ mercuryOn = sinon.spy(webex.internal.mercury, 'on');
427
+ mercuryOff = sinon.spy(webex.internal.mercury, 'off');
428
+ });
429
+
430
+ it('cleans up events', () => {
431
+ annotationService.locusUrlUpdate(locusUrl);
432
+ assert.calledWith(
433
+ mercuryOn,
434
+ 'event:locus.approval_request',
435
+ annotationService.eventCommandProcessor,
436
+ annotationService
437
+ );
438
+ assert.calledWith(
439
+ llmOn,
440
+ 'event:relay.event',
441
+ annotationService.eventDataProcessor,
442
+ annotationService
443
+ );
444
+ assert.match(annotationService.hasSubscribedToEvents, true);
445
+
446
+ annotationService.deregisterEvents();
447
+ assert.calledWith(llmOff, 'event:relay.event', annotationService.eventDataProcessor);
448
+ assert.calledWith(
449
+ mercuryOff,
450
+ 'event:locus.approval_request',
451
+ annotationService.eventCommandProcessor
452
+ );
453
+ assert.match(annotationService.hasSubscribedToEvents, false);
454
+ });
455
+
456
+ it('does not call llm off if events have not been registered', () => {
457
+ annotationService.deregisterEvents();
458
+ assert.notCalled(llmOff);
459
+ assert.notCalled(mercuryOff);
460
+ });
461
+ });
462
+ });
418
463
  });
@@ -1238,6 +1238,7 @@ describe('plugin-meetings', () => {
1238
1238
  webex.internal.voicea.off = sinon.stub();
1239
1239
  webex.internal.voicea.listenToEvents = sinon.stub();
1240
1240
  webex.internal.voicea.turnOnCaptions = sinon.stub();
1241
+ webex.internal.voicea.deregisterEvents = sinon.stub();
1241
1242
  });
1242
1243
 
1243
1244
  it('should stop listening to voicea events and also trigger a stop event', () => {
@@ -1566,6 +1567,55 @@ describe('plugin-meetings', () => {
1566
1567
  fakeProcessedReaction
1567
1568
  );
1568
1569
  });
1570
+
1571
+ it('should fail quietly if participantId does not exist in membersCollection', () => {
1572
+ LoggerProxy.logger.warn = sinon.stub();
1573
+ meeting.isReactionsSupported = sinon.stub().returns(true);
1574
+ meeting.config.receiveReactions = true;
1575
+ const fakeSendersName = 'Fake reactors name';
1576
+ const fakeReactionPayload = {
1577
+ type: 'fake_type',
1578
+ codepoints: 'fake_codepoints',
1579
+ shortcodes: 'fake_shortcodes',
1580
+ tone: {
1581
+ type: 'fake_tone_type',
1582
+ codepoints: 'fake_tone_codepoints',
1583
+ shortcodes: 'fake_tone_shortcodes',
1584
+ },
1585
+ };
1586
+ const fakeSenderPayload = {
1587
+ participantId: 'fake_participant_id',
1588
+ };
1589
+ const fakeProcessedReaction = {
1590
+ reaction: fakeReactionPayload,
1591
+ sender: {
1592
+ id: fakeSenderPayload.participantId,
1593
+ name: fakeSendersName,
1594
+ },
1595
+ };
1596
+ const fakeRelayEvent = {
1597
+ data: {
1598
+ relayType: REACTION_RELAY_TYPES.REACTION,
1599
+ reaction: fakeReactionPayload,
1600
+ sender: fakeSenderPayload,
1601
+ },
1602
+ };
1603
+ meeting.processRelayEvent(fakeRelayEvent);
1604
+ assert.calledWith(
1605
+ LoggerProxy.logger.warn,
1606
+ `Meeting:index#processRelayEvent --> Skipping handling of react for ${meeting.id}. participantId fake_participant_id does not exist in membersCollection.`
1607
+ );
1608
+ assert.neverCalledWith(
1609
+ TriggerProxy.trigger,
1610
+ sinon.match.instanceOf(Meeting),
1611
+ {
1612
+ file: 'meeting/index',
1613
+ function: 'join',
1614
+ },
1615
+ EVENT_TRIGGERS.MEETING_RECEIVE_REACTIONS,
1616
+ fakeProcessedReaction
1617
+ );
1618
+ });
1569
1619
  });
1570
1620
 
1571
1621
  describe('#handleLLMOnline', () => {
@@ -5055,6 +5105,11 @@ describe('plugin-meetings', () => {
5055
5105
  meeting.logger.error = sinon.stub().returns(true);
5056
5106
  meeting.updateLLMConnection = sinon.stub().returns(Promise.resolve());
5057
5107
  webex.internal.voicea.off = sinon.stub().returns(true);
5108
+ meeting.stopTranscription = sinon.stub();
5109
+ meeting.transcription = {};
5110
+
5111
+ meeting.annotation.deregisterEvents = sinon.stub();
5112
+ webex.internal.llm.off = sinon.stub();
5058
5113
 
5059
5114
  // A meeting needs to be joined to leave
5060
5115
  meeting.meetingState = 'ACTIVE';
@@ -5075,6 +5130,9 @@ describe('plugin-meetings', () => {
5075
5130
  assert.calledOnce(meeting.closePeerConnections);
5076
5131
  assert.calledOnce(meeting.unsetRemoteStreams);
5077
5132
  assert.calledOnce(meeting.unsetPeerConnections);
5133
+ assert.calledOnce(meeting.stopTranscription);
5134
+ assert.calledOnce(meeting.annotation.deregisterEvents);
5135
+ assert.calledWith(webex.internal.llm.off, 'event:relay.event', meeting.processRelayEvent);
5078
5136
  });
5079
5137
 
5080
5138
  it('should reset call diagnostic latencies correctly', async () => {
@@ -6957,6 +7015,9 @@ describe('plugin-meetings', () => {
6957
7015
  meeting.transcription = {};
6958
7016
  meeting.stopTranscription = sinon.stub();
6959
7017
 
7018
+ meeting.annotation.deregisterEvents = sinon.stub();
7019
+ webex.internal.llm.off = sinon.stub();
7020
+
6960
7021
  // A meeting needs to be joined to end
6961
7022
  meeting.meetingState = 'ACTIVE';
6962
7023
  meeting.state = 'JOINED';
@@ -6977,6 +7038,9 @@ describe('plugin-meetings', () => {
6977
7038
  assert.calledOnce(meeting?.unsetRemoteStreams);
6978
7039
  assert.calledOnce(meeting?.unsetPeerConnections);
6979
7040
  assert.calledOnce(meeting?.stopTranscription);
7041
+
7042
+ assert.called(meeting.annotation.deregisterEvents);
7043
+ assert.calledWith(webex.internal.llm.off, 'event:relay.event', meeting.processRelayEvent);
6980
7044
  });
6981
7045
  });
6982
7046