@fluidframework/datastore 2.1.0-276985 → 2.1.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 +4 -0
- package/README.md +93 -2
- package/api-extractor/api-extractor.current.json +5 -0
- package/api-extractor/api-extractor.legacy.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/datastore.legacy.public.api.md +9 -0
- package/dist/channelStorageService.d.ts.map +1 -1
- package/dist/channelStorageService.js +8 -8
- package/dist/channelStorageService.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +19 -14
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/legacy.d.ts +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/public.d.ts +1 -1
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/channelStorageService.d.ts.map +1 -1
- package/lib/channelStorageService.js +6 -6
- package/lib/channelStorageService.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +19 -14
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/legacy.d.ts +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/public.d.ts +1 -1
- package/package.json +28 -26
- package/src/channelStorageService.ts +7 -7
- package/src/dataStoreRuntime.ts +17 -13
- package/src/packageVersion.ts +1 -1
- package/tsconfig.json +0 -1
package/src/dataStoreRuntime.ts
CHANGED
|
@@ -255,7 +255,7 @@ export class FluidDataStoreRuntime
|
|
|
255
255
|
|
|
256
256
|
// Must always receive the data store type inside of the attributes
|
|
257
257
|
if (tree?.trees !== undefined) {
|
|
258
|
-
Object.
|
|
258
|
+
Object.entries(tree.trees).forEach(([path, subtree]) => {
|
|
259
259
|
// Issue #4414
|
|
260
260
|
if (path === "_search") {
|
|
261
261
|
return;
|
|
@@ -266,7 +266,7 @@ export class FluidDataStoreRuntime
|
|
|
266
266
|
// container from snapshot where we load detached container from a snapshot, isLocalDataStore would be
|
|
267
267
|
// true. In this case create a RehydratedLocalChannelContext.
|
|
268
268
|
if (dataStoreContext.isLocalDataStore) {
|
|
269
|
-
channelContext = this.createRehydratedLocalChannelContext(path,
|
|
269
|
+
channelContext = this.createRehydratedLocalChannelContext(path, subtree);
|
|
270
270
|
// This is the case of rehydrating a detached container from snapshot. Now due to delay loading of
|
|
271
271
|
// data store, if the data store is loaded after the container is attached, then we missed making
|
|
272
272
|
// the channel visible. So do it now. Otherwise, add it to local channel context queue, so
|
|
@@ -284,7 +284,7 @@ export class FluidDataStoreRuntime
|
|
|
284
284
|
(content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata),
|
|
285
285
|
(address: string) => this.setChannelDirty(address),
|
|
286
286
|
path,
|
|
287
|
-
|
|
287
|
+
subtree,
|
|
288
288
|
this.sharedObjectRegistry,
|
|
289
289
|
undefined /* extraBlobs */,
|
|
290
290
|
this.dataStoreContext.getCreateChildSummarizerNodeFn(path, {
|
|
@@ -362,17 +362,19 @@ export class FluidDataStoreRuntime
|
|
|
362
362
|
return await this.request(parser.createSubRequest(1));
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
365
|
+
if (id !== undefined) {
|
|
366
|
+
// Check for a data type reference first
|
|
367
|
+
const context = this.contexts.get(id);
|
|
368
|
+
if (context !== undefined && parser.isLeaf(1)) {
|
|
369
|
+
try {
|
|
370
|
+
const channel = await context.getChannel();
|
|
370
371
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
return { mimeType: "fluid/object", status: 200, value: channel };
|
|
373
|
+
} catch (error) {
|
|
374
|
+
this.mc.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
|
|
374
375
|
|
|
375
|
-
|
|
376
|
+
return createResponseError(500, `Failed to get Channel: ${error}`, request);
|
|
377
|
+
}
|
|
376
378
|
}
|
|
377
379
|
}
|
|
378
380
|
|
|
@@ -850,7 +852,9 @@ export class FluidDataStoreRuntime
|
|
|
850
852
|
0x181 /* "BaseSnapshot should be there as detached container loaded from snapshot" */,
|
|
851
853
|
);
|
|
852
854
|
summaryTree = convertSnapshotTreeToSummaryTree(
|
|
853
|
-
|
|
855
|
+
// TODO why are we non null asserting here?
|
|
856
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
857
|
+
this.dataStoreContext.baseSnapshot.trees[contextId]!,
|
|
854
858
|
);
|
|
855
859
|
}
|
|
856
860
|
summaryBuilder.addWithStats(contextId, summaryTree);
|
package/src/packageVersion.ts
CHANGED