@fluidframework/container-loader 2.0.0-internal.4.3.0 → 2.0.0-internal.5.0.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 +28 -0
- package/README.md +6 -3
- package/dist/connectionManager.d.ts +5 -3
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +19 -15
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +11 -9
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +11 -11
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +62 -36
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +71 -89
- 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 +3 -7
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +3 -3
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +3 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/deltaManager.d.ts +3 -2
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +4 -5
- package/dist/deltaManager.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +9 -5
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +28 -34
- package/dist/loader.js.map +1 -1
- 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.map +1 -1
- package/lib/connectionManager.d.ts +5 -3
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +20 -16
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +11 -9
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +12 -12
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +62 -36
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +72 -90
- 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 +3 -7
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +3 -3
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +3 -3
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/deltaManager.d.ts +3 -2
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +5 -6
- package/lib/deltaManager.js.map +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +9 -5
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +28 -34
- package/lib/loader.js.map +1 -1
- 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.map +1 -1
- package/package.json +27 -10
- package/src/connectionManager.ts +29 -20
- package/src/connectionStateHandler.ts +26 -17
- package/src/container.ts +169 -147
- package/src/containerContext.ts +3 -9
- package/src/containerStorageAdapter.ts +4 -4
- package/src/contracts.ts +3 -3
- package/src/deltaManager.ts +13 -8
- package/src/index.ts +1 -8
- package/src/loader.ts +56 -47
- package/src/packageVersion.ts +1 -1
- package/src/retriableDocumentStorageService.ts +3 -2
package/src/containerContext.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { ITelemetryLoggerExt, PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { assert, LazyPromise, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
8
8
|
import {
|
|
9
9
|
IAudience,
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
} from "@fluidframework/container-definitions";
|
|
26
26
|
import { IRequest, IResponse, FluidObject } from "@fluidframework/core-interfaces";
|
|
27
27
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
28
|
-
import { isFluidResolvedUrl } from "@fluidframework/driver-utils";
|
|
29
28
|
import {
|
|
30
29
|
IClientConfiguration,
|
|
31
30
|
IClientDetails,
|
|
@@ -40,7 +39,6 @@ import {
|
|
|
40
39
|
MessageType,
|
|
41
40
|
ISummaryContent,
|
|
42
41
|
} from "@fluidframework/protocol-definitions";
|
|
43
|
-
import { PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
44
42
|
import { UsageError } from "@fluidframework/container-utils";
|
|
45
43
|
import { Container } from "./container";
|
|
46
44
|
|
|
@@ -101,7 +99,7 @@ export class ContainerContext implements IContainerContext {
|
|
|
101
99
|
return context;
|
|
102
100
|
}
|
|
103
101
|
|
|
104
|
-
public readonly taggedLogger:
|
|
102
|
+
public readonly taggedLogger: ITelemetryLoggerExt;
|
|
105
103
|
public readonly supportedFeatures: ReadonlyMap<string, unknown>;
|
|
106
104
|
|
|
107
105
|
public get clientId(): string | undefined {
|
|
@@ -112,11 +110,7 @@ export class ContainerContext implements IContainerContext {
|
|
|
112
110
|
* DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.
|
|
113
111
|
*/
|
|
114
112
|
public get id(): string {
|
|
115
|
-
|
|
116
|
-
if (isFluidResolvedUrl(resolvedUrl)) {
|
|
117
|
-
return resolvedUrl.id;
|
|
118
|
-
}
|
|
119
|
-
return "";
|
|
113
|
+
return this.container.resolvedUrl?.id ?? "";
|
|
120
114
|
}
|
|
121
115
|
|
|
122
116
|
public get clientDetails(): IClientDetails {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IDisposable
|
|
6
|
+
import { IDisposable } from "@fluidframework/common-definitions";
|
|
7
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
8
|
import { assert, bufferToString, stringToBuffer } from "@fluidframework/common-utils";
|
|
8
9
|
import { ISnapshotTreeWithBlobContents } from "@fluidframework/container-definitions";
|
|
9
10
|
import {
|
|
@@ -27,7 +28,6 @@ import { RetriableDocumentStorageService } from "./retriableDocumentStorageServi
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Stringified blobs from a summary/snapshot tree.
|
|
30
|
-
* @deprecated this is an internal interface and will not longer be exported in future versions
|
|
31
31
|
* @internal
|
|
32
32
|
*/
|
|
33
33
|
export interface ISerializableBlobContents {
|
|
@@ -60,7 +60,7 @@ export class ContainerStorageAdapter implements IDocumentStorageService, IDispos
|
|
|
60
60
|
*/
|
|
61
61
|
public constructor(
|
|
62
62
|
detachedBlobStorage: IDetachedBlobStorage | undefined,
|
|
63
|
-
private readonly logger:
|
|
63
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
64
64
|
/**
|
|
65
65
|
* ArrayBufferLikes or utf8 encoded strings, containing blobs from a snapshot
|
|
66
66
|
*/
|
|
@@ -183,7 +183,7 @@ export class ContainerStorageAdapter implements IDocumentStorageService, IDispos
|
|
|
183
183
|
class BlobOnlyStorage implements IDocumentStorageService {
|
|
184
184
|
constructor(
|
|
185
185
|
private readonly detachedStorage: IDetachedBlobStorage | undefined,
|
|
186
|
-
private readonly logger:
|
|
186
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
187
187
|
) {}
|
|
188
188
|
|
|
189
189
|
public async createBlob(content: ArrayBufferLike): Promise<ICreateBlobResponse> {
|
package/src/contracts.ts
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
IClientDetails,
|
|
21
21
|
ISignalMessage,
|
|
22
22
|
} from "@fluidframework/protocol-definitions";
|
|
23
|
-
import { IContainerPackageInfo } from "@fluidframework/driver-definitions";
|
|
23
|
+
import { IAnyDriverError, IContainerPackageInfo } from "@fluidframework/driver-definitions";
|
|
24
24
|
|
|
25
25
|
export enum ReconnectMode {
|
|
26
26
|
Never = "Never",
|
|
@@ -95,7 +95,7 @@ export interface IConnectionManager {
|
|
|
95
95
|
/**
|
|
96
96
|
* Initiates connection to relay service (noop if already connected).
|
|
97
97
|
*/
|
|
98
|
-
connect(connectionMode?: ConnectionMode): void;
|
|
98
|
+
connect(reason: string, connectionMode?: ConnectionMode): void;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Disposed connection manager
|
|
@@ -139,7 +139,7 @@ export interface IConnectionManagerFactoryArgs {
|
|
|
139
139
|
/**
|
|
140
140
|
* Called whenever connection to relay service is lost.
|
|
141
141
|
*/
|
|
142
|
-
readonly disconnectHandler: (reason: string) => void;
|
|
142
|
+
readonly disconnectHandler: (reason: string, error?: IAnyDriverError) => void;
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* Called whenever new connection to rely service is established
|
package/src/deltaManager.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { default as AbortController } from "abort-controller";
|
|
7
7
|
import { v4 as uuid } from "uuid";
|
|
8
8
|
import {
|
|
9
|
-
ITelemetryLogger,
|
|
10
9
|
IEventProvider,
|
|
11
10
|
ITelemetryProperties,
|
|
12
11
|
ITelemetryErrorEvent,
|
|
@@ -21,11 +20,17 @@ import {
|
|
|
21
20
|
IConnectionDetailsInternal,
|
|
22
21
|
} from "@fluidframework/container-definitions";
|
|
23
22
|
import { assert, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
24
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
normalizeError,
|
|
25
|
+
logIfFalse,
|
|
26
|
+
safeRaiseEvent,
|
|
27
|
+
ITelemetryLoggerExt,
|
|
28
|
+
} from "@fluidframework/telemetry-utils";
|
|
25
29
|
import {
|
|
26
30
|
IDocumentDeltaStorageService,
|
|
27
31
|
IDocumentService,
|
|
28
32
|
DriverErrorType,
|
|
33
|
+
IAnyDriverError,
|
|
29
34
|
} from "@fluidframework/driver-definitions";
|
|
30
35
|
import {
|
|
31
36
|
IDocumentMessage,
|
|
@@ -339,7 +344,7 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
339
344
|
|
|
340
345
|
constructor(
|
|
341
346
|
private readonly serviceProvider: () => IDocumentService | undefined,
|
|
342
|
-
private readonly logger:
|
|
347
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
343
348
|
private readonly _active: () => boolean,
|
|
344
349
|
createConnectionManager: (props: IConnectionManagerFactoryArgs) => TConnectionManager,
|
|
345
350
|
) {
|
|
@@ -357,7 +362,8 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
357
362
|
reconnectionDelayHandler: (delayMs: number, error: unknown) =>
|
|
358
363
|
this.emitDelayInfo(this.deltaStreamDelayId, delayMs, error),
|
|
359
364
|
closeHandler: (error: any) => this.close(error),
|
|
360
|
-
disconnectHandler: (reason: string) =>
|
|
365
|
+
disconnectHandler: (reason: string, error?: IAnyDriverError) =>
|
|
366
|
+
this.disconnectHandler(reason, error),
|
|
361
367
|
connectHandler: (connection: IConnectionDetailsInternal) =>
|
|
362
368
|
this.connectHandler(connection),
|
|
363
369
|
pongHandler: (latency: number) => this.emit("pong", latency),
|
|
@@ -539,7 +545,7 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
539
545
|
this.fetchMissingDeltas(args.reason);
|
|
540
546
|
}
|
|
541
547
|
|
|
542
|
-
this.connectionManager.connect(args.mode);
|
|
548
|
+
this.connectionManager.connect(args.reason, args.mode);
|
|
543
549
|
}
|
|
544
550
|
|
|
545
551
|
private async getDeltas(
|
|
@@ -676,7 +682,6 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
676
682
|
this.disposeInternal(error);
|
|
677
683
|
} else {
|
|
678
684
|
this.emit("closed", error);
|
|
679
|
-
this.disposeInternal(error); // ! TODO: remove this call when Container close no longer disposes
|
|
680
685
|
}
|
|
681
686
|
}
|
|
682
687
|
|
|
@@ -700,9 +705,9 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
700
705
|
}
|
|
701
706
|
}
|
|
702
707
|
|
|
703
|
-
private disconnectHandler(reason: string) {
|
|
708
|
+
private disconnectHandler(reason: string, error?: IAnyDriverError) {
|
|
704
709
|
this.messageBuffer.length = 0;
|
|
705
|
-
this.emit("disconnect", reason);
|
|
710
|
+
this.emit("disconnect", reason, error);
|
|
706
711
|
}
|
|
707
712
|
|
|
708
713
|
/**
|
package/src/index.ts
CHANGED
|
@@ -4,14 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export { ConnectionState } from "./connectionState";
|
|
7
|
-
export {
|
|
8
|
-
IContainerConfig,
|
|
9
|
-
IContainerExperimental,
|
|
10
|
-
IContainerLoadOptions,
|
|
11
|
-
IPendingContainerState,
|
|
12
|
-
waitContainerToCatchUp,
|
|
13
|
-
} from "./container";
|
|
14
|
-
export { ISerializableBlobContents } from "./containerStorageAdapter";
|
|
7
|
+
export { IContainerExperimental, waitContainerToCatchUp } from "./container";
|
|
15
8
|
export {
|
|
16
9
|
ICodeDetailsLoader,
|
|
17
10
|
IDetachedBlobStorage,
|
package/src/loader.ts
CHANGED
|
@@ -4,7 +4,18 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { v4 as uuid } from "uuid";
|
|
7
|
-
import { ITelemetryBaseLogger
|
|
7
|
+
import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
|
|
8
|
+
import {
|
|
9
|
+
ITelemetryLoggerExt,
|
|
10
|
+
ChildLogger,
|
|
11
|
+
DebugLogger,
|
|
12
|
+
IConfigProviderBase,
|
|
13
|
+
loggerToMonitoringContext,
|
|
14
|
+
mixinMonitoringContext,
|
|
15
|
+
MonitoringContext,
|
|
16
|
+
PerformanceEvent,
|
|
17
|
+
sessionStorageConfigProvider,
|
|
18
|
+
} from "@fluidframework/telemetry-utils";
|
|
8
19
|
import {
|
|
9
20
|
FluidObject,
|
|
10
21
|
IFluidRouter,
|
|
@@ -22,24 +33,13 @@ import {
|
|
|
22
33
|
IProvideFluidCodeDetailsComparer,
|
|
23
34
|
IFluidCodeDetails,
|
|
24
35
|
} from "@fluidframework/container-definitions";
|
|
25
|
-
import {
|
|
26
|
-
ChildLogger,
|
|
27
|
-
DebugLogger,
|
|
28
|
-
IConfigProviderBase,
|
|
29
|
-
loggerToMonitoringContext,
|
|
30
|
-
mixinMonitoringContext,
|
|
31
|
-
MonitoringContext,
|
|
32
|
-
PerformanceEvent,
|
|
33
|
-
sessionStorageConfigProvider,
|
|
34
|
-
} from "@fluidframework/telemetry-utils";
|
|
35
36
|
import {
|
|
36
37
|
IDocumentServiceFactory,
|
|
37
38
|
IDocumentStorageService,
|
|
38
|
-
|
|
39
|
+
IResolvedUrl,
|
|
39
40
|
IUrlResolver,
|
|
40
41
|
} from "@fluidframework/driver-definitions";
|
|
41
42
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
42
|
-
import { ensureFluidResolvedUrl } from "@fluidframework/driver-utils";
|
|
43
43
|
import { Container, IPendingContainerState } from "./container";
|
|
44
44
|
import { IParsedUrl, parseUrl } from "./utils";
|
|
45
45
|
import { pkgVersion } from "./packageVersion";
|
|
@@ -53,8 +53,15 @@ function canUseCache(request: IRequest): boolean {
|
|
|
53
53
|
return request.headers[LoaderHeader.cache] !== false;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
function ensureResolvedUrlDefined(
|
|
57
|
+
resolved: IResolvedUrl | undefined,
|
|
58
|
+
): asserts resolved is IResolvedUrl {
|
|
59
|
+
if (resolved === undefined) {
|
|
60
|
+
throw new Error(`Object is not a IResolveUrl.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
56
63
|
/**
|
|
57
|
-
* @
|
|
64
|
+
* @internal
|
|
58
65
|
*/
|
|
59
66
|
export class RelativeLoader implements ILoader {
|
|
60
67
|
constructor(
|
|
@@ -71,15 +78,19 @@ export class RelativeLoader implements ILoader {
|
|
|
71
78
|
if (canUseCache(request)) {
|
|
72
79
|
return this.container;
|
|
73
80
|
} else {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
ensureResolvedUrlDefined(this.container.resolvedUrl);
|
|
82
|
+
const container = await Container.clone(
|
|
83
|
+
this.container,
|
|
84
|
+
{
|
|
85
|
+
resolvedUrl: { ...this.container.resolvedUrl },
|
|
86
|
+
version: request.headers?.[LoaderHeader.version] ?? undefined,
|
|
87
|
+
loadMode: request.headers?.[LoaderHeader.loadMode],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
canReconnect: request.headers?.[LoaderHeader.reconnect],
|
|
91
|
+
clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],
|
|
92
|
+
},
|
|
93
|
+
);
|
|
83
94
|
return container;
|
|
84
95
|
}
|
|
85
96
|
}
|
|
@@ -237,12 +248,18 @@ export interface ILoaderServices {
|
|
|
237
248
|
/**
|
|
238
249
|
* The logger downstream consumers should construct their loggers from
|
|
239
250
|
*/
|
|
240
|
-
readonly subLogger:
|
|
251
|
+
readonly subLogger: ITelemetryLoggerExt;
|
|
241
252
|
|
|
242
253
|
/**
|
|
243
254
|
* Blobs storage for detached containers.
|
|
244
255
|
*/
|
|
245
256
|
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Optional property for allowing the container to use a custom
|
|
260
|
+
* protocol implementation for handling the quorum and/or the audience.
|
|
261
|
+
*/
|
|
262
|
+
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
|
246
263
|
}
|
|
247
264
|
|
|
248
265
|
/**
|
|
@@ -266,7 +283,7 @@ export async function requestResolvedObjectFromContainer(
|
|
|
266
283
|
container: IContainer,
|
|
267
284
|
headers?: IRequestHeader,
|
|
268
285
|
): Promise<IResponse> {
|
|
269
|
-
|
|
286
|
+
ensureResolvedUrlDefined(container.resolvedUrl);
|
|
270
287
|
const parsedUrl = parseUrl(container.resolvedUrl.url);
|
|
271
288
|
|
|
272
289
|
if (parsedUrl === undefined) {
|
|
@@ -289,7 +306,6 @@ export class Loader implements IHostLoader {
|
|
|
289
306
|
private readonly containers = new Map<string, Promise<Container>>();
|
|
290
307
|
public readonly services: ILoaderServices;
|
|
291
308
|
private readonly mc: MonitoringContext;
|
|
292
|
-
private readonly protocolHandlerBuilder: ProtocolHandlerBuilder | undefined;
|
|
293
309
|
|
|
294
310
|
constructor(loaderProps: ILoaderProps) {
|
|
295
311
|
const scope: FluidObject<ILoader> = { ...loaderProps.scope };
|
|
@@ -310,16 +326,12 @@ export class Loader implements IHostLoader {
|
|
|
310
326
|
);
|
|
311
327
|
|
|
312
328
|
this.services = {
|
|
313
|
-
|
|
314
|
-
documentServiceFactory: loaderProps.documentServiceFactory,
|
|
315
|
-
codeLoader: loaderProps.codeLoader,
|
|
316
|
-
options: loaderProps.options ?? {},
|
|
329
|
+
...loaderProps,
|
|
317
330
|
scope,
|
|
318
331
|
subLogger: subMc.logger,
|
|
319
|
-
|
|
332
|
+
options: loaderProps.options ?? {},
|
|
320
333
|
};
|
|
321
334
|
this.mc = loggerToMonitoringContext(ChildLogger.create(this.services.subLogger, "Loader"));
|
|
322
|
-
this.protocolHandlerBuilder = loaderProps.protocolHandlerBuilder;
|
|
323
335
|
}
|
|
324
336
|
|
|
325
337
|
public get IFluidRouter(): IFluidRouter {
|
|
@@ -327,15 +339,11 @@ export class Loader implements IHostLoader {
|
|
|
327
339
|
}
|
|
328
340
|
|
|
329
341
|
public async createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer> {
|
|
330
|
-
const container = await Container.createDetached(
|
|
331
|
-
this,
|
|
332
|
-
codeDetails,
|
|
333
|
-
this.protocolHandlerBuilder,
|
|
334
|
-
);
|
|
342
|
+
const container = await Container.createDetached(this.services, codeDetails);
|
|
335
343
|
|
|
336
344
|
if (this.cachingEnabled) {
|
|
337
345
|
container.once("attached", () => {
|
|
338
|
-
|
|
346
|
+
ensureResolvedUrlDefined(container.resolvedUrl);
|
|
339
347
|
const parsedUrl = parseUrl(container.resolvedUrl.url);
|
|
340
348
|
if (parsedUrl !== undefined) {
|
|
341
349
|
this.addToContainerCache(parsedUrl.id, Promise.resolve(container));
|
|
@@ -347,7 +355,7 @@ export class Loader implements IHostLoader {
|
|
|
347
355
|
}
|
|
348
356
|
|
|
349
357
|
public async rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer> {
|
|
350
|
-
return Container.rehydrateDetachedFromSnapshot(this, snapshot
|
|
358
|
+
return Container.rehydrateDetachedFromSnapshot(this.services, snapshot);
|
|
351
359
|
}
|
|
352
360
|
|
|
353
361
|
public async resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer> {
|
|
@@ -404,7 +412,7 @@ export class Loader implements IHostLoader {
|
|
|
404
412
|
pendingLocalState?: IPendingContainerState,
|
|
405
413
|
): Promise<{ container: Container; parsed: IParsedUrl }> {
|
|
406
414
|
const resolvedAsFluid = await this.services.urlResolver.resolve(request);
|
|
407
|
-
|
|
415
|
+
ensureResolvedUrlDefined(resolvedAsFluid);
|
|
408
416
|
|
|
409
417
|
// Parse URL into data stores
|
|
410
418
|
const parsed = parseUrl(resolvedAsFluid.url);
|
|
@@ -489,20 +497,21 @@ export class Loader implements IHostLoader {
|
|
|
489
497
|
|
|
490
498
|
private async loadContainer(
|
|
491
499
|
request: IRequest,
|
|
492
|
-
|
|
500
|
+
resolvedUrl: IResolvedUrl,
|
|
493
501
|
pendingLocalState?: IPendingContainerState,
|
|
494
502
|
): Promise<Container> {
|
|
495
503
|
return Container.load(
|
|
496
|
-
this,
|
|
497
504
|
{
|
|
498
|
-
|
|
499
|
-
clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],
|
|
500
|
-
resolvedUrl: resolved,
|
|
505
|
+
resolvedUrl,
|
|
501
506
|
version: request.headers?.[LoaderHeader.version] ?? undefined,
|
|
502
507
|
loadMode: request.headers?.[LoaderHeader.loadMode],
|
|
508
|
+
pendingLocalState,
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
canReconnect: request.headers?.[LoaderHeader.reconnect],
|
|
512
|
+
clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],
|
|
513
|
+
...this.services,
|
|
503
514
|
},
|
|
504
|
-
pendingLocalState,
|
|
505
|
-
this.protocolHandlerBuilder,
|
|
506
515
|
);
|
|
507
516
|
}
|
|
508
517
|
}
|
package/src/packageVersion.ts
CHANGED
|
@@ -18,14 +18,15 @@ import {
|
|
|
18
18
|
ISummaryTree,
|
|
19
19
|
IVersion,
|
|
20
20
|
} from "@fluidframework/protocol-definitions";
|
|
21
|
-
import { IDisposable
|
|
21
|
+
import { IDisposable } from "@fluidframework/common-definitions";
|
|
22
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
22
23
|
import { runWithRetry } from "@fluidframework/driver-utils";
|
|
23
24
|
|
|
24
25
|
export class RetriableDocumentStorageService implements IDocumentStorageService, IDisposable {
|
|
25
26
|
private _disposed = false;
|
|
26
27
|
constructor(
|
|
27
28
|
private readonly internalStorageService: IDocumentStorageService,
|
|
28
|
-
private readonly logger:
|
|
29
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
29
30
|
) {}
|
|
30
31
|
|
|
31
32
|
public get policies(): IDocumentStorageServicePolicies | undefined {
|