@fluidframework/container-loader 0.59.4001 → 1.1.0-75972
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/.eslintrc.js +1 -1
- package/README.md +1 -1
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +3 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionState.d.ts +15 -3
- package/dist/connectionState.d.ts.map +1 -1
- package/dist/connectionState.js +15 -3
- package/dist/connectionState.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +47 -11
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +108 -38
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +20 -28
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +97 -153
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +6 -4
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +8 -7
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +4 -5
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +4 -7
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.js +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +9 -1
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaManagerProxy.d.ts +0 -1
- package/dist/deltaManagerProxy.d.ts.map +1 -1
- package/dist/deltaManagerProxy.js +0 -3
- package/dist/deltaManagerProxy.js.map +1 -1
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/deltaQueue.js +8 -3
- package/dist/deltaQueue.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -13
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +2 -3
- package/dist/loader.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts +2 -3
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js +0 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +3 -4
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +4 -7
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -2
- package/dist/utils.js.map +1 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +4 -2
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionState.d.ts +15 -3
- package/lib/connectionState.d.ts.map +1 -1
- package/lib/connectionState.js +15 -3
- package/lib/connectionState.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +47 -11
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +108 -38
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +20 -28
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +98 -154
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +6 -4
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +8 -7
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +4 -5
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +4 -7
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +1 -1
- package/lib/contracts.js +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +9 -1
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaManagerProxy.d.ts +0 -1
- package/lib/deltaManagerProxy.d.ts.map +1 -1
- package/lib/deltaManagerProxy.js +0 -3
- package/lib/deltaManagerProxy.js.map +1 -1
- package/lib/deltaQueue.d.ts.map +1 -1
- package/lib/deltaQueue.js +8 -3
- package/lib/deltaQueue.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +1 -13
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +2 -3
- package/lib/loader.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts +2 -3
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js +0 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +3 -4
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +4 -7
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +3 -2
- package/lib/utils.js.map +1 -1
- package/package.json +14 -27
- package/src/connectionManager.ts +4 -6
- package/src/connectionState.ts +20 -6
- package/src/connectionStateHandler.ts +136 -56
- package/src/container.ts +139 -185
- package/src/containerContext.ts +10 -10
- package/src/containerStorageAdapter.ts +5 -10
- package/src/contracts.ts +1 -1
- package/src/deltaManager.ts +8 -2
- package/src/deltaManagerProxy.ts +0 -4
- package/src/deltaQueue.ts +7 -3
- package/src/index.ts +1 -0
- package/src/loader.ts +4 -21
- package/src/packageVersion.ts +1 -1
- package/src/protocolTreeDocumentStorageService.ts +0 -1
- package/src/retriableDocumentStorageService.ts +4 -12
- package/src/utils.ts +3 -2
package/src/containerContext.ts
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
IProvideFluidCodeDetailsComparer,
|
|
22
22
|
ICodeDetailsLoader,
|
|
23
23
|
IFluidModuleWithDetails,
|
|
24
|
-
|
|
24
|
+
ISnapshotTreeWithBlobContents,
|
|
25
25
|
} from "@fluidframework/container-definitions";
|
|
26
26
|
import {
|
|
27
27
|
IRequest,
|
|
@@ -92,7 +92,9 @@ export class ContainerContext implements IContainerContext {
|
|
|
92
92
|
return this.container.clientId;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.
|
|
97
|
+
*/
|
|
96
98
|
public get id(): string {
|
|
97
99
|
const resolvedUrl = this.container.resolvedUrl;
|
|
98
100
|
if (isFluidResolvedUrl(resolvedUrl)) {
|
|
@@ -159,7 +161,7 @@ export class ContainerContext implements IContainerContext {
|
|
|
159
161
|
public readonly scope: FluidObject,
|
|
160
162
|
private readonly codeLoader: ICodeDetailsLoader,
|
|
161
163
|
private readonly _codeDetails: IFluidCodeDetails,
|
|
162
|
-
private
|
|
164
|
+
private _baseSnapshot: ISnapshotTree | undefined,
|
|
163
165
|
public readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
|
|
164
166
|
quorum: IQuorum,
|
|
165
167
|
public readonly loader: ILoader,
|
|
@@ -287,7 +289,9 @@ export class ContainerContext implements IContainerContext {
|
|
|
287
289
|
return true;
|
|
288
290
|
}
|
|
289
291
|
|
|
290
|
-
public notifyAttaching() {
|
|
292
|
+
public notifyAttaching(snapshot: ISnapshotTreeWithBlobContents) {
|
|
293
|
+
this._baseSnapshot = snapshot;
|
|
294
|
+
this.runtime.notifyAttaching?.(snapshot);
|
|
291
295
|
this.runtime.setAttachState(AttachState.Attaching);
|
|
292
296
|
}
|
|
293
297
|
|
|
@@ -316,11 +320,7 @@ export class ContainerContext implements IContainerContext {
|
|
|
316
320
|
}
|
|
317
321
|
|
|
318
322
|
private async loadCodeModule(codeDetails: IFluidCodeDetails): Promise<IFluidModuleWithDetails> {
|
|
319
|
-
|
|
320
|
-
// Because the type system currently does not capture this in load,
|
|
321
|
-
// explicitly declare the type here to support both cases.
|
|
322
|
-
// See also comment about this below.
|
|
323
|
-
const loadCodeResult: IFluidModuleWithDetails | IFluidModule = await PerformanceEvent.timedExecAsync(
|
|
323
|
+
const loadCodeResult = await PerformanceEvent.timedExecAsync(
|
|
324
324
|
this.taggedLogger,
|
|
325
325
|
{ eventName: "CodeLoad" },
|
|
326
326
|
async () => this.codeLoader.load(codeDetails),
|
|
@@ -336,7 +336,7 @@ export class ContainerContext implements IContainerContext {
|
|
|
336
336
|
// If "module" is not in the result, we are using a legacy ICodeLoader. Fix the result up with details.
|
|
337
337
|
// Once usage drops to 0 we can remove this compat path.
|
|
338
338
|
this.taggedLogger.sendTelemetryEvent({ eventName: "LegacyCodeLoader" });
|
|
339
|
-
return
|
|
339
|
+
return loadCodeResult;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
// #endregion
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
7
|
+
import { ISnapshotTreeWithBlobContents } from "@fluidframework/container-definitions";
|
|
7
8
|
import {
|
|
8
9
|
IDocumentStorageService,
|
|
9
10
|
IDocumentStorageServicePolicies,
|
|
@@ -14,11 +15,9 @@ import {
|
|
|
14
15
|
ISnapshotTree,
|
|
15
16
|
ISummaryHandle,
|
|
16
17
|
ISummaryTree,
|
|
17
|
-
ITree,
|
|
18
18
|
IVersion,
|
|
19
19
|
} from "@fluidframework/protocol-definitions";
|
|
20
20
|
import { IDetachedBlobStorage } from "./loader";
|
|
21
|
-
import { ISnapshotTreeWithBlobContents } from "./utils";
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* This class wraps the actual storage and make sure no wrong apis are called according to
|
|
@@ -54,8 +53,8 @@ export class ContainerStorageAdapter implements IDocumentStorageService {
|
|
|
54
53
|
return this.storageGetter().repositoryUrl;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
|
|
58
|
-
return this.storageGetter().getSnapshotTree(version);
|
|
56
|
+
public async getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null> {
|
|
57
|
+
return this.storageGetter().getSnapshotTree(version, scenarioName);
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
public async readBlob(id: string): Promise<ArrayBufferLike> {
|
|
@@ -66,12 +65,8 @@ export class ContainerStorageAdapter implements IDocumentStorageService {
|
|
|
66
65
|
return this.storageGetter().readBlob(id);
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
|
|
70
|
-
return this.storageGetter().getVersions(versionId, count);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public async write(tree: ITree, parents: string[], message: string, ref: string): Promise<IVersion> {
|
|
74
|
-
return this.storageGetter().write(tree, parents, message, ref);
|
|
68
|
+
public async getVersions(versionId: string | null, count: number, scenarioName?: string): Promise<IVersion[]> {
|
|
69
|
+
return this.storageGetter().getVersions(versionId, count, scenarioName);
|
|
75
70
|
}
|
|
76
71
|
|
|
77
72
|
public async uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string> {
|
package/src/contracts.ts
CHANGED
|
@@ -163,7 +163,7 @@ export interface IConnectionManagerFactoryArgs {
|
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
*
|
|
166
|
-
* @param codeDetails- Data structure used to describe the code to load on the Fluid document
|
|
166
|
+
* @param codeDetails- - Data structure used to describe the code to load on the Fluid document
|
|
167
167
|
* @returns The name of the Fluid package
|
|
168
168
|
*/
|
|
169
169
|
export const getPackageName = (codeDetails: IFluidCodeDetails | undefined): IContainerPackageInfo => {
|
package/src/deltaManager.ts
CHANGED
|
@@ -267,8 +267,14 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
267
267
|
) {
|
|
268
268
|
super();
|
|
269
269
|
const props: IConnectionManagerFactoryArgs = {
|
|
270
|
-
incomingOpHandler: (messages: ISequencedDocumentMessage[], reason: string) =>
|
|
271
|
-
|
|
270
|
+
incomingOpHandler: (messages: ISequencedDocumentMessage[], reason: string) => {
|
|
271
|
+
try {
|
|
272
|
+
this.enqueueMessages(messages, reason);
|
|
273
|
+
} catch (error) {
|
|
274
|
+
this.logger.sendErrorEvent({ eventName: "EnqueueMessages_Exception" }, error);
|
|
275
|
+
this.close(normalizeError(error));
|
|
276
|
+
}
|
|
277
|
+
},
|
|
272
278
|
signalHandler: (message: ISignalMessage) => this._inboundSignal.push(message),
|
|
273
279
|
reconnectionDelayHandler: (delayMs: number, error: unknown) =>
|
|
274
280
|
this.emitDelayInfo(this.deltaStreamDelayId, delayMs, error),
|
package/src/deltaManagerProxy.ts
CHANGED
package/src/deltaQueue.ts
CHANGED
|
@@ -85,9 +85,13 @@ export class DeltaQueue<T>
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
public push(task: T) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
try {
|
|
89
|
+
this.q.push(task);
|
|
90
|
+
this.emit("push", task);
|
|
91
|
+
this.ensureProcessing();
|
|
92
|
+
} catch (error) {
|
|
93
|
+
this.emit("error", error);
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
public async pause(): Promise<void> {
|
package/src/index.ts
CHANGED
package/src/loader.ts
CHANGED
|
@@ -17,9 +17,7 @@ import {
|
|
|
17
17
|
IFluidModule,
|
|
18
18
|
IHostLoader,
|
|
19
19
|
ILoader,
|
|
20
|
-
IPendingLocalState,
|
|
21
20
|
ILoaderOptions as ILoaderOptions1,
|
|
22
|
-
IProxyLoaderFactory,
|
|
23
21
|
LoaderHeader,
|
|
24
22
|
IProvideFluidCodeDetailsComparer,
|
|
25
23
|
IFluidCodeDetails,
|
|
@@ -47,7 +45,7 @@ import {
|
|
|
47
45
|
MultiUrlResolver,
|
|
48
46
|
MultiDocumentServiceFactory,
|
|
49
47
|
} from "@fluidframework/driver-utils";
|
|
50
|
-
import { Container } from "./container";
|
|
48
|
+
import { Container, IPendingContainerState } from "./container";
|
|
51
49
|
import { IParsedUrl, parseUrl } from "./utils";
|
|
52
50
|
import { pkgVersion } from "./packageVersion";
|
|
53
51
|
|
|
@@ -200,13 +198,6 @@ export interface ILoaderProps {
|
|
|
200
198
|
*/
|
|
201
199
|
readonly scope?: FluidObject;
|
|
202
200
|
|
|
203
|
-
/**
|
|
204
|
-
* Proxy loader factories for loading containers via proxy in other contexts,
|
|
205
|
-
* like web workers, or worker threads.
|
|
206
|
-
* @deprecated Not recommended for general use and will be removed in an upcoming release.
|
|
207
|
-
*/
|
|
208
|
-
readonly proxyLoaderFactories?: Map<string, IProxyLoaderFactory>;
|
|
209
|
-
|
|
210
201
|
/**
|
|
211
202
|
* The logger that all telemetry should be pushed to.
|
|
212
203
|
*/
|
|
@@ -257,13 +248,6 @@ export interface ILoaderServices {
|
|
|
257
248
|
*/
|
|
258
249
|
readonly scope: FluidObject;
|
|
259
250
|
|
|
260
|
-
/**
|
|
261
|
-
* Proxy loader factories for loading containers via proxy in other contexts,
|
|
262
|
-
* like web workers, or worker threads.
|
|
263
|
-
* @deprecated Not recommended for general use and will be removed in an upcoming release.
|
|
264
|
-
*/
|
|
265
|
-
readonly proxyLoaderFactories: Map<string, IProxyLoaderFactory>;
|
|
266
|
-
|
|
267
251
|
/**
|
|
268
252
|
* The logger downstream consumers should construct their loggers from
|
|
269
253
|
*/
|
|
@@ -318,7 +302,6 @@ export class Loader implements IHostLoader {
|
|
|
318
302
|
options: loaderProps.options ?? {},
|
|
319
303
|
scope,
|
|
320
304
|
subLogger: subMc.logger,
|
|
321
|
-
proxyLoaderFactories: loaderProps.proxyLoaderFactories ?? new Map<string, IProxyLoaderFactory>(),
|
|
322
305
|
detachedBlobStorage: loaderProps.detachedBlobStorage,
|
|
323
306
|
};
|
|
324
307
|
this.mc = loggerToMonitoringContext(
|
|
@@ -394,7 +377,7 @@ export class Loader implements IHostLoader {
|
|
|
394
377
|
|
|
395
378
|
private async resolveCore(
|
|
396
379
|
request: IRequest,
|
|
397
|
-
pendingLocalState?:
|
|
380
|
+
pendingLocalState?: IPendingContainerState,
|
|
398
381
|
): Promise<{ container: Container; parsed: IParsedUrl; }> {
|
|
399
382
|
const resolvedAsFluid = await this.services.urlResolver.resolve(request);
|
|
400
383
|
ensureFluidResolvedUrl(resolvedAsFluid);
|
|
@@ -436,7 +419,7 @@ export class Loader implements IHostLoader {
|
|
|
436
419
|
await this.loadContainer(
|
|
437
420
|
request,
|
|
438
421
|
resolvedAsFluid,
|
|
439
|
-
pendingLocalState
|
|
422
|
+
pendingLocalState);
|
|
440
423
|
}
|
|
441
424
|
|
|
442
425
|
if (container.deltaManager.lastSequenceNumber <= fromSequenceNumber) {
|
|
@@ -487,7 +470,7 @@ export class Loader implements IHostLoader {
|
|
|
487
470
|
private async loadContainer(
|
|
488
471
|
request: IRequest,
|
|
489
472
|
resolved: IFluidResolvedUrl,
|
|
490
|
-
pendingLocalState?:
|
|
473
|
+
pendingLocalState?: IPendingContainerState,
|
|
491
474
|
): Promise<Container> {
|
|
492
475
|
return Container.load(
|
|
493
476
|
this,
|
package/src/packageVersion.ts
CHANGED
|
@@ -31,7 +31,6 @@ export class ProtocolTreeStorageService implements IDocumentStorageService, IDis
|
|
|
31
31
|
|
|
32
32
|
getSnapshotTree = this.internalStorageService.getSnapshotTree.bind(this.internalStorageService);
|
|
33
33
|
getVersions = this.internalStorageService.getVersions.bind(this.internalStorageService);
|
|
34
|
-
write = this.internalStorageService.write.bind(this.internalStorageService);
|
|
35
34
|
createBlob = this.internalStorageService.createBlob.bind(this.internalStorageService);
|
|
36
35
|
readBlob = this.internalStorageService.readBlob.bind(this.internalStorageService);
|
|
37
36
|
downloadSummary = this.internalStorageService.downloadSummary.bind(this.internalStorageService);
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
ISnapshotTree,
|
|
16
16
|
ISummaryHandle,
|
|
17
17
|
ISummaryTree,
|
|
18
|
-
ITree,
|
|
19
18
|
IVersion,
|
|
20
19
|
} from "@fluidframework/protocol-definitions";
|
|
21
20
|
import { IDisposable, ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
@@ -41,9 +40,9 @@ export class RetriableDocumentStorageService implements IDocumentStorageService,
|
|
|
41
40
|
return this.internalStorageService.repositoryUrl;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
|
|
43
|
+
public async getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null> {
|
|
45
44
|
return this.runWithRetry(
|
|
46
|
-
async () => this.internalStorageService.getSnapshotTree(version),
|
|
45
|
+
async () => this.internalStorageService.getSnapshotTree(version, scenarioName),
|
|
47
46
|
"storage_getSnapshotTree",
|
|
48
47
|
);
|
|
49
48
|
}
|
|
@@ -55,20 +54,13 @@ export class RetriableDocumentStorageService implements IDocumentStorageService,
|
|
|
55
54
|
);
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
|
|
57
|
+
public async getVersions(versionId: string | null, count: number, scenarioName?: string): Promise<IVersion[]> {
|
|
59
58
|
return this.runWithRetry(
|
|
60
|
-
async () => this.internalStorageService.getVersions(versionId, count),
|
|
59
|
+
async () => this.internalStorageService.getVersions(versionId, count, scenarioName),
|
|
61
60
|
"storage_getVersions",
|
|
62
61
|
);
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
public async write(tree: ITree, parents: string[], message: string, ref: string): Promise<IVersion> {
|
|
66
|
-
return this.runWithRetry(
|
|
67
|
-
async () => this.internalStorageService.write(tree, parents, message, ref),
|
|
68
|
-
"storage_write",
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
64
|
public async uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string> {
|
|
73
65
|
// Not using retry loop here. Couple reasons:
|
|
74
66
|
// 1. If client lost connectivity, then retry loop will result in uploading stale summary
|
package/src/utils.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
unreachableCase,
|
|
13
13
|
} from "@fluidframework/common-utils";
|
|
14
14
|
import { ISummaryTree, ISnapshotTree, SummaryType } from "@fluidframework/protocol-definitions";
|
|
15
|
+
import { LoggingError } from "@fluidframework/telemetry-utils";
|
|
15
16
|
|
|
16
17
|
// This is used when we rehydrate a container from the snapshot. Here we put the blob contents
|
|
17
18
|
// in separate property: blobContents.
|
|
@@ -35,7 +36,7 @@ export interface IParsedUrl {
|
|
|
35
36
|
export function parseUrl(url: string): IParsedUrl | undefined {
|
|
36
37
|
const parsed = parse(url, true);
|
|
37
38
|
if (typeof parsed.pathname !== "string") {
|
|
38
|
-
throw new
|
|
39
|
+
throw new LoggingError("Failed to parse pathname");
|
|
39
40
|
}
|
|
40
41
|
const query = parsed.search ?? "";
|
|
41
42
|
const regex = /^\/([^/]*\/[^/]*)(\/?.*)$/;
|
|
@@ -86,7 +87,7 @@ function convertSummaryToSnapshotWithEmbeddedBlobContents(
|
|
|
86
87
|
break;
|
|
87
88
|
}
|
|
88
89
|
case SummaryType.Handle:
|
|
89
|
-
throw new
|
|
90
|
+
throw new LoggingError("No handles should be there in summary in detached container!!");
|
|
90
91
|
break;
|
|
91
92
|
default: {
|
|
92
93
|
unreachableCase(summaryObject, `Unknown tree type ${(summaryObject as any).type}`);
|