@fluidframework/container-loader 2.0.0-rc.4.0.6 → 2.0.0-rc.4.0.7

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.
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { IDetachedBlobStorage } from "./loader.js";
6
- export declare function serializeMemoryDetachedBlobStorage(detachedStorage: IDetachedBlobStorage): string | undefined;
7
- export declare function tryInitializeMemoryDetachedBlobStorage(detachedStorage: IDetachedBlobStorage, attachmentBlobs: string): void;
6
+ export declare function serializeMemoryDetachedBlobStorage(detachedStorage: IDetachedBlobStorage | undefined): string | undefined;
7
+ export declare function tryInitializeMemoryDetachedBlobStorage(detachedStorage: IDetachedBlobStorage | undefined, attachmentBlobs: string): void;
8
8
  export declare function createMemoryDetachedBlobStorage(): IDetachedBlobStorage;
9
9
  //# sourceMappingURL=memoryBlobStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"memoryBlobStorage.d.ts","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAsBxD,wBAAgB,kCAAkC,CAEjD,eAAe,EAAE,oBAAoB,GACnC,MAAM,GAAG,SAAS,CAIpB;AAED,wBAAgB,sCAAsC,CAErD,eAAe,EAAE,oBAAoB,EACrC,eAAe,EAAE,MAAM,QAavB;AAGD,wBAAgB,+BAA+B,IAAI,oBAAoB,CAmBtE"}
1
+ {"version":3,"file":"memoryBlobStorage.d.ts","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAsBxD,wBAAgB,kCAAkC,CAEjD,eAAe,EAAE,oBAAoB,GAAG,SAAS,GAC/C,MAAM,GAAG,SAAS,CAQpB;AAED,wBAAgB,sCAAsC,CAErD,eAAe,EAAE,oBAAoB,GAAG,SAAS,EACjD,eAAe,EAAE,MAAM,QAavB;AAGD,wBAAgB,+BAA+B,IAAI,oBAAoB,CAmBtE"}
@@ -15,7 +15,9 @@ detachedStorage) {
15
15
  export function serializeMemoryDetachedBlobStorage(
16
16
  // eslint-disable-next-line import/no-deprecated
17
17
  detachedStorage) {
18
- if (detachedStorage.size > 0 && isMemoryDetachedBlobStorage(detachedStorage)) {
18
+ if (detachedStorage !== undefined &&
19
+ detachedStorage.size > 0 &&
20
+ isMemoryDetachedBlobStorage(detachedStorage)) {
19
21
  return detachedStorage.serialize();
20
22
  }
21
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"memoryBlobStorage.js","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAIvE,MAAM,mCAAmC,GAAG,MAAM,EAAE,CAAC;AASrD,SAAS,2BAA2B;AACnC,gDAAgD;AAChD,eAAqC;IAErC,OAAO,CACN,QAAQ,CAAC,eAAe,CAAC;QACzB,mCAAmC,IAAI,eAAe;QACtD,eAAe,CAAC,mCAAmC,CAAC,KAAK,mCAAmC,CAC5F,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kCAAkC;AACjD,gDAAgD;AAChD,eAAqC;IAErC,IAAI,eAAe,CAAC,IAAI,GAAG,CAAC,IAAI,2BAA2B,CAAC,eAAe,CAAC,EAAE;QAC7E,OAAO,eAAe,CAAC,SAAS,EAAE,CAAC;KACnC;AACF,CAAC;AAED,MAAM,UAAU,sCAAsC;AACrD,gDAAgD;AAChD,eAAqC,EACrC,eAAuB;IAEvB,IAAI,CAAC,2BAA2B,CAAC,eAAe,CAAC,EAAE;QAClD,MAAM,IAAI,KAAK,CACd,6GAA6G,CAC7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,eAAyB,EAAE,EAAE,CACzC,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;KACtF,CAAC;IACF,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICreateBlobResponse } from \"@fluidframework/protocol-definitions\";\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { assert, isObject } from \"@fluidframework/core-utils/internal\";\n// eslint-disable-next-line import/no-deprecated\nimport type { IDetachedBlobStorage } from \"./loader.js\";\n\nconst MemoryDetachedBlobStorageIdentifier = Symbol();\n\n// eslint-disable-next-line import/no-deprecated\ninterface MemoryDetachedBlobStorage extends IDetachedBlobStorage {\n\t[MemoryDetachedBlobStorageIdentifier]: typeof MemoryDetachedBlobStorageIdentifier;\n\tinitialize(attachmentBlobs: string[]): void;\n\tserialize(): string | undefined;\n}\n\nfunction isMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage,\n): detachedStorage is MemoryDetachedBlobStorage {\n\treturn (\n\t\tisObject(detachedStorage) &&\n\t\tMemoryDetachedBlobStorageIdentifier in detachedStorage &&\n\t\tdetachedStorage[MemoryDetachedBlobStorageIdentifier] === MemoryDetachedBlobStorageIdentifier\n\t);\n}\n\nexport function serializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage,\n): string | undefined {\n\tif (detachedStorage.size > 0 && isMemoryDetachedBlobStorage(detachedStorage)) {\n\t\treturn detachedStorage.serialize();\n\t}\n}\n\nexport function tryInitializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage,\n\tattachmentBlobs: string,\n) {\n\tif (!isMemoryDetachedBlobStorage(detachedStorage)) {\n\t\tthrow new Error(\n\t\t\t\"DetachedBlobStorage was not provided to the loader during serialize so cannot be provided during rehydrate.\",\n\t\t);\n\t}\n\n\tassert(detachedStorage.size === 0, \"Blob storage already initialized\");\n\tconst maybeAttachmentBlobs = JSON.parse(attachmentBlobs);\n\tassert(Array.isArray(maybeAttachmentBlobs), \"Invalid attachmentBlobs\");\n\n\tdetachedStorage.initialize(maybeAttachmentBlobs);\n}\n\n// eslint-disable-next-line import/no-deprecated\nexport function createMemoryDetachedBlobStorage(): IDetachedBlobStorage {\n\tconst blobs: ArrayBufferLike[] = [];\n\tconst storage: MemoryDetachedBlobStorage = {\n\t\t[MemoryDetachedBlobStorageIdentifier]: MemoryDetachedBlobStorageIdentifier,\n\t\tcreateBlob: async (file: ArrayBufferLike): Promise<ICreateBlobResponse> => ({\n\t\t\tid: `${blobs.push(file) - 1}`,\n\t\t}),\n\t\treadBlob: async (id: string): Promise<ArrayBufferLike> =>\n\t\t\tblobs[Number(id)] ?? Promise.reject(new Error(`Blob not found: ${id}`)),\n\t\tget size() {\n\t\t\treturn blobs.length;\n\t\t},\n\t\tgetBlobIds: (): string[] => blobs.map((_, i) => `${i}`),\n\t\tdispose: () => blobs.splice(0),\n\t\tserialize: () => JSON.stringify(blobs.map((b) => bufferToString(b, \"utf-8\"))),\n\t\tinitialize: (attachmentBlobs: string[]) =>\n\t\t\tblobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, \"utf-8\"))),\n\t};\n\treturn storage;\n}\n"]}
1
+ {"version":3,"file":"memoryBlobStorage.js","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAIvE,MAAM,mCAAmC,GAAG,MAAM,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CACxD,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,IAAI;YACP,OAAO,KAAK,CAAC,MAAM,CAAC;QACrB,CAAC;QACD,UAAU,EAAE,GAAa,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,UAAU,EAAE,CAAC,eAAyB,EAAE,EAAE,CACzC,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;KACtF,CAAC;IACF,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICreateBlobResponse } from \"@fluidframework/protocol-definitions\";\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { assert, isObject } from \"@fluidframework/core-utils/internal\";\n// eslint-disable-next-line import/no-deprecated\nimport type { IDetachedBlobStorage } from \"./loader.js\";\n\nconst MemoryDetachedBlobStorageIdentifier = Symbol();\n\n// eslint-disable-next-line import/no-deprecated\ninterface MemoryDetachedBlobStorage extends IDetachedBlobStorage {\n\t[MemoryDetachedBlobStorageIdentifier]: typeof MemoryDetachedBlobStorageIdentifier;\n\tinitialize(attachmentBlobs: string[]): void;\n\tserialize(): string | undefined;\n}\n\nfunction isMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n): detachedStorage is MemoryDetachedBlobStorage {\n\treturn (\n\t\tisObject(detachedStorage) &&\n\t\tMemoryDetachedBlobStorageIdentifier in detachedStorage &&\n\t\tdetachedStorage[MemoryDetachedBlobStorageIdentifier] === MemoryDetachedBlobStorageIdentifier\n\t);\n}\n\nexport function serializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n): string | undefined {\n\tif (\n\t\tdetachedStorage !== undefined &&\n\t\tdetachedStorage.size > 0 &&\n\t\tisMemoryDetachedBlobStorage(detachedStorage)\n\t) {\n\t\treturn detachedStorage.serialize();\n\t}\n}\n\nexport function tryInitializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n\tattachmentBlobs: string,\n) {\n\tif (!isMemoryDetachedBlobStorage(detachedStorage)) {\n\t\tthrow new Error(\n\t\t\t\"DetachedBlobStorage was not provided to the loader during serialize so cannot be provided during rehydrate.\",\n\t\t);\n\t}\n\n\tassert(detachedStorage.size === 0, \"Blob storage already initialized\");\n\tconst maybeAttachmentBlobs = JSON.parse(attachmentBlobs);\n\tassert(Array.isArray(maybeAttachmentBlobs), \"Invalid attachmentBlobs\");\n\n\tdetachedStorage.initialize(maybeAttachmentBlobs);\n}\n\n// eslint-disable-next-line import/no-deprecated\nexport function createMemoryDetachedBlobStorage(): IDetachedBlobStorage {\n\tconst blobs: ArrayBufferLike[] = [];\n\tconst storage: MemoryDetachedBlobStorage = {\n\t\t[MemoryDetachedBlobStorageIdentifier]: MemoryDetachedBlobStorageIdentifier,\n\t\tcreateBlob: async (file: ArrayBufferLike): Promise<ICreateBlobResponse> => ({\n\t\t\tid: `${blobs.push(file) - 1}`,\n\t\t}),\n\t\treadBlob: async (id: string): Promise<ArrayBufferLike> =>\n\t\t\tblobs[Number(id)] ?? Promise.reject(new Error(`Blob not found: ${id}`)),\n\t\tget size() {\n\t\t\treturn blobs.length;\n\t\t},\n\t\tgetBlobIds: (): string[] => blobs.map((_, i) => `${i}`),\n\t\tdispose: () => blobs.splice(0),\n\t\tserialize: () => JSON.stringify(blobs.map((b) => bufferToString(b, \"utf-8\"))),\n\t\tinitialize: (attachmentBlobs: string[]) =>\n\t\t\tblobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, \"utf-8\"))),\n\t};\n\treturn storage;\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/container-loader";
8
- export declare const pkgVersion = "2.0.0-rc.4.0.6";
8
+ export declare const pkgVersion = "2.0.0-rc.4.0.7";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/container-loader";
8
- export const pkgVersion = "2.0.0-rc.4.0.6";
8
+ export const pkgVersion = "2.0.0-rc.4.0.7";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.0.0-rc.4.0.6\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.0.0-rc.4.0.7\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "2.0.0-rc.4.0.6",
3
+ "version": "2.0.0-rc.4.0.7",
4
4
  "description": "Fluid container loader",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -117,15 +117,15 @@
117
117
  "temp-directory": "nyc/.nyc_output"
118
118
  },
119
119
  "dependencies": {
120
- "@fluid-internal/client-utils": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
121
- "@fluidframework/container-definitions": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
122
- "@fluidframework/core-interfaces": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
123
- "@fluidframework/core-utils": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
124
- "@fluidframework/driver-definitions": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
125
- "@fluidframework/driver-utils": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
120
+ "@fluid-internal/client-utils": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
121
+ "@fluidframework/container-definitions": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
122
+ "@fluidframework/core-interfaces": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
123
+ "@fluidframework/core-utils": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
124
+ "@fluidframework/driver-definitions": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
125
+ "@fluidframework/driver-utils": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
126
126
  "@fluidframework/protocol-base": "^4.0.0",
127
127
  "@fluidframework/protocol-definitions": "^3.2.0",
128
- "@fluidframework/telemetry-utils": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
128
+ "@fluidframework/telemetry-utils": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
129
129
  "@ungap/structured-clone": "^1.2.0",
130
130
  "debug": "^4.3.4",
131
131
  "double-ended-queue": "^2.1.0-0",
@@ -134,8 +134,8 @@
134
134
  "devDependencies": {
135
135
  "@arethetypeswrong/cli": "^0.15.2",
136
136
  "@biomejs/biome": "^1.6.2",
137
- "@fluid-internal/mocha-test-setup": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
138
- "@fluid-private/test-loader-utils": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0",
137
+ "@fluid-internal/mocha-test-setup": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
138
+ "@fluid-private/test-loader-utils": ">=2.0.0-rc.4.0.7 <2.0.0-rc.4.1.0",
139
139
  "@fluid-tools/build-cli": "^0.38.0",
140
140
  "@fluidframework/build-common": "^2.0.3",
141
141
  "@fluidframework/build-tools": "^0.38.0",
package/src/container.ts CHANGED
@@ -474,7 +474,7 @@ export class Container
474
474
  private readonly scope: FluidObject;
475
475
  private readonly subLogger: ITelemetryLoggerExt;
476
476
  // eslint-disable-next-line import/no-deprecated
477
- private readonly detachedBlobStorage: IDetachedBlobStorage;
477
+ private readonly detachedBlobStorage: IDetachedBlobStorage | undefined;
478
478
  private readonly protocolHandlerBuilder: ProtocolHandlerBuilder;
479
479
  private readonly client: IClient;
480
480
 
@@ -785,7 +785,6 @@ export class Container
785
785
  // Tracking alternative ways to handle this in AB#4129.
786
786
  this.options = { ...options };
787
787
  this.scope = scope;
788
- this.detachedBlobStorage = detachedBlobStorage ?? createMemoryDetachedBlobStorage();
789
788
  this.protocolHandlerBuilder =
790
789
  protocolHandlerBuilder ??
791
790
  ((
@@ -964,6 +963,12 @@ export class Container
964
963
  this.mc.config.getBoolean("Fluid.Container.summarizeProtocolTree2") ??
965
964
  options.summarizeProtocolTree;
966
965
 
966
+ this.detachedBlobStorage =
967
+ detachedBlobStorage ??
968
+ (this.mc.config.getBoolean("Fluid.Container.MemoryBlobStorageEnabled") === true
969
+ ? createMemoryDetachedBlobStorage()
970
+ : undefined);
971
+
967
972
  this.storageAdapter = new ContainerStorageAdapter(
968
973
  this.detachedBlobStorage,
969
974
  this.mc.logger,
@@ -1229,7 +1234,8 @@ export class Container
1229
1234
  baseSnapshot,
1230
1235
  snapshotBlobs,
1231
1236
  pendingRuntimeState,
1232
- hasAttachmentBlobs: this.detachedBlobStorage.size > 0,
1237
+ hasAttachmentBlobs:
1238
+ this.detachedBlobStorage !== undefined && this.detachedBlobStorage.size > 0,
1233
1239
  attachmentBlobs: serializeMemoryDetachedBlobStorage(this.detachedBlobStorage),
1234
1240
  };
1235
1241
  return JSON.stringify(detachedContainerState);
@@ -1350,7 +1356,7 @@ export class Container
1350
1356
  this.serializedStateManager.setInitialSnapshot(snapshotWithBlobs);
1351
1357
 
1352
1358
  if (!this.closed) {
1353
- this.detachedBlobStorage.dispose?.();
1359
+ this.detachedBlobStorage?.dispose?.();
1354
1360
  this.handleDeltaConnectionArg(attachProps?.deltaConnection, {
1355
1361
  fetchOpsFromStorage: false,
1356
1362
  reason: { text: "createDetached" },
@@ -1791,7 +1797,7 @@ export class Container
1791
1797
  tryInitializeMemoryDetachedBlobStorage(this.detachedBlobStorage, attachmentBlobs);
1792
1798
  }
1793
1799
  assert(
1794
- this.detachedBlobStorage.size > 0,
1800
+ this.detachedBlobStorage !== undefined && this.detachedBlobStorage.size > 0,
1795
1801
  0x250 /* "serialized container with attachment blobs must be rehydrated with detached blob storage" */,
1796
1802
  );
1797
1803
  }
@@ -20,7 +20,7 @@ interface MemoryDetachedBlobStorage extends IDetachedBlobStorage {
20
20
 
21
21
  function isMemoryDetachedBlobStorage(
22
22
  // eslint-disable-next-line import/no-deprecated
23
- detachedStorage: IDetachedBlobStorage,
23
+ detachedStorage: IDetachedBlobStorage | undefined,
24
24
  ): detachedStorage is MemoryDetachedBlobStorage {
25
25
  return (
26
26
  isObject(detachedStorage) &&
@@ -31,16 +31,20 @@ function isMemoryDetachedBlobStorage(
31
31
 
32
32
  export function serializeMemoryDetachedBlobStorage(
33
33
  // eslint-disable-next-line import/no-deprecated
34
- detachedStorage: IDetachedBlobStorage,
34
+ detachedStorage: IDetachedBlobStorage | undefined,
35
35
  ): string | undefined {
36
- if (detachedStorage.size > 0 && isMemoryDetachedBlobStorage(detachedStorage)) {
36
+ if (
37
+ detachedStorage !== undefined &&
38
+ detachedStorage.size > 0 &&
39
+ isMemoryDetachedBlobStorage(detachedStorage)
40
+ ) {
37
41
  return detachedStorage.serialize();
38
42
  }
39
43
  }
40
44
 
41
45
  export function tryInitializeMemoryDetachedBlobStorage(
42
46
  // eslint-disable-next-line import/no-deprecated
43
- detachedStorage: IDetachedBlobStorage,
47
+ detachedStorage: IDetachedBlobStorage | undefined,
44
48
  attachmentBlobs: string,
45
49
  ) {
46
50
  if (!isMemoryDetachedBlobStorage(detachedStorage)) {
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.0.0-rc.4.0.6";
9
+ export const pkgVersion = "2.0.0-rc.4.0.7";