@webex/internal-plugin-metrics 3.5.0-next.1 → 3.5.0-next.11

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.
Files changed (47) hide show
  1. package/dist/business-metrics.js +119 -9
  2. package/dist/business-metrics.js.map +1 -1
  3. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +1 -1
  4. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
  5. package/dist/call-diagnostic/call-diagnostic-metrics.js +15 -9
  6. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
  7. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +7 -2
  8. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
  9. package/dist/call-diagnostic/config.js +13 -3
  10. package/dist/call-diagnostic/config.js.map +1 -1
  11. package/dist/index.js +7 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/metrics.js +1 -1
  14. package/dist/metrics.types.js.map +1 -1
  15. package/dist/new-metrics.js +5 -2
  16. package/dist/new-metrics.js.map +1 -1
  17. package/dist/rtcMetrics/constants.js +11 -0
  18. package/dist/rtcMetrics/constants.js.map +1 -0
  19. package/dist/rtcMetrics/index.js +202 -0
  20. package/dist/rtcMetrics/index.js.map +1 -0
  21. package/dist/types/business-metrics.d.ts +36 -4
  22. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +6 -1
  23. package/dist/types/call-diagnostic/config.d.ts +3 -0
  24. package/dist/types/index.d.ts +2 -1
  25. package/dist/types/metrics.types.d.ts +1 -0
  26. package/dist/types/new-metrics.d.ts +5 -3
  27. package/dist/types/rtcMetrics/constants.d.ts +4 -0
  28. package/dist/types/rtcMetrics/index.d.ts +71 -0
  29. package/package.json +11 -11
  30. package/src/business-metrics.ts +97 -5
  31. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +1 -1
  32. package/src/call-diagnostic/call-diagnostic-metrics.ts +13 -9
  33. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +11 -5
  34. package/src/call-diagnostic/config.ts +12 -0
  35. package/src/index.ts +2 -0
  36. package/src/metrics.types.ts +2 -0
  37. package/src/new-metrics.ts +12 -2
  38. package/src/rtcMetrics/constants.ts +3 -0
  39. package/src/rtcMetrics/index.ts +186 -0
  40. package/test/unit/spec/business/business-metrics.ts +69 -2
  41. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +2 -1
  42. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +4 -6
  43. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +275 -34
  44. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +7 -3
  45. package/test/unit/spec/new-metrics.ts +18 -3
  46. package/test/unit/spec/prelogin-metrics-batcher.ts +3 -1
  47. package/test/unit/spec/rtcMetrics/index.ts +155 -0
@@ -139,7 +139,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
139
139
  getIsConvergedArchitectureEnabled({meetingId}: {meetingId?: string}): boolean {
140
140
  if (meetingId) {
141
141
  // @ts-ignore
142
- const meeting = this.webex.meetings.meetingCollection.get(meetingId);
142
+ const meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);
143
143
 
144
144
  return meeting?.meetingInfo?.enableConvergedArchitecture;
145
145
  }
@@ -245,7 +245,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
245
245
 
246
246
  if (meetingId) {
247
247
  // @ts-ignore
248
- const meeting = this.webex.meetings.meetingCollection.get(meetingId);
248
+ const meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);
249
249
  if (meeting?.environment) {
250
250
  origin.environment = meeting.environment;
251
251
  }
@@ -289,13 +289,14 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
289
289
  sessionCorrelationId,
290
290
  } = options;
291
291
  const identifiers: Event['event']['identifiers'] = {
292
- correlationId: 'unknown',
293
- sessionCorrelationId: 'unknown',
292
+ correlationId: 'unknown', // concerned with setting this to unknown. This will fail diagnostic events parsing because it's not a uuid pattern
294
293
  };
295
294
 
296
295
  if (meeting) {
297
296
  identifiers.correlationId = meeting.correlationId;
298
- identifiers.sessionCorrelationId = meeting.sessionCorrelationId;
297
+ if (meeting.sessionCorrelationId) {
298
+ identifiers.sessionCorrelationId = meeting.sessionCorrelationId;
299
+ }
299
300
  }
300
301
 
301
302
  if (sessionCorrelationId) {
@@ -306,6 +307,8 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
306
307
  identifiers.correlationId = correlationId;
307
308
  }
308
309
 
310
+ // TODO: should we use patterns.uuid to validate correlationId and session correlation id? they will fail the diagnostic events validation pipeline if improperly formatted
311
+
309
312
  if (this.device) {
310
313
  const {device} = this;
311
314
  const {installationId} = device?.config || {};
@@ -427,7 +430,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
427
430
  // events that will most likely happen in join phase
428
431
  if (meetingId) {
429
432
  // @ts-ignore
430
- const meeting = this.webex.meetings.meetingCollection.get(meetingId);
433
+ const meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);
431
434
 
432
435
  if (!meeting) {
433
436
  console.warn(
@@ -628,10 +631,11 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
628
631
  });
629
632
  }
630
633
 
631
- // otherwise return unkown error
634
+ // otherwise return unkown error but passing serviceErrorCode and serviceErrorName so that we know the issue
632
635
  return this.getErrorPayloadForClientErrorCode({
633
636
  clientErrorCode: UNKNOWN_ERROR,
634
- serviceErrorCode: UNKNOWN_ERROR,
637
+ serviceErrorCode: serviceErrorCode || UNKNOWN_ERROR,
638
+ serviceErrorName: rawError?.name,
635
639
  payloadOverrides: rawError.payloadOverrides,
636
640
  rawErrorMessage,
637
641
  httpStatusCode,
@@ -663,7 +667,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
663
667
  } = options;
664
668
 
665
669
  // @ts-ignore
666
- const meeting = this.webex.meetings.meetingCollection.get(meetingId);
670
+ const meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);
667
671
 
668
672
  if (!meeting) {
669
673
  console.warn(
@@ -231,13 +231,19 @@ export const getBuildType = (
231
231
  * @returns {Object} prepared item
232
232
  */
233
233
  export const prepareDiagnosticMetricItem = (webex: any, item: any) => {
234
+ const buildType = getBuildType(
235
+ webex,
236
+ item.eventPayload?.event?.eventData?.webClientDomain,
237
+ item.eventPayload?.event?.eventData?.markAsTestEvent
238
+ );
239
+
240
+ // Set upgradeChannel to 'gold' if buildType is 'prod', otherwise to the buildType value
241
+ const upgradeChannel = buildType === 'prod' ? 'gold' : buildType;
242
+
234
243
  const origin: Partial<Event['origin']> = {
235
- buildType: getBuildType(
236
- webex,
237
- item.eventPayload?.event?.eventData?.webClientDomain,
238
- item.eventPayload?.event?.eventData?.markAsTestEvent
239
- ),
244
+ buildType,
240
245
  networkType: 'unknown',
246
+ upgradeChannel,
241
247
  };
242
248
 
243
249
  // check event names and append latencies?
@@ -129,6 +129,7 @@ export const ERROR_DESCRIPTIONS = {
129
129
  ICE_AND_REACHABILITY_FAILED: 'ICEAndReachabilityFailed',
130
130
  SDP_OFFER_CREATION_ERROR: 'SdpOfferCreationError',
131
131
  SDP_OFFER_CREATION_ERROR_MISSING_CODEC: 'SdpOfferCreationErrorMissingCodec',
132
+ WDM_RESTRICTED_REGION: 'WdmRestrictedRegion',
132
133
  };
133
134
 
134
135
  export const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP = {
@@ -288,6 +289,12 @@ export const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP = {
288
289
  100005: 4103, // Depracated because of an issue in the UCF Clients
289
290
  // If both email-hash and domain-hash are null or undefined.
290
291
  100004: 4103,
292
+
293
+ // ---- WDM ----
294
+ // WDM_BLOCKED_ACCESS_BY_COUNTRY_CODE_BANNED_COUNTRY_ERROR_CODE
295
+ 4404002: 13000,
296
+ // WDM_BLOCKED_ACCESS_BY_COUNTRY_CODE_RESTRICTED_COUNTRY_ERROR_CODE
297
+ 4404003: 13000,
291
298
  };
292
299
 
293
300
  export const CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD: Record<number, Partial<ClientEventError>> = {
@@ -687,6 +694,11 @@ export const CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD: Record<number, Partial<ClientEv
687
694
  category: 'expected',
688
695
  fatal: true,
689
696
  },
697
+ 13000: {
698
+ errorDescription: ERROR_DESCRIPTIONS.WDM_RESTRICTED_REGION,
699
+ category: 'expected',
700
+ fatal: true,
701
+ },
690
702
  };
691
703
 
692
704
  export const CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND = 'js_sdk_call_diagnostic_event_failed_to_send';
package/src/index.ts CHANGED
@@ -25,6 +25,7 @@ import CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-l
25
25
  import BehavioralMetrics from './behavioral-metrics';
26
26
  import OperationalMetrics from './operational-metrics';
27
27
  import BusinessMetrics from './business-metrics';
28
+ import RtcMetrics from './rtcMetrics';
28
29
 
29
30
  registerInternalPlugin('metrics', Metrics, {
30
31
  config,
@@ -47,6 +48,7 @@ export {
47
48
  BehavioralMetrics,
48
49
  OperationalMetrics,
49
50
  BusinessMetrics,
51
+ RtcMetrics,
50
52
  };
51
53
  export type {
52
54
  ClientEvent,
@@ -115,6 +115,8 @@ export interface DeviceContext {
115
115
 
116
116
  export type MetricType = 'behavioral' | 'operational' | 'business';
117
117
 
118
+ export type Table = 'wbxapp_callend_metrics' | 'business_metrics' | 'business_ucf' | 'default';
119
+
118
120
  type InternalEventPayload = string | number | boolean;
119
121
  export type EventPayload = Record<string, InternalEventPayload>;
120
122
  export type BehavioralEventPayload = EventPayload; // for compatibilty, can be remove after wxcc-desktop did change their imports.
@@ -21,6 +21,7 @@ import {
21
21
  MediaQualityEvent,
22
22
  InternalEvent,
23
23
  SubmitClientEventOptions,
24
+ Table,
24
25
  } from './metrics.types';
25
26
  import CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';
26
27
  import {setMetricTimings} from './call-diagnostic/call-diagnostic-metrics.util';
@@ -28,6 +29,7 @@ import {generateCommonErrorMetadata} from './utils';
28
29
 
29
30
  /**
30
31
  * Metrics plugin to centralize all types of metrics.
32
+ * https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?pageId=231011379
31
33
  * @class
32
34
  */
33
35
  class Metrics extends WebexPlugin {
@@ -201,7 +203,15 @@ class Metrics extends WebexPlugin {
201
203
  * Buisness event
202
204
  * @param args
203
205
  */
204
- submitBusinessEvent({name, payload}: {name: string; payload: EventPayload}) {
206
+ submitBusinessEvent({
207
+ name,
208
+ payload,
209
+ table,
210
+ }: {
211
+ name: string;
212
+ payload: EventPayload;
213
+ table?: Table;
214
+ }) {
205
215
  if (!this.isReady) {
206
216
  // @ts-ignore
207
217
  this.webex.logger.log(
@@ -213,7 +223,7 @@ class Metrics extends WebexPlugin {
213
223
 
214
224
  this.lazyBuildBusinessMetrics();
215
225
 
216
- return this.businessMetrics.submitBusinessEvent({name, payload});
226
+ return this.businessMetrics.submitBusinessEvent({name, payload, table});
217
227
  }
218
228
 
219
229
  /**
@@ -0,0 +1,3 @@
1
+ const RTC_METRICS = {APP_ID: 'FFB51ED5-4319-4C55-8303-B1F2FCCDE231'};
2
+
3
+ export {RTC_METRICS as default};
@@ -0,0 +1,186 @@
1
+ /* eslint-disable class-methods-use-this */
2
+ import uuid from 'uuid';
3
+ import * as CallDiagnosticUtils from '../call-diagnostic/call-diagnostic-metrics.util';
4
+ import RTC_METRICS from './constants';
5
+
6
+ const parseJsonPayload = (payload: any[]): any | null => {
7
+ try {
8
+ if (payload && payload[0]) {
9
+ return JSON.parse(payload[0]);
10
+ }
11
+
12
+ return null;
13
+ } catch (_) {
14
+ return null;
15
+ }
16
+ };
17
+
18
+ /**
19
+ * Rtc Metrics
20
+ */
21
+ export default class RtcMetrics {
22
+ /**
23
+ * Array of MetricData items to be sent to the metrics service.
24
+ */
25
+ metricsQueue = [];
26
+
27
+ intervalId: number;
28
+
29
+ webex: any;
30
+
31
+ meetingId: string;
32
+
33
+ correlationId: string;
34
+
35
+ connectionId: string;
36
+
37
+ shouldSendMetricsOnNextStatsReport: boolean;
38
+
39
+ /**
40
+ * Initialize the interval.
41
+ *
42
+ * @param {object} webex - The main `webex` object.
43
+ * @param {string} meetingId - The meeting id.
44
+ * @param {string} correlationId - The correlation id.
45
+ */
46
+ constructor(webex, meetingId, correlationId) {
47
+ // `window` is used to prevent typescript from returning a NodeJS.Timer.
48
+ this.intervalId = window.setInterval(this.sendMetricsInQueue.bind(this), 30 * 1000);
49
+ this.meetingId = meetingId;
50
+ this.webex = webex;
51
+ this.correlationId = correlationId;
52
+ this.resetConnection();
53
+ }
54
+
55
+ /**
56
+ * Check to see if the metrics queue has any items.
57
+ *
58
+ * @returns {void}
59
+ */
60
+ public sendMetricsInQueue() {
61
+ if (this.metricsQueue.length) {
62
+ this.sendMetrics();
63
+ this.metricsQueue = [];
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Forces sending metrics when we get the next stats-report
69
+ *
70
+ * This is useful for cases when something important happens that affects the media connection,
71
+ * for example when we move from lobby into the meeting.
72
+ *
73
+ * @returns {void}
74
+ */
75
+ public sendNextMetrics() {
76
+ this.shouldSendMetricsOnNextStatsReport = true;
77
+ }
78
+
79
+ /**
80
+ * Add metrics items to the metrics queue.
81
+ *
82
+ * @param {object} data - An object with a payload array of metrics items.
83
+ *
84
+ * @returns {void}
85
+ */
86
+ addMetrics(data) {
87
+ if (data.payload.length) {
88
+ if (data.name === 'stats-report') {
89
+ data.payload = data.payload.map(this.anonymizeIp);
90
+ }
91
+
92
+ this.metricsQueue.push(data);
93
+
94
+ if (this.shouldSendMetricsOnNextStatsReport && data.name === 'stats-report') {
95
+ // this is the first useful set of data (WCME gives it to us after 5s), send it out immediately
96
+ // in case the user is unhappy and closes the browser early
97
+ this.sendMetricsInQueue();
98
+ this.shouldSendMetricsOnNextStatsReport = false;
99
+ }
100
+
101
+ try {
102
+ // If a connection fails, send the rest of the metrics in queue and get a new connection id.
103
+ const parsedPayload = parseJsonPayload(data.payload);
104
+ if (
105
+ data.name === 'onconnectionstatechange' &&
106
+ parsedPayload &&
107
+ parsedPayload.value === 'failed'
108
+ ) {
109
+ this.sendMetricsInQueue();
110
+ this.resetConnection();
111
+ }
112
+ } catch (e) {
113
+ console.error(e);
114
+ }
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Clear the metrics interval.
120
+ *
121
+ * @returns {void}
122
+ */
123
+ closeMetrics() {
124
+ this.sendMetricsInQueue();
125
+ clearInterval(this.intervalId);
126
+ }
127
+
128
+ /**
129
+ * Anonymize IP addresses.
130
+ *
131
+ * @param {array} stats - An RTCStatsReport organized into an array of strings.
132
+ * @returns {string}
133
+ */
134
+ anonymizeIp(stats: string): string {
135
+ const data = JSON.parse(stats);
136
+ // on local and remote candidates, anonymize the last 4 bits.
137
+ if (data.type === 'local-candidate' || data.type === 'remote-candidate') {
138
+ data.ip = CallDiagnosticUtils.anonymizeIPAddress(data.ip) || undefined;
139
+ data.address = CallDiagnosticUtils.anonymizeIPAddress(data.address) || undefined;
140
+ data.relatedAddress =
141
+ CallDiagnosticUtils.anonymizeIPAddress(data.relatedAddress) || undefined;
142
+ }
143
+
144
+ return JSON.stringify(data);
145
+ }
146
+
147
+ /**
148
+ * Set a new connection id.
149
+ *
150
+ * @returns {void}
151
+ */
152
+ private resetConnection() {
153
+ this.connectionId = uuid.v4();
154
+ this.shouldSendMetricsOnNextStatsReport = true;
155
+ }
156
+
157
+ /**
158
+ * Send metrics to the metrics service.
159
+ *
160
+ * @returns {void}
161
+ */
162
+ private sendMetrics() {
163
+ this.webex.request({
164
+ method: 'POST',
165
+ service: 'unifiedTelemetry',
166
+ resource: 'metric/v2',
167
+ headers: {
168
+ type: 'webrtcMedia',
169
+ appId: RTC_METRICS.APP_ID,
170
+ },
171
+ body: {
172
+ metrics: [
173
+ {
174
+ type: 'webrtc',
175
+ version: '1.1.0',
176
+ userId: this.webex.internal.device.userId,
177
+ meetingId: this.meetingId,
178
+ correlationId: this.correlationId,
179
+ connectionId: this.connectionId,
180
+ data: this.metricsQueue,
181
+ },
182
+ ],
183
+ },
184
+ });
185
+ }
186
+ }
@@ -20,6 +20,8 @@ describe('internal-plugin-metrics', () => {
20
20
 
21
21
  beforeEach(() => {
22
22
  now = new Date();
23
+ sinon.createSandbox();
24
+ sinon.useFakeTimers(now.getTime());
23
25
 
24
26
  webex = {
25
27
  canAuthorize: true,
@@ -74,7 +76,7 @@ describe('internal-plugin-metrics', () => {
74
76
  });
75
77
 
76
78
  describe('#sendEvent', () => {
77
- it('should send correctly shaped business event (check name building and internal tagged event building)', () => {
79
+ it('should send correctly shaped business event (check name building and internal tagged event building) and default correctly', () => {
78
80
  // For some reasons `jest` isn't available when testing form build server - so can't use `jest.fn()` here...
79
81
  const requestCalls = [];
80
82
  const request = function(arg) { requestCalls.push(arg) }
@@ -86,6 +88,7 @@ describe('internal-plugin-metrics', () => {
86
88
  assert.equal(requestCalls.length, 1)
87
89
  assert.deepEqual(requestCalls[0], {
88
90
  eventPayload: {
91
+ appType: 'Web Client',
89
92
  context: {
90
93
  app: {version: 'webex-version'},
91
94
  device: {id: 'deviceId'},
@@ -113,8 +116,72 @@ describe('internal-plugin-metrics', () => {
113
116
  },
114
117
  type: ['business'],
115
118
  });
116
- assert.isNumber(requestCalls[0].eventPayload.client_timestamp)
119
+ assert.isString(requestCalls[0].eventPayload.client_timestamp)
120
+ assert.equal(requestCalls[0].eventPayload.client_timestamp, now.toISOString())
117
121
  })
122
+
123
+ describe('when table is provided', () => {
124
+ it('should send correctly shaped business event with table: wbx_app_callend_metrics and ignore the key name', () => {
125
+ // For some reasons `jest` isn't available when testing form build server - so can't use `jest.fn()` here...
126
+ const requestCalls = [];
127
+ const request = function(arg) { requestCalls.push(arg) }
128
+
129
+ businessMetrics.clientMetricsBatcher.request = request;
130
+
131
+ assert.equal(requestCalls.length, 0)
132
+ businessMetrics.submitBusinessEvent({ name: "foobar", payload: {bar:"gee"}, table: 'wbxapp_callend_metrics' })
133
+ assert.equal(requestCalls.length, 1)
134
+ assert.deepEqual(requestCalls[0], {
135
+ eventPayload: {
136
+ key: 'callEnd',
137
+ client_timestamp: requestCalls[0].eventPayload.client_timestamp, // This is to bypass time check, which is checked below.
138
+ appType: 'Web Client',
139
+ value: {
140
+ bar: 'gee'
141
+ }
142
+ },
143
+ type: ['business'],
144
+ });
145
+ assert.isString(requestCalls[0].eventPayload.client_timestamp)
146
+ assert.equal(requestCalls[0].eventPayload.client_timestamp, now.toISOString())
147
+ });
148
+
149
+ it('should send correctly shaped business event with table: business_metrics', () => {
150
+ // For some reasons `jest` isn't available when testing form build server - so can't use `jest.fn()` here...
151
+ const requestCalls = [];
152
+ const request = function(arg) { requestCalls.push(arg) }
153
+
154
+ businessMetrics.clientMetricsBatcher.request = request;
155
+
156
+ assert.equal(requestCalls.length, 0)
157
+ businessMetrics.submitBusinessEvent({ name: "foobar", payload: {bar:"gee"}, table: 'business_metrics' })
158
+ assert.equal(requestCalls.length, 1)
159
+ assert.deepEqual(requestCalls[0], {
160
+ eventPayload: {
161
+ key: 'foobar',
162
+ appType: 'Web Client',
163
+ client_timestamp: requestCalls[0].eventPayload.client_timestamp, // This is to bypass time check, which is checked below.
164
+ value: {
165
+ bar: "gee",
166
+ browser: getBrowserName(),
167
+ browserHeight: window.innerHeight,
168
+ browserVersion: getBrowserVersion(),
169
+ browserWidth: window.innerWidth,
170
+ domain: window.location.hostname,
171
+ inIframe: false,
172
+ locale: window.navigator.language,
173
+ os: getOSNameInternal(),
174
+ app: {version: 'webex-version'},
175
+ device: {id: 'deviceId'},
176
+ locale: 'language',
177
+ }
178
+ },
179
+ type: ['business'],
180
+ });
181
+ assert.isString(requestCalls[0].eventPayload.client_timestamp)
182
+ assert.equal(requestCalls[0].eventPayload.client_timestamp, now.toISOString())
183
+ });
184
+ });
118
185
  })
119
186
  });
120
187
  });
@@ -441,7 +441,7 @@ describe('plugin-metrics', () => {
441
441
  // item also gets assigned a delay property but the key is a Symbol and haven't been able to test that..
442
442
  assert.deepEqual(calls.args[0].eventPayload, {
443
443
  event: 'my.event',
444
- origin: {buildType: 'test', networkType: 'unknown'},
444
+ origin: {buildType: 'test', networkType: 'unknown', upgradeChannel: 'test'},
445
445
  });
446
446
 
447
447
  assert.deepEqual(calls.args[0].type, ['diagnostic-event']);
@@ -455,6 +455,7 @@ describe('plugin-metrics', () => {
455
455
  origin: {
456
456
  buildType: 'test',
457
457
  networkType: 'unknown',
458
+ upgradeChannel: 'test',
458
459
  },
459
460
  });
460
461
  assert.deepEqual(prepareDiagnosticMetricItemCalls[0].args[1].type, ['diagnostic-event']);
@@ -12,12 +12,10 @@ describe('internal-plugin-metrics', () => {
12
12
  sinon.useFakeTimers(now.getTime());
13
13
  const webex = {
14
14
  meetings: {
15
- meetingCollection: {
16
- get: (id: string) => {
17
- if (id === 'meeting-id') {
18
- return {id: 'meeting-id', allowMediaInLobby: true};
19
- }
20
- },
15
+ getBasicMeetingInformation: (id: string) => {
16
+ if (id === 'meeting-id') {
17
+ return {id: 'meeting-id', allowMediaInLobby: true};
18
+ }
21
19
  },
22
20
  },
23
21
  };