@webex/plugin-meetings 3.12.0-next.134 → 3.12.0-next.136
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/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/hashTree/hashTreeParser.js +64 -19
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +25 -4
- package/dist/locus-info/index.js.map +1 -1
- package/dist/types/hashTree/hashTreeParser.d.ts +11 -0
- package/dist/types/locus-info/index.d.ts +6 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/hashTree/hashTreeParser.ts +50 -0
- package/src/locus-info/index.ts +20 -1
- package/test/unit/spec/hashTree/hashTreeParser.ts +148 -0
- package/test/unit/spec/locus-info/index.js +47 -0
|
@@ -122,6 +122,7 @@ declare class HashTreeParser {
|
|
|
122
122
|
private dataSetsSyncedDuringBackoff;
|
|
123
123
|
private syncQueueProcessingPromise;
|
|
124
124
|
private topLevelHeartbeatIntervalMs?;
|
|
125
|
+
private pendingLlmWatchdogDataSetNames;
|
|
125
126
|
/**
|
|
126
127
|
* Constructor for HashTreeParser
|
|
127
128
|
* @param {Object} options
|
|
@@ -480,6 +481,16 @@ declare class HashTreeParser {
|
|
|
480
481
|
* @returns {void}
|
|
481
482
|
*/
|
|
482
483
|
private resetHeartbeatWatchdogs;
|
|
484
|
+
/**
|
|
485
|
+
* Re-evaluates heartbeat watchdog timers for LLM data sets. While LLM is not expected,
|
|
486
|
+
* resetHeartbeatWatchdogs skips setting watchdog timers for LLM data sets and records them in
|
|
487
|
+
* pendingLlmWatchdogDataSetNames. This must be called when LLM transitions to expected (e.g. self
|
|
488
|
+
* reports JOINED) to arm the watchdogs for those pending data sets (avoids a timing issue where
|
|
489
|
+
* the "main"/"atd-active"/"atd-unmuted" data set arrives before the self update). The pending set
|
|
490
|
+
* is consumed and cleared here.
|
|
491
|
+
* @returns {void}
|
|
492
|
+
*/
|
|
493
|
+
reevaluateLlmWatchdogs(): void;
|
|
483
494
|
/**
|
|
484
495
|
* Stops all timers for the data sets to prevent any further sync attempts.
|
|
485
496
|
* @returns {void}
|
|
@@ -124,6 +124,12 @@ export default class LocusInfo extends EventsScope {
|
|
|
124
124
|
* @memberof LocusInfo
|
|
125
125
|
*/
|
|
126
126
|
init(locus?: any): void;
|
|
127
|
+
/**
|
|
128
|
+
* Whether we expect to receive updates over the LLM connection. This is used by hash tree parsers
|
|
129
|
+
* to decide whether to arm heartbeat watchdog timers for LLM data sets.
|
|
130
|
+
* @returns {boolean}
|
|
131
|
+
*/
|
|
132
|
+
private isLlmExpected;
|
|
127
133
|
/**
|
|
128
134
|
* Creates a HashTreeParser instance for a given locusUrl and stores it in the map.
|
|
129
135
|
* @param {Object} params
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@webex/common": "3.12.0-next.6",
|
|
64
64
|
"@webex/event-dictionary-ts": "^1.0.2215",
|
|
65
|
-
"@webex/internal-media-core": "2.29.
|
|
65
|
+
"@webex/internal-media-core": "2.29.2",
|
|
66
66
|
"@webex/internal-plugin-conversation": "3.12.0-next.51",
|
|
67
67
|
"@webex/internal-plugin-device": "3.12.0-next.44",
|
|
68
68
|
"@webex/internal-plugin-llm": "3.12.0-next.51",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@webex/internal-plugin-support": "3.12.0-next.51",
|
|
72
72
|
"@webex/internal-plugin-user": "3.12.0-next.45",
|
|
73
73
|
"@webex/internal-plugin-voicea": "3.12.0-next.53",
|
|
74
|
-
"@webex/media-helpers": "3.12.0-next.
|
|
74
|
+
"@webex/media-helpers": "3.12.0-next.13",
|
|
75
75
|
"@webex/plugin-people": "3.12.0-next.48",
|
|
76
76
|
"@webex/plugin-rooms": "3.12.0-next.51",
|
|
77
77
|
"@webex/ts-sdp": "^1.8.1",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"//": [
|
|
95
95
|
"TODO: upgrade jwt-decode when moving to node 18"
|
|
96
96
|
],
|
|
97
|
-
"version": "3.12.0-next.
|
|
97
|
+
"version": "3.12.0-next.136"
|
|
98
98
|
}
|
|
@@ -177,6 +177,9 @@ class HashTreeParser {
|
|
|
177
177
|
private syncQueueProcessingPromise: Promise<void> = Promise.resolve();
|
|
178
178
|
// top-level heartbeat interval from the most recent message, used as fallback when dataset-level value is missing
|
|
179
179
|
private topLevelHeartbeatIntervalMs?: number;
|
|
180
|
+
// LLM data sets that were received while LLM was not expected, so their heartbeat watchdog was
|
|
181
|
+
// skipped; reevaluateLlmWatchdogs() arms these once LLM becomes expected and then clears this set
|
|
182
|
+
private pendingLlmWatchdogDataSetNames: Set<string> = new Set();
|
|
180
183
|
/**
|
|
181
184
|
* Constructor for HashTreeParser
|
|
182
185
|
* @param {Object} options
|
|
@@ -1891,6 +1894,8 @@ class HashTreeParser {
|
|
|
1891
1894
|
`HashTreeParser#resetHeartbeatWatchdogs --> ${this.debugId} skipping heartbeat watchdog timer for data set "${dataSet.name}" because LLM is disconnected`
|
|
1892
1895
|
);
|
|
1893
1896
|
|
|
1897
|
+
// remember it so reevaluateLlmWatchdogs() can arm the watchdog once LLM becomes expected
|
|
1898
|
+
this.pendingLlmWatchdogDataSetNames.add(dataSet.name);
|
|
1894
1899
|
// eslint-disable-next-line no-continue
|
|
1895
1900
|
continue;
|
|
1896
1901
|
}
|
|
@@ -1918,6 +1923,50 @@ class HashTreeParser {
|
|
|
1918
1923
|
}
|
|
1919
1924
|
}
|
|
1920
1925
|
|
|
1926
|
+
/**
|
|
1927
|
+
* Re-evaluates heartbeat watchdog timers for LLM data sets. While LLM is not expected,
|
|
1928
|
+
* resetHeartbeatWatchdogs skips setting watchdog timers for LLM data sets and records them in
|
|
1929
|
+
* pendingLlmWatchdogDataSetNames. This must be called when LLM transitions to expected (e.g. self
|
|
1930
|
+
* reports JOINED) to arm the watchdogs for those pending data sets (avoids a timing issue where
|
|
1931
|
+
* the "main"/"atd-active"/"atd-unmuted" data set arrives before the self update). The pending set
|
|
1932
|
+
* is consumed and cleared here.
|
|
1933
|
+
* @returns {void}
|
|
1934
|
+
*/
|
|
1935
|
+
reevaluateLlmWatchdogs(): void {
|
|
1936
|
+
if (this.state === 'stopped') {
|
|
1937
|
+
return;
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
if (this.pendingLlmWatchdogDataSetNames.size === 0) {
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
// consume the pending set - these LLM data sets were received while LLM was not expected
|
|
1945
|
+
const pendingDataSetNames = [...this.pendingLlmWatchdogDataSetNames];
|
|
1946
|
+
this.pendingLlmWatchdogDataSetNames.clear();
|
|
1947
|
+
|
|
1948
|
+
const dataSetsNeedingWatchdog = pendingDataSetNames
|
|
1949
|
+
.map((name) => this.dataSets[name])
|
|
1950
|
+
.filter((dataSet): dataSet is InternalDataSet => {
|
|
1951
|
+
if (!dataSet?.hashTree || dataSet.heartbeatWatchdogTimer) {
|
|
1952
|
+
return false;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
return this.isVisibleDataSet(dataSet.name);
|
|
1956
|
+
});
|
|
1957
|
+
|
|
1958
|
+
if (dataSetsNeedingWatchdog.length > 0) {
|
|
1959
|
+
LoggerProxy.logger.info(
|
|
1960
|
+
`HashTreeParser#reevaluateLlmWatchdogs --> ${
|
|
1961
|
+
this.debugId
|
|
1962
|
+
} LLM became expected, setting heartbeat watchdog timers for data sets: ${dataSetsNeedingWatchdog
|
|
1963
|
+
.map((ds) => ds.name)
|
|
1964
|
+
.join(', ')}`
|
|
1965
|
+
);
|
|
1966
|
+
this.resetHeartbeatWatchdogs(dataSetsNeedingWatchdog);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1921
1970
|
/**
|
|
1922
1971
|
* Stops all timers for the data sets to prevent any further sync attempts.
|
|
1923
1972
|
* @returns {void}
|
|
@@ -1950,6 +1999,7 @@ class HashTreeParser {
|
|
|
1950
1999
|
this.topLevelHeartbeatIntervalMs = undefined;
|
|
1951
2000
|
this.syncAllBackoffType = SyncAllBackoffType.NONE;
|
|
1952
2001
|
this.dataSetsSyncedDuringBackoff = new Set();
|
|
2002
|
+
this.pendingLlmWatchdogDataSetNames = new Set();
|
|
1953
2003
|
Object.values(this.dataSets).forEach((dataSet) => {
|
|
1954
2004
|
dataSet.syncAbortController?.abort();
|
|
1955
2005
|
dataSet.syncAbortController = undefined;
|
package/src/locus-info/index.ts
CHANGED
|
@@ -538,6 +538,15 @@ export default class LocusInfo extends EventsScope {
|
|
|
538
538
|
this.updateLinks(locus.links);
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
+
/**
|
|
542
|
+
* Whether we expect to receive updates over the LLM connection. This is used by hash tree parsers
|
|
543
|
+
* to decide whether to arm heartbeat watchdog timers for LLM data sets.
|
|
544
|
+
* @returns {boolean}
|
|
545
|
+
*/
|
|
546
|
+
private isLlmExpected(): boolean {
|
|
547
|
+
return this.parsedLocus.self?.joinedWith?.state === 'JOINED';
|
|
548
|
+
}
|
|
549
|
+
|
|
541
550
|
/**
|
|
542
551
|
* Creates a HashTreeParser instance for a given locusUrl and stores it in the map.
|
|
543
552
|
* @param {Object} params
|
|
@@ -568,7 +577,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
568
577
|
callbacks: {
|
|
569
578
|
locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
|
|
570
579
|
syncLatencyTracker: this.callbacks.syncLatencyTracker,
|
|
571
|
-
isLlmExpected: () => this.
|
|
580
|
+
isLlmExpected: () => this.isLlmExpected(),
|
|
572
581
|
// Reuse webex-core's tracking-id interceptor sequence (exposed publicly via
|
|
573
582
|
// webexTrackingIdSequenceNumbers) so Locus requests share the client's unified
|
|
574
583
|
// ${sessionId}_${sequence} tracking id space instead of minting an unrelated id. Fall
|
|
@@ -2714,6 +2723,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
2714
2723
|
*/
|
|
2715
2724
|
updateSelf(self: any) {
|
|
2716
2725
|
if (self) {
|
|
2726
|
+
const wasLlmExpected = this.isLlmExpected();
|
|
2717
2727
|
// @ts-ignore
|
|
2718
2728
|
const parsedSelves = SelfUtils.getSelves(
|
|
2719
2729
|
this.parsedLocus.self,
|
|
@@ -2993,6 +3003,15 @@ export default class LocusInfo extends EventsScope {
|
|
|
2993
3003
|
this.parsedLocus.self = parsedSelves.current;
|
|
2994
3004
|
// @ts-ignore
|
|
2995
3005
|
this.self = self;
|
|
3006
|
+
|
|
3007
|
+
// If LLM just became expected (self reported JOINED), some hash tree parsers may have skipped
|
|
3008
|
+
// arming heartbeat watchdog timers for LLM data sets whose messages arrived before this
|
|
3009
|
+
// update. Re-evaluate them now so those watchdogs get armed.
|
|
3010
|
+
if (!wasLlmExpected && this.isLlmExpected()) {
|
|
3011
|
+
this.hashTreeParsers.forEach((entry) => {
|
|
3012
|
+
entry.parser.reevaluateLlmWatchdogs();
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
2996
3015
|
} else {
|
|
2997
3016
|
this.compareAndUpdateFlags.compareHostAndSelf = false;
|
|
2998
3017
|
}
|
|
@@ -3560,6 +3560,154 @@ describe('HashTreeParser', () => {
|
|
|
3560
3560
|
expect(parser.dataSets.self.heartbeatWatchdogTimer).to.not.be.undefined;
|
|
3561
3561
|
});
|
|
3562
3562
|
|
|
3563
|
+
it('arms skipped LLM watchdog timers when reevaluateLlmWatchdogs is called after LLM becomes expected', async () => {
|
|
3564
|
+
let llmExpected = false;
|
|
3565
|
+
const parser = createHashTreeParser(
|
|
3566
|
+
undefined,
|
|
3567
|
+
undefined,
|
|
3568
|
+
undefined,
|
|
3569
|
+
undefined,
|
|
3570
|
+
'meeting-1',
|
|
3571
|
+
undefined,
|
|
3572
|
+
() => llmExpected
|
|
3573
|
+
);
|
|
3574
|
+
|
|
3575
|
+
const heartbeatMessage = {
|
|
3576
|
+
dataSets: [
|
|
3577
|
+
{
|
|
3578
|
+
...createDataSet('main', 16, 1100),
|
|
3579
|
+
root: parser.dataSets.main.hashTree.getRootHash(),
|
|
3580
|
+
},
|
|
3581
|
+
{
|
|
3582
|
+
...createDataSet('self', 1, 2100),
|
|
3583
|
+
url: parser.dataSets.self.url,
|
|
3584
|
+
root: parser.dataSets.self.hashTree.getRootHash(),
|
|
3585
|
+
},
|
|
3586
|
+
{
|
|
3587
|
+
...createDataSet('atd-unmuted', 16, 3100),
|
|
3588
|
+
url: parser.dataSets['atd-unmuted'].url,
|
|
3589
|
+
root: parser.dataSets['atd-unmuted'].hashTree.getRootHash(),
|
|
3590
|
+
},
|
|
3591
|
+
],
|
|
3592
|
+
visibleDataSetsUrl,
|
|
3593
|
+
locusUrl,
|
|
3594
|
+
};
|
|
3595
|
+
|
|
3596
|
+
// LLM data set messages arrive before LLM is expected, so their watchdogs are skipped
|
|
3597
|
+
parser.handleMessage(heartbeatMessage, 'heartbeat before llm expected');
|
|
3598
|
+
|
|
3599
|
+
expect(parser.dataSets.main.heartbeatWatchdogTimer).to.be.undefined;
|
|
3600
|
+
expect(parser.dataSets['atd-unmuted'].heartbeatWatchdogTimer).to.be.undefined;
|
|
3601
|
+
const selfTimerBefore = parser.dataSets.self.heartbeatWatchdogTimer;
|
|
3602
|
+
expect(selfTimerBefore).to.not.be.undefined;
|
|
3603
|
+
|
|
3604
|
+
// LLM becomes expected and we re-evaluate the watchdogs
|
|
3605
|
+
llmExpected = true;
|
|
3606
|
+
parser.reevaluateLlmWatchdogs();
|
|
3607
|
+
|
|
3608
|
+
// the previously skipped LLM watchdogs are now armed
|
|
3609
|
+
expect(parser.dataSets.main.heartbeatWatchdogTimer).to.not.be.undefined;
|
|
3610
|
+
expect(parser.dataSets['atd-unmuted'].heartbeatWatchdogTimer).to.not.be.undefined;
|
|
3611
|
+
// the self (non-LLM) watchdog timer is left untouched
|
|
3612
|
+
expect(parser.dataSets.self.heartbeatWatchdogTimer).to.equal(selfTimerBefore);
|
|
3613
|
+
|
|
3614
|
+
// the pending set is consumed, so a second call after clearing the timers is a no-op
|
|
3615
|
+
clearTimeout(parser.dataSets.main.heartbeatWatchdogTimer);
|
|
3616
|
+
clearTimeout(parser.dataSets['atd-unmuted'].heartbeatWatchdogTimer);
|
|
3617
|
+
parser.dataSets.main.heartbeatWatchdogTimer = undefined;
|
|
3618
|
+
parser.dataSets['atd-unmuted'].heartbeatWatchdogTimer = undefined;
|
|
3619
|
+
|
|
3620
|
+
parser.reevaluateLlmWatchdogs();
|
|
3621
|
+
|
|
3622
|
+
expect(parser.dataSets.main.heartbeatWatchdogTimer).to.be.undefined;
|
|
3623
|
+
expect(parser.dataSets['atd-unmuted'].heartbeatWatchdogTimer).to.be.undefined;
|
|
3624
|
+
});
|
|
3625
|
+
|
|
3626
|
+
it('only arms watchdogs for LLM data sets that were actually received in a message', async () => {
|
|
3627
|
+
let llmExpected = false;
|
|
3628
|
+
const parser = createHashTreeParser(
|
|
3629
|
+
undefined,
|
|
3630
|
+
undefined,
|
|
3631
|
+
undefined,
|
|
3632
|
+
undefined,
|
|
3633
|
+
'meeting-1',
|
|
3634
|
+
undefined,
|
|
3635
|
+
() => llmExpected
|
|
3636
|
+
);
|
|
3637
|
+
|
|
3638
|
+
// only 'main' is received in a message (atd-unmuted exists in this.dataSets with a hash
|
|
3639
|
+
// tree but is never received in any message)
|
|
3640
|
+
const heartbeatMessage = {
|
|
3641
|
+
dataSets: [
|
|
3642
|
+
{
|
|
3643
|
+
...createDataSet('main', 16, 1100),
|
|
3644
|
+
root: parser.dataSets.main.hashTree.getRootHash(),
|
|
3645
|
+
},
|
|
3646
|
+
],
|
|
3647
|
+
visibleDataSetsUrl,
|
|
3648
|
+
locusUrl,
|
|
3649
|
+
};
|
|
3650
|
+
|
|
3651
|
+
parser.handleMessage(heartbeatMessage, 'only main received before llm expected');
|
|
3652
|
+
|
|
3653
|
+
// sanity: atd-unmuted has a hash tree but was never received
|
|
3654
|
+
expect(parser.dataSets['atd-unmuted'].hashTree).to.not.be.undefined;
|
|
3655
|
+
expect(parser.dataSets.main.heartbeatWatchdogTimer).to.be.undefined;
|
|
3656
|
+
expect(parser.dataSets['atd-unmuted'].heartbeatWatchdogTimer).to.be.undefined;
|
|
3657
|
+
|
|
3658
|
+
llmExpected = true;
|
|
3659
|
+
parser.reevaluateLlmWatchdogs();
|
|
3660
|
+
|
|
3661
|
+
// 'main' was received, so its watchdog is armed
|
|
3662
|
+
expect(parser.dataSets.main.heartbeatWatchdogTimer).to.not.be.undefined;
|
|
3663
|
+
// 'atd-unmuted' was never received, so no watchdog is armed even though it has a hash tree
|
|
3664
|
+
expect(parser.dataSets['atd-unmuted'].heartbeatWatchdogTimer).to.be.undefined;
|
|
3665
|
+
});
|
|
3666
|
+
|
|
3667
|
+
it('does not re-arm or reset an already active LLM watchdog timer when reevaluateLlmWatchdogs is called', async () => {
|
|
3668
|
+
const parser = createHashTreeParser(
|
|
3669
|
+
undefined,
|
|
3670
|
+
undefined,
|
|
3671
|
+
undefined,
|
|
3672
|
+
undefined,
|
|
3673
|
+
'meeting-1',
|
|
3674
|
+
undefined,
|
|
3675
|
+
() => true
|
|
3676
|
+
);
|
|
3677
|
+
|
|
3678
|
+
parser.handleMessage(
|
|
3679
|
+
createHeartbeatMessage('main', 16, 1100, parser.dataSets.main.hashTree.getRootHash()),
|
|
3680
|
+
'heartbeat with llm expected'
|
|
3681
|
+
);
|
|
3682
|
+
|
|
3683
|
+
const mainTimerBefore = parser.dataSets.main.heartbeatWatchdogTimer;
|
|
3684
|
+
expect(mainTimerBefore).to.not.be.undefined;
|
|
3685
|
+
|
|
3686
|
+
parser.reevaluateLlmWatchdogs();
|
|
3687
|
+
|
|
3688
|
+
// existing active timer must not be cleared/reset (that would extend its deadline)
|
|
3689
|
+
expect(parser.dataSets.main.heartbeatWatchdogTimer).to.equal(mainTimerBefore);
|
|
3690
|
+
});
|
|
3691
|
+
|
|
3692
|
+
it('does nothing when reevaluateLlmWatchdogs is called on a stopped parser', async () => {
|
|
3693
|
+
const parser = createHashTreeParser(
|
|
3694
|
+
undefined,
|
|
3695
|
+
undefined,
|
|
3696
|
+
undefined,
|
|
3697
|
+
undefined,
|
|
3698
|
+
'meeting-1',
|
|
3699
|
+
undefined,
|
|
3700
|
+
() => true
|
|
3701
|
+
);
|
|
3702
|
+
|
|
3703
|
+
parser.stop();
|
|
3704
|
+
|
|
3705
|
+
parser.reevaluateLlmWatchdogs();
|
|
3706
|
+
|
|
3707
|
+
expect(parser.dataSets.main.heartbeatWatchdogTimer).to.be.undefined;
|
|
3708
|
+
expect(parser.dataSets['atd-unmuted'].heartbeatWatchdogTimer).to.be.undefined;
|
|
3709
|
+
});
|
|
3710
|
+
|
|
3563
3711
|
it('stops all watchdog timers when meeting ends via sentinel message', async () => {
|
|
3564
3712
|
const parser = createHashTreeParser();
|
|
3565
3713
|
|
|
@@ -2055,6 +2055,53 @@ describe('plugin-meetings', () => {
|
|
|
2055
2055
|
});
|
|
2056
2056
|
|
|
2057
2057
|
describe('#updateSelf', () => {
|
|
2058
|
+
describe('LLM watchdog re-evaluation', () => {
|
|
2059
|
+
it('re-evaluates LLM watchdogs on all hash tree parsers when self transitions to joined', () => {
|
|
2060
|
+
const parserA = {reevaluateLlmWatchdogs: sinon.stub()};
|
|
2061
|
+
const parserB = {reevaluateLlmWatchdogs: sinon.stub()};
|
|
2062
|
+
locusInfo.hashTreeParsers.set('urlA', {parser: parserA});
|
|
2063
|
+
locusInfo.hashTreeParsers.set('urlB', {parser: parserB});
|
|
2064
|
+
|
|
2065
|
+
// start with LLM not expected (no self yet)
|
|
2066
|
+
locusInfo.parsedLocus.self = undefined;
|
|
2067
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
|
2068
|
+
|
|
2069
|
+
// the self fixture's joined device has state JOINED -> isLlmExpected becomes true
|
|
2070
|
+
locusInfo.updateSelf(cloneDeep(self));
|
|
2071
|
+
|
|
2072
|
+
assert.calledOnceWithExactly(parserA.reevaluateLlmWatchdogs);
|
|
2073
|
+
assert.calledOnceWithExactly(parserB.reevaluateLlmWatchdogs);
|
|
2074
|
+
});
|
|
2075
|
+
|
|
2076
|
+
it('does not re-evaluate LLM watchdogs when LLM was already expected before the update', () => {
|
|
2077
|
+
const parser = {reevaluateLlmWatchdogs: sinon.stub()};
|
|
2078
|
+
locusInfo.hashTreeParsers.set('urlA', {parser});
|
|
2079
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
|
2080
|
+
|
|
2081
|
+
// first update establishes the JOINED state (LLM already expected)
|
|
2082
|
+
locusInfo.updateSelf(cloneDeep(self));
|
|
2083
|
+
parser.reevaluateLlmWatchdogs.resetHistory();
|
|
2084
|
+
|
|
2085
|
+
// second update while already joined must not re-trigger re-evaluation
|
|
2086
|
+
locusInfo.updateSelf(cloneDeep(self));
|
|
2087
|
+
|
|
2088
|
+
assert.notCalled(parser.reevaluateLlmWatchdogs);
|
|
2089
|
+
});
|
|
2090
|
+
|
|
2091
|
+
it('does not re-evaluate LLM watchdogs when the self update does not make LLM expected', () => {
|
|
2092
|
+
const parser = {reevaluateLlmWatchdogs: sinon.stub()};
|
|
2093
|
+
locusInfo.hashTreeParsers.set('urlA', {parser});
|
|
2094
|
+
|
|
2095
|
+
locusInfo.parsedLocus.self = undefined;
|
|
2096
|
+
// device url does not match any of self's devices -> joinedWith is undefined -> not expected
|
|
2097
|
+
locusInfo.webex.internal.device.url = 'https://some-other-device-url.com';
|
|
2098
|
+
|
|
2099
|
+
locusInfo.updateSelf(cloneDeep(self));
|
|
2100
|
+
|
|
2101
|
+
assert.notCalled(parser.reevaluateLlmWatchdogs);
|
|
2102
|
+
});
|
|
2103
|
+
});
|
|
2104
|
+
|
|
2058
2105
|
it('should trigger SELF_MEETING_BRB_CHANGED when brb state changed', () => {
|
|
2059
2106
|
locusInfo.self = undefined;
|
|
2060
2107
|
|