@100mslive/hms-video-store 0.14.0 → 0.14.1
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.
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal HMSTransport instantiator for unit tests.
|
|
3
|
+
*
|
|
4
|
+
* Builds a real `HMSTransport` with the smallest mocks that get past the
|
|
5
|
+
* constructor and its initial subscriptions. Tests can then call
|
|
6
|
+
* private/arrow-field methods directly on the instance:
|
|
7
|
+
*
|
|
8
|
+
* const t = makeTransport();
|
|
9
|
+
* await (t as any).retrySignalDisconnectTask();
|
|
10
|
+
*
|
|
11
|
+
* For tests that exercise specific code paths, override fields after
|
|
12
|
+
* construction:
|
|
13
|
+
*
|
|
14
|
+
* (t as any).joinParameters = undefined;
|
|
15
|
+
* (t as any).signal = mySignalMock;
|
|
16
|
+
*
|
|
17
|
+
* This is deliberately not a "fake biz" or full integration harness —
|
|
18
|
+
* it's the smallest scaffolding that lets us exercise the real
|
|
19
|
+
* HMSTransport methods with controlled inputs.
|
|
20
|
+
*/
|
|
21
|
+
import { AnalyticsTimer } from '../../analytics/AnalyticsTimer';
|
|
22
|
+
import { DeviceManager } from '../../device-manager';
|
|
23
|
+
import { EventBus } from '../../events/EventBus';
|
|
24
|
+
import { Store } from '../../sdk/store';
|
|
25
|
+
import HMSTransport from '../../transport';
|
|
26
|
+
import ITransportObserver from '../../transport/ITransportObserver';
|
|
27
|
+
import { TransportState } from '../../transport/models/TransportState';
|
|
28
|
+
export declare const makeFakeObserver: () => ITransportObserver;
|
|
29
|
+
export interface MakeTransportOptions {
|
|
30
|
+
observer?: ITransportObserver;
|
|
31
|
+
store?: Partial<Store>;
|
|
32
|
+
}
|
|
33
|
+
export declare const makeTransport: (opts?: MakeTransportOptions) => {
|
|
34
|
+
transport: HMSTransport;
|
|
35
|
+
observer: ITransportObserver;
|
|
36
|
+
eventBus: EventBus;
|
|
37
|
+
store: Store;
|
|
38
|
+
analyticsTimer: AnalyticsTimer;
|
|
39
|
+
deviceManager: DeviceManager;
|
|
40
|
+
};
|
|
41
|
+
export { TransportState };
|
|
@@ -114,6 +114,15 @@ export default class HMSTransport {
|
|
|
114
114
|
private doesLocalPeerNeedWebRTC;
|
|
115
115
|
private retryPublishIceFailedTask;
|
|
116
116
|
private retrySubscribeIceFailedTask;
|
|
117
|
+
/**
|
|
118
|
+
* Retry path that reconnects the signal WebSocket after a disconnect.
|
|
119
|
+
*
|
|
120
|
+
* The retryScheduler can fire this body asynchronously, and `leave()`
|
|
121
|
+
* clears `joinParameters` synchronously. If leave() races with a queued
|
|
122
|
+
* task, dereferencing `this.joinParameters!.authToken` would throw a
|
|
123
|
+
* TypeError. Bail out cleanly in that case — leave() also resets the
|
|
124
|
+
* scheduler, so further work here is moot.
|
|
125
|
+
*/
|
|
117
126
|
private retrySignalDisconnectTask;
|
|
118
127
|
private setTransportStateForConnect;
|
|
119
128
|
private sendErrorAnalyticsEvent;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.14.
|
|
2
|
+
"version": "0.14.1",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"conferencing",
|
|
73
73
|
"100ms"
|
|
74
74
|
],
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "44fc1984b26ee5c559e20011eba29dc0583dd5fc"
|
|
76
76
|
}
|