@webex/webex-core 3.12.0-next.33 → 3.12.0-next.34
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.
- package/dist/lib/batcher.js +1 -1
- package/dist/lib/credentials/credentials.js +1 -1
- package/dist/lib/credentials/token.js +1 -1
- package/dist/lib/services/services.js +6 -6
- package/dist/lib/services/services.js.map +1 -1
- package/dist/lib/services-v2/services-v2.js +6 -6
- package/dist/lib/services-v2/services-v2.js.map +1 -1
- package/dist/plugins/logger.js +1 -1
- package/dist/webex-core.js +2 -2
- package/package.json +3 -3
- package/src/lib/services/services.js +8 -4
- package/src/lib/services-v2/services-v2.ts +7 -4
|
@@ -1528,10 +1528,11 @@ const Services = WebexPlugin.extend({
|
|
|
1528
1528
|
|
|
1529
1529
|
// Race init against a hard timeout so a hung request never leaves
|
|
1530
1530
|
// `services.ready` false forever - that would stall `webex.ready` and
|
|
1531
|
-
// leave
|
|
1531
|
+
// leave consumers waiting on it indefinitely. Timeout is configurable via
|
|
1532
1532
|
// `config.services.catalogInitTimeout` (defaults to 15s in config).
|
|
1533
1533
|
const initTimeoutMs = this.webex.config?.services?.catalogInitTimeout;
|
|
1534
|
-
|
|
1534
|
+
|
|
1535
|
+
const initServiceCatalogsTimeout = new Promise((_, reject) => {
|
|
1535
1536
|
setTimeout(
|
|
1536
1537
|
() => reject(new Error(`services: init timed out after ${initTimeoutMs}ms`)),
|
|
1537
1538
|
initTimeoutMs
|
|
@@ -1543,7 +1544,7 @@ const Services = WebexPlugin.extend({
|
|
|
1543
1544
|
// `initServiceCatalogs` marks the catalog ready internally once the
|
|
1544
1545
|
// postauth catalog is collected - even if it loses the timeout race
|
|
1545
1546
|
// above, so a slow fetch still eventually flips `catalog.isReady`.
|
|
1546
|
-
Promise.race([this.initServiceCatalogs(),
|
|
1547
|
+
Promise.race([this.initServiceCatalogs(), initServiceCatalogsTimeout])
|
|
1547
1548
|
.catch((error) => {
|
|
1548
1549
|
this.initFailed = true;
|
|
1549
1550
|
this.logger.error(
|
|
@@ -1554,7 +1555,10 @@ const Services = WebexPlugin.extend({
|
|
|
1554
1555
|
} else {
|
|
1555
1556
|
const {email} = this.webex.config;
|
|
1556
1557
|
|
|
1557
|
-
Promise.race([
|
|
1558
|
+
Promise.race([
|
|
1559
|
+
this.collectPreauthCatalog(email ? {email} : undefined),
|
|
1560
|
+
initServiceCatalogsTimeout,
|
|
1561
|
+
])
|
|
1558
1562
|
.catch((error) => {
|
|
1559
1563
|
this.initFailed = true;
|
|
1560
1564
|
this.logger.error(
|
|
@@ -1487,10 +1487,10 @@ const Services = WebexPlugin.extend({
|
|
|
1487
1487
|
|
|
1488
1488
|
// Race init against a hard timeout so a hung request never leaves
|
|
1489
1489
|
// `services.ready` false forever - that would stall `webex.ready` and
|
|
1490
|
-
// leave
|
|
1490
|
+
// leave consumers waiting on it indefinitely. Timeout is configurable via
|
|
1491
1491
|
// `config.services.catalogInitTimeout` (defaults to 15s in config).
|
|
1492
1492
|
const initTimeoutMs = this.webex.config?.services?.catalogInitTimeout;
|
|
1493
|
-
const
|
|
1493
|
+
const initServiceCatalogsTimeout = new Promise<never>((_, reject) => {
|
|
1494
1494
|
setTimeout(
|
|
1495
1495
|
() => reject(new Error(`services: init timed out after ${initTimeoutMs}ms`)),
|
|
1496
1496
|
initTimeoutMs
|
|
@@ -1502,7 +1502,7 @@ const Services = WebexPlugin.extend({
|
|
|
1502
1502
|
// `initServiceCatalogs` marks the catalog ready internally once the
|
|
1503
1503
|
// postauth catalog is collected - even if it loses the timeout race
|
|
1504
1504
|
// above, so a slow fetch still eventually flips `catalog.isReady`.
|
|
1505
|
-
Promise.race([this.initServiceCatalogs(),
|
|
1505
|
+
Promise.race([this.initServiceCatalogs(), initServiceCatalogsTimeout])
|
|
1506
1506
|
.catch((error) => {
|
|
1507
1507
|
this.initFailed = true;
|
|
1508
1508
|
this.logger.error(
|
|
@@ -1513,7 +1513,10 @@ const Services = WebexPlugin.extend({
|
|
|
1513
1513
|
} else {
|
|
1514
1514
|
const {email} = this.webex.config;
|
|
1515
1515
|
|
|
1516
|
-
Promise.race([
|
|
1516
|
+
Promise.race([
|
|
1517
|
+
this.collectPreauthCatalog(email ? {email} : undefined),
|
|
1518
|
+
initServiceCatalogsTimeout,
|
|
1519
|
+
])
|
|
1517
1520
|
.catch((error) => {
|
|
1518
1521
|
this.initFailed = true;
|
|
1519
1522
|
this.logger.error(
|