@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.
@@ -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.keys(tree.trees).forEach((path) => {
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, tree.trees[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
- tree.trees[path],
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
- // Check for a data type reference first
366
- const context = this.contexts.get(id);
367
- if (context !== undefined && parser.isLeaf(1)) {
368
- try {
369
- const channel = await context.getChannel();
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
- return { mimeType: "fluid/object", status: 200, value: channel };
372
- } catch (error) {
373
- this.mc.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
372
+ return { mimeType: "fluid/object", status: 200, value: channel };
373
+ } catch (error) {
374
+ this.mc.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
374
375
 
375
- return createResponseError(500, `Failed to get Channel: ${error}`, request);
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
- this.dataStoreContext.baseSnapshot.trees[contextId],
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);
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/datastore";
9
- export const pkgVersion = "2.1.0-276985";
9
+ export const pkgVersion = "2.1.0";
package/tsconfig.json CHANGED
@@ -5,7 +5,6 @@
5
5
  "compilerOptions": {
6
6
  "rootDir": "./src",
7
7
  "outDir": "./lib",
8
- "noUncheckedIndexedAccess": false,
9
8
  "exactOptionalPropertyTypes": false,
10
9
  },
11
10
  }