Skip to content
Open
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
1 change: 1 addition & 0 deletions packages/@webex/webex-core/src/lib/metrics.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Metrics for service catalog
export default {
JS_SDK_SERVICE_NOT_FOUND: 'JS_SDK_SERVICE_NOT_FOUND',
SERVICE_V2_INITIALIZED: 'SERVICE_V2_INITIALIZED',
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Metrics for service catalog
export default {
JS_SDK_SERVICE_NOT_FOUND: 'JS_SDK_SERVICE_NOT_FOUND',
SERVICE_V2_INITIALIZED: 'SERVICE_V2_INITIALIZED',
};
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,12 @@ const Services = WebexPlugin.extend({
this.initServiceCatalogs()
.then(() => {
catalog.isReady = true;
this.webex.internal.metrics.submitClientMetrics(METRICS.SERVICE_V2_INITIALIZED, {
fields: {
type: 'operational',
initialized_status: 'succeeded',
},
});
})
.catch((error) => {
this.initFailed = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,21 @@ describe('webex-core', () => {
access_token: 'token',
},
};
webex.internal.metrics.submitClientMetrics = sinon.stub();

services.initialize();

// call the onReady callback
services.listenToOnce.getCall(1).args[2]();
await waitForAsync();

assert.isFalse(services.initFailed);

});

it('initFailed is false when initialization succeeds no credentials are available', async () => {
services.listenToOnce = sinon.stub();
services.collectPreauthCatalog = sinon.stub().returns(Promise.resolve());

services.initialize();

// call the onReady callback
Expand Down
Loading