@fluidframework/container-loader 2.0.0-internal.7.0.0 → 2.0.0-internal.7.2.0
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/CHANGELOG.md +14 -0
- package/api-extractor.json +9 -1
- package/api-report/container-loader.api.md +153 -0
- package/dist/connectionManager.d.ts +2 -1
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +29 -20
- package/dist/connectionManager.js.map +1 -1
- package/dist/container.d.ts +6 -5
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +21 -19
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +2 -2
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +1 -1
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +3 -3
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +4 -4
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/debugLogger.d.ts.map +1 -1
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +1 -1
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +8 -9
- package/dist/deltaManager.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +4 -4
- package/dist/loader.js +7 -7
- package/dist/loader.js.map +1 -1
- package/dist/location-redirection-utilities/index.d.ts +6 -0
- package/dist/location-redirection-utilities/index.d.ts.map +1 -0
- package/dist/location-redirection-utilities/index.js +11 -0
- package/dist/location-redirection-utilities/index.js.map +1 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +22 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js +51 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +3 -2
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +18 -11
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/utils.d.ts +23 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +11 -3
- package/dist/utils.js.map +1 -1
- package/lib/connectionManager.d.ts +2 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +29 -20
- package/lib/connectionManager.js.map +1 -1
- package/lib/container.d.ts +6 -5
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +21 -19
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +2 -2
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +1 -1
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +3 -3
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +4 -4
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/debugLogger.d.ts.map +1 -1
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +1 -1
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +8 -9
- package/lib/deltaManager.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +4 -4
- package/lib/loader.js +8 -8
- package/lib/loader.js.map +1 -1
- package/lib/location-redirection-utilities/index.d.ts +6 -0
- package/lib/location-redirection-utilities/index.d.ts.map +1 -0
- package/lib/location-redirection-utilities/index.js +6 -0
- package/lib/location-redirection-utilities/index.js.map +1 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts +22 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js +46 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +3 -2
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +18 -11
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/utils.d.ts +23 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +9 -1
- package/lib/utils.js.map +1 -1
- package/package.json +22 -30
- package/src/connectionManager.ts +33 -16
- package/src/container.ts +34 -24
- package/src/containerContext.ts +1 -1
- package/src/containerStorageAdapter.ts +3 -3
- package/src/contracts.ts +4 -4
- package/src/debugLogger.ts +4 -1
- package/src/deltaManager.ts +11 -24
- package/src/index.ts +5 -0
- package/src/loader.ts +8 -8
- package/src/location-redirection-utilities/index.ts +9 -0
- package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +59 -0
- package/src/packageVersion.ts +1 -1
- package/src/retriableDocumentStorageService.ts +29 -15
- package/src/utils.ts +23 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @fluidframework/container-loader
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.7.2.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.0.0-internal.7.1.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- Move `location-redirection-utils` APIs to `container-loader` ([#17554](https://github.com/microsoft/FluidFramework/issues/17554)) [17acf10a71](https://github.com/microsoft/FluidFramework/commits/17acf10a71e51e2490d1df57c89430c1be04c345)
|
|
12
|
+
|
|
13
|
+
Moves the 2 package exports of `location-redirection-utils` to the `container-loader` package.
|
|
14
|
+
|
|
15
|
+
Exports from `location-redirection-utils` are now deprecated, and the package itself will be removed in an upcoming release.
|
|
16
|
+
|
|
3
17
|
## 2.0.0-internal.7.0.0
|
|
4
18
|
|
|
5
19
|
### Major Changes
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "@fluidframework/build-common/api-extractor-
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-base.json",
|
|
4
|
+
"messages": {
|
|
5
|
+
"extractorMessageReporting": {
|
|
6
|
+
"ae-missing-release-tag": {
|
|
7
|
+
// TODO: Fix violations and remove this rule override
|
|
8
|
+
"logLevel": "none"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
## API Report File for "@fluidframework/container-loader"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
8
|
+
import { IAudienceOwner } from '@fluidframework/container-definitions';
|
|
9
|
+
import { IClientDetails } from '@fluidframework/protocol-definitions';
|
|
10
|
+
import { IConfigProviderBase } from '@fluidframework/telemetry-utils';
|
|
11
|
+
import { IContainer } from '@fluidframework/container-definitions';
|
|
12
|
+
import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
|
|
13
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
14
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
15
|
+
import { IFluidCodeDetails } from '@fluidframework/container-definitions';
|
|
16
|
+
import { IFluidModule } from '@fluidframework/container-definitions';
|
|
17
|
+
import { IFluidRouter } from '@fluidframework/core-interfaces';
|
|
18
|
+
import { IHostLoader } from '@fluidframework/container-definitions';
|
|
19
|
+
import { ILoaderOptions as ILoaderOptions_2 } from '@fluidframework/container-definitions';
|
|
20
|
+
import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
|
|
21
|
+
import { IProtocolHandler as IProtocolHandler_2 } from '@fluidframework/protocol-base';
|
|
22
|
+
import { IProvideFluidCodeDetailsComparer } from '@fluidframework/container-definitions';
|
|
23
|
+
import { IQuorumSnapshot } from '@fluidframework/protocol-base';
|
|
24
|
+
import { IRequest } from '@fluidframework/core-interfaces';
|
|
25
|
+
import { IRequestHeader } from '@fluidframework/core-interfaces';
|
|
26
|
+
import { IResponse } from '@fluidframework/core-interfaces';
|
|
27
|
+
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
28
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
29
|
+
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
30
|
+
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
31
|
+
|
|
32
|
+
// @public (undocumented)
|
|
33
|
+
export enum ConnectionState {
|
|
34
|
+
CatchingUp = 1,
|
|
35
|
+
Connected = 2,
|
|
36
|
+
Disconnected = 0,
|
|
37
|
+
EstablishingConnection = 3
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// @public @deprecated (undocumented)
|
|
41
|
+
export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
|
|
42
|
+
load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// @alpha
|
|
46
|
+
export interface IContainerExperimental extends IContainer {
|
|
47
|
+
closeAndGetPendingLocalState?(stopBlobAttachingSignal?: AbortSignal): Promise<string>;
|
|
48
|
+
getPendingLocalState?(): Promise<string>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// @public
|
|
52
|
+
export type IDetachedBlobStorage = Pick<IDocumentStorageService, "createBlob" | "readBlob"> & {
|
|
53
|
+
size: number;
|
|
54
|
+
getBlobIds(): string[];
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// @public @deprecated (undocumented)
|
|
58
|
+
export interface IFluidModuleWithDetails {
|
|
59
|
+
details: IFluidCodeDetails;
|
|
60
|
+
module: IFluidModule;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export interface ILoaderOptions extends ILoaderOptions_2 {
|
|
65
|
+
// (undocumented)
|
|
66
|
+
summarizeProtocolTree?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// @public
|
|
70
|
+
export interface ILoaderProps {
|
|
71
|
+
readonly codeLoader: ICodeDetailsLoader;
|
|
72
|
+
readonly configProvider?: IConfigProviderBase;
|
|
73
|
+
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
74
|
+
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
75
|
+
readonly logger?: ITelemetryBaseLogger;
|
|
76
|
+
readonly options?: ILoaderOptions;
|
|
77
|
+
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
|
78
|
+
readonly scope?: FluidObject;
|
|
79
|
+
readonly urlResolver: IUrlResolver;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// @public
|
|
83
|
+
export interface ILoaderServices {
|
|
84
|
+
readonly codeLoader: ICodeDetailsLoader;
|
|
85
|
+
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
86
|
+
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
87
|
+
readonly options: ILoaderOptions;
|
|
88
|
+
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
|
89
|
+
readonly scope: FluidObject;
|
|
90
|
+
readonly subLogger: ITelemetryLoggerExt;
|
|
91
|
+
readonly urlResolver: IUrlResolver;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// @public
|
|
95
|
+
export interface IParsedUrl {
|
|
96
|
+
id: string;
|
|
97
|
+
path: string;
|
|
98
|
+
query: string;
|
|
99
|
+
version: string | null | undefined;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// @public (undocumented)
|
|
103
|
+
export interface IProtocolHandler extends IProtocolHandler_2 {
|
|
104
|
+
// (undocumented)
|
|
105
|
+
readonly audience: IAudienceOwner;
|
|
106
|
+
// (undocumented)
|
|
107
|
+
processSignal(message: ISignalMessage): any;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// @public
|
|
111
|
+
export function isLocationRedirectionError(error: any): error is ILocationRedirectionError;
|
|
112
|
+
|
|
113
|
+
// @public
|
|
114
|
+
export class Loader implements IHostLoader {
|
|
115
|
+
constructor(loaderProps: ILoaderProps);
|
|
116
|
+
// (undocumented)
|
|
117
|
+
createDetachedContainer(codeDetails: IFluidCodeDetails, createDetachedProps?: {
|
|
118
|
+
canReconnect?: boolean;
|
|
119
|
+
clientDetailsOverride?: IClientDetails;
|
|
120
|
+
}): Promise<IContainer>;
|
|
121
|
+
// @deprecated (undocumented)
|
|
122
|
+
get IFluidRouter(): IFluidRouter;
|
|
123
|
+
// (undocumented)
|
|
124
|
+
rehydrateDetachedContainerFromSnapshot(snapshot: string, createDetachedProps?: {
|
|
125
|
+
canReconnect?: boolean;
|
|
126
|
+
clientDetailsOverride?: IClientDetails;
|
|
127
|
+
}): Promise<IContainer>;
|
|
128
|
+
// @deprecated (undocumented)
|
|
129
|
+
request(request: IRequest): Promise<IResponse>;
|
|
130
|
+
// (undocumented)
|
|
131
|
+
resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
|
|
132
|
+
// (undocumented)
|
|
133
|
+
readonly services: ILoaderServices;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// @public
|
|
137
|
+
export type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, snapshot: IQuorumSnapshot, sendProposal: (key: string, value: any) => number) => IProtocolHandler;
|
|
138
|
+
|
|
139
|
+
// @public @deprecated
|
|
140
|
+
export function requestResolvedObjectFromContainer(container: IContainer, headers?: IRequestHeader): Promise<IResponse>;
|
|
141
|
+
|
|
142
|
+
// @public
|
|
143
|
+
export function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
|
|
144
|
+
|
|
145
|
+
// @public
|
|
146
|
+
export function tryParseCompatibleResolvedUrl(url: string): IParsedUrl | undefined;
|
|
147
|
+
|
|
148
|
+
// @public
|
|
149
|
+
export function waitContainerToCatchUp(container: IContainer): Promise<boolean>;
|
|
150
|
+
|
|
151
|
+
// (No @packageDocumentation comment for this package)
|
|
152
|
+
|
|
153
|
+
```
|
|
@@ -139,10 +139,11 @@ export declare class ConnectionManager implements IConnectionManager {
|
|
|
139
139
|
*/
|
|
140
140
|
private reconnect;
|
|
141
141
|
prepareMessageToSend(message: Omit<IDocumentMessage, "clientSequenceNumber">): IDocumentMessage | undefined;
|
|
142
|
-
submitSignal(content: any): void;
|
|
142
|
+
submitSignal(content: any, targetClientId?: string): void;
|
|
143
143
|
sendMessages(messages: IDocumentMessage[]): void;
|
|
144
144
|
beforeProcessingIncomingOp(message: ISequencedDocumentMessage): void;
|
|
145
145
|
private readonly opHandler;
|
|
146
|
+
private readonly signalHandler;
|
|
146
147
|
private readonly nackHandler;
|
|
147
148
|
private readonly disconnectHandlerInternal;
|
|
148
149
|
private readonly errorHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionManager.d.ts","sourceRoot":"","sources":["../src/connectionManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,oBAAoB,
|
|
1
|
+
{"version":3,"file":"connectionManager.d.ts","sourceRoot":"","sources":["../src/connectionManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,oBAAoB,EAAY,M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,CAAC,EAAE,cAAc;YAOtE,WAAW;IAsMzB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IActB;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAwCjC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAwJpC;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;;;;;OAMG;YACW,SAAS;IA8DhB,oBAAoB,CAC1B,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GACrD,gBAAgB,GAAG,SAAS;IAuCxB,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM;IAQlD,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE;IA+BzC,0BAA0B,CAAC,OAAO,EAAE,yBAAyB;IAgDpE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAGxB;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAG5B;IAGF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAkB1B;IAGF,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAIxC;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAE3B;CACF"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ConnectionManager = void 0;
|
|
8
|
+
const core_interfaces_1 = require("@fluidframework/core-interfaces");
|
|
8
9
|
const core_utils_1 = require("@fluidframework/core-utils");
|
|
9
10
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
10
11
|
const driver_definitions_1 = require("@fluidframework/driver-definitions");
|
|
@@ -243,6 +244,10 @@ class ConnectionManager {
|
|
|
243
244
|
const messages = Array.isArray(messagesArg) ? messagesArg : [messagesArg];
|
|
244
245
|
this.props.incomingOpHandler(messages, "opHandler");
|
|
245
246
|
};
|
|
247
|
+
this.signalHandler = (signalsArg) => {
|
|
248
|
+
const signals = Array.isArray(signalsArg) ? signalsArg : [signalsArg];
|
|
249
|
+
this.props.signalHandler(signals);
|
|
250
|
+
};
|
|
246
251
|
// Always connect in write mode after getting nacked.
|
|
247
252
|
this.nackHandler = (documentId, messages) => {
|
|
248
253
|
const message = messages[0];
|
|
@@ -432,6 +437,10 @@ class ConnectionManager {
|
|
|
432
437
|
this.logger.sendTelemetryEvent({ eventName: "ReceivedClosedConnection" });
|
|
433
438
|
connection = undefined;
|
|
434
439
|
}
|
|
440
|
+
this.logger.sendTelemetryEvent({
|
|
441
|
+
eventName: "ConnectionReceived",
|
|
442
|
+
connected: connection !== undefined && connection.disposed === false,
|
|
443
|
+
}, undefined, core_interfaces_1.LogLevel.verbose);
|
|
435
444
|
}
|
|
436
445
|
catch (origError) {
|
|
437
446
|
if ((0, utils_1.isDeltaStreamConnectionForbiddenError)(origError)) {
|
|
@@ -507,8 +516,8 @@ class ConnectionManager {
|
|
|
507
516
|
duration: (0, telemetry_utils_1.formatTick)(client_utils_1.performance.now() - connectStartTime),
|
|
508
517
|
}, lastError);
|
|
509
518
|
}
|
|
510
|
-
// Check for abort signal after while loop as well
|
|
511
|
-
if (abortSignal.aborted === true) {
|
|
519
|
+
// Check for abort signal after while loop as well or we've been disposed
|
|
520
|
+
if (abortSignal.aborted === true || this._disposed) {
|
|
512
521
|
connection.dispose();
|
|
513
522
|
this.logger.sendTelemetryEvent({
|
|
514
523
|
eventName: "ConnectionAttemptCancelled",
|
|
@@ -558,7 +567,7 @@ class ConnectionManager {
|
|
|
558
567
|
this.connection = undefined;
|
|
559
568
|
// Remove listeners first so we don't try to retrigger this flow accidentally through reconnectOnError
|
|
560
569
|
connection.off("op", this.opHandler);
|
|
561
|
-
connection.off("signal", this.
|
|
570
|
+
connection.off("signal", this.signalHandler);
|
|
562
571
|
connection.off("nack", this.nackHandler);
|
|
563
572
|
connection.off("disconnect", this.disconnectHandlerInternal);
|
|
564
573
|
connection.off("error", this.errorHandler);
|
|
@@ -619,7 +628,7 @@ class ConnectionManager {
|
|
|
619
628
|
}
|
|
620
629
|
this._outbound.resume();
|
|
621
630
|
connection.on("op", this.opHandler);
|
|
622
|
-
connection.on("signal", this.
|
|
631
|
+
connection.on("signal", this.signalHandler);
|
|
623
632
|
connection.on("nack", this.nackHandler);
|
|
624
633
|
connection.on("disconnect", this.disconnectHandlerInternal);
|
|
625
634
|
connection.on("error", this.errorHandler);
|
|
@@ -670,26 +679,26 @@ class ConnectionManager {
|
|
|
670
679
|
type: protocol_1.SignalType.Clear,
|
|
671
680
|
}),
|
|
672
681
|
};
|
|
673
|
-
this
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
682
|
+
// list of signals to process due to this new connection
|
|
683
|
+
let signalsToProcess = [clearSignal];
|
|
684
|
+
const clientJoinSignals = (connection.initialClients ?? []).map((priorClient) => ({
|
|
685
|
+
clientId: null,
|
|
686
|
+
content: JSON.stringify({
|
|
687
|
+
type: protocol_1.SignalType.ClientJoin,
|
|
688
|
+
content: priorClient, // ISignalClient
|
|
689
|
+
}),
|
|
690
|
+
}));
|
|
691
|
+
if (clientJoinSignals.length > 0) {
|
|
692
|
+
signalsToProcess = signalsToProcess.concat(clientJoinSignals);
|
|
683
693
|
}
|
|
684
694
|
// Unfortunately, there is no defined order between initialSignals (including join & leave signals)
|
|
685
695
|
// and connection.initialClients. In practice, connection.initialSignals quite often contains join signal
|
|
686
696
|
// for "self" and connection.initialClients does not contain "self", so we have to process them after
|
|
687
697
|
// "clear" signal above.
|
|
688
|
-
if (connection.initialSignals !== undefined) {
|
|
689
|
-
|
|
690
|
-
this.props.signalHandler(signal);
|
|
691
|
-
}
|
|
698
|
+
if (connection.initialSignals !== undefined && connection.initialSignals.length > 0) {
|
|
699
|
+
signalsToProcess = signalsToProcess.concat(connection.initialSignals);
|
|
692
700
|
}
|
|
701
|
+
this.props.signalHandler(signalsToProcess);
|
|
693
702
|
}
|
|
694
703
|
/**
|
|
695
704
|
* Disconnect the current connection and reconnect. Closes the container if it fails.
|
|
@@ -785,9 +794,9 @@ class ConnectionManager {
|
|
|
785
794
|
clientSequenceNumber: ++this.clientSequenceNumber,
|
|
786
795
|
};
|
|
787
796
|
}
|
|
788
|
-
submitSignal(content) {
|
|
797
|
+
submitSignal(content, targetClientId) {
|
|
789
798
|
if (this.connection !== undefined) {
|
|
790
|
-
this.connection.submitSignal(content);
|
|
799
|
+
this.connection.submitSignal(content, targetClientId);
|
|
791
800
|
}
|
|
792
801
|
else {
|
|
793
802
|
this.logger.sendErrorEvent({ eventName: "submitSignalDisconnected" });
|