Skip to content

Commit

Permalink
feat(consolidated-interstitial): add joinFlowVersion as ca event option
Browse files Browse the repository at this point in the history
  • Loading branch information
chburket committed Nov 19, 2024
1 parent d5445fe commit 550a229
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/@webex/internal-plugin-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"@webex/common": "workspace:*",
"@webex/common-timers": "workspace:*",
"@webex/event-dictionary-ts": "^1.0.1546",
"@webex/event-dictionary-ts": "^1.0.1594",
"@webex/internal-plugin-metrics": "workspace:*",
"@webex/test-helper-chai": "workspace:*",
"@webex/test-helper-mock-webex": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
globalMeetingId,
webexConferenceIdStr,
sessionCorrelationId,
joinFlowVersion,
} = options;

// @ts-ignore
Expand Down Expand Up @@ -718,6 +719,10 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
webexSubServiceType: this.getSubServiceType(meeting),
};

if (joinFlowVersion) {
clientEventObject.joinFlowVersion = joinFlowVersion;
}

return clientEventObject;
}

Expand Down
3 changes: 3 additions & 0 deletions packages/@webex/internal-plugin-metrics/src/metrics.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export type MetricEventVerb =
| 'warn'
| 'exit';

export type MetricEventJoinFlowVersion = 'Other' | 'NewFTE';

export type SubmitClientEventOptions = {
meetingId?: string;
mediaConnections?: any[];
Expand All @@ -123,6 +125,7 @@ export type SubmitClientEventOptions = {
browserLaunchMethod?: BrowserLaunchMethodType;
webexConferenceIdStr?: string;
globalMeetingId?: string;
joinFlowVersion?: MetricEventJoinFlowVersion;
};

export type SubmitMQEOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('internal-plugin-metrics', () => {
id: '3',
correlationId: 'correlationId3',
sessionCorrelationId: 'sessionCorrelationId3',
}
};

const fakeMeetings = {
1: fakeMeeting,
Expand Down Expand Up @@ -103,8 +103,8 @@ describe('internal-plugin-metrics', () => {
return '192.168.1.90';
}
},
}
}
},
};
},
},
geoHintInfo: {
Expand Down Expand Up @@ -1075,7 +1075,7 @@ describe('internal-plugin-metrics', () => {
correlationId: 'correlationId',
webexConferenceIdStr: 'webexConferenceIdStr1',
globalMeetingId: 'globalMeetingId1',
sessionCorrelationId: 'sessionCorrelationId1'
sessionCorrelationId: 'sessionCorrelationId1',
};

cd.submitClientEvent({
Expand Down Expand Up @@ -1169,7 +1169,7 @@ describe('internal-plugin-metrics', () => {
webexConferenceIdStr: 'webexConferenceIdStr1',
globalMeetingId: 'globalMeetingId1',
preLoginId: 'myPreLoginId',
sessionCorrelationId: 'sessionCorrelationId1'
sessionCorrelationId: 'sessionCorrelationId1',
};

cd.submitClientEvent({
Expand All @@ -1182,7 +1182,7 @@ describe('internal-plugin-metrics', () => {
webexConferenceIdStr: 'webexConferenceIdStr1',
globalMeetingId: 'globalMeetingId1',
preLoginId: 'myPreLoginId',
sessionCorrelationId: 'sessionCorrelationId1'
sessionCorrelationId: 'sessionCorrelationId1',
});

assert.notCalled(generateClientEventErrorPayloadSpy);
Expand Down Expand Up @@ -1293,7 +1293,7 @@ describe('internal-plugin-metrics', () => {
const options = {
meetingId: fakeMeeting2.id,
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
sessionCorrelationId: 'sessionCorrelationId1'
sessionCorrelationId: 'sessionCorrelationId1',
};

cd.submitClientEvent({
Expand Down Expand Up @@ -1462,7 +1462,7 @@ describe('internal-plugin-metrics', () => {
category: 'other',
errorCode: 9999,
errorData: {
errorName: 'Error'
errorName: 'Error',
},
serviceErrorCode: 9999,
errorDescription: 'UnknownError',
Expand Down Expand Up @@ -1536,7 +1536,7 @@ describe('internal-plugin-metrics', () => {
category: 'other',
errorCode: 9999,
errorData: {
errorName: 'Error'
errorName: 'Error',
},
serviceErrorCode: 9999,
errorDescription: 'UnknownError',
Expand Down Expand Up @@ -1785,7 +1785,7 @@ describe('internal-plugin-metrics', () => {
meetingId: fakeMeeting.id,
webexConferenceIdStr: 'webexConferenceIdStr1',
globalMeetingId: 'globalMeetingId1',
sessionCorrelationId: 'sessionCorrelationId1'
sessionCorrelationId: 'sessionCorrelationId1',
};

cd.submitMQE({
Expand Down Expand Up @@ -2251,7 +2251,7 @@ describe('internal-plugin-metrics', () => {
serviceErrorCode: 9999,
errorCode: 9999,
errorData: {
errorName: 'Error'
errorName: 'Error',
},
rawErrorMessage: 'bad times',
});
Expand Down Expand Up @@ -2757,6 +2757,25 @@ describe('internal-plugin-metrics', () => {
]);
});
});

it('includes expected joinFlowVersion', async () => {
const options = {
meetingId: fakeMeeting.id,
preLoginId: 'myPreLoginId',
joinFlowVersion: 'NewFTE',
};

const triggered = new Date();
const fetchOptions = await cd.buildClientEventFetchRequestOptions({
name: 'client.exit.app',
payload: {trigger: 'user-interaction', canProceed: false},
options,
});

expect(fetchOptions.body.metrics[0].eventPayload.event.joinFlowVersion).toBe(
options.joinFlowVersion
);
});
});

describe('#submitToCallDiagnosticsPreLogin', () => {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7618,17 +7618,17 @@ __metadata:
languageName: unknown
linkType: soft

"@webex/event-dictionary-ts@npm:^1.0.1546":
version: 1.0.1546
resolution: "@webex/event-dictionary-ts@npm:1.0.1546"
"@webex/event-dictionary-ts@npm:^1.0.1594":
version: 1.0.1594
resolution: "@webex/event-dictionary-ts@npm:1.0.1594"
dependencies:
amf-client-js: ^5.2.6
json-schema-to-typescript: ^12.0.0
minimist: ^1.2.8
ramldt2jsonschema: ^1.2.3
shelljs: ^0.8.5
webapi-parser: ^0.5.0
checksum: d938300584c5dcdeb5924a072c20aac85e9826c9631961e604c0e1dd577172f5d11a34c0b52dbb49f86386a80ecb842446a368172e5e64c273d06903f5843fa4
checksum: 814a1029031bc47b7579ff52aa6ca3bc83323246e81927df5c97d531d487709befb84d2f1d7a85f9deb6ce5148eff57ee2a1d219f4568371c2c0a8b12aa167ee
languageName: node
linkType: hard

Expand Down Expand Up @@ -8126,7 +8126,7 @@ __metadata:
"@webex/common": "workspace:*"
"@webex/common-timers": "workspace:*"
"@webex/eslint-config-legacy": "workspace:*"
"@webex/event-dictionary-ts": ^1.0.1546
"@webex/event-dictionary-ts": ^1.0.1594
"@webex/internal-plugin-metrics": "workspace:*"
"@webex/jest-config-legacy": "workspace:*"
"@webex/legacy-tools": "workspace:*"
Expand Down

0 comments on commit 550a229

Please sign in to comment.