@fluidframework/datastore 2.0.0-internal.5.4.2 → 2.0.0-internal.6.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/datastore",
3
- "version": "2.0.0-internal.5.4.2",
3
+ "version": "2.0.0-internal.6.0.1",
4
4
  "description": "Fluid data store implementation",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -37,29 +37,29 @@
37
37
  "dependencies": {
38
38
  "@fluidframework/common-definitions": "^0.20.1",
39
39
  "@fluidframework/common-utils": "^1.1.1",
40
- "@fluidframework/container-definitions": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
41
- "@fluidframework/container-utils": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
42
- "@fluidframework/core-interfaces": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
43
- "@fluidframework/core-utils": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
44
- "@fluidframework/datastore-definitions": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
45
- "@fluidframework/driver-definitions": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
46
- "@fluidframework/driver-utils": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
47
- "@fluidframework/protocol-base": "^0.1039.1000",
40
+ "@fluidframework/container-definitions": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
41
+ "@fluidframework/container-utils": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
42
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
43
+ "@fluidframework/core-utils": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
44
+ "@fluidframework/datastore-definitions": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
45
+ "@fluidframework/driver-definitions": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
46
+ "@fluidframework/driver-utils": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
47
+ "@fluidframework/protocol-base": "^1.0.0",
48
48
  "@fluidframework/protocol-definitions": "^1.1.0",
49
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
50
- "@fluidframework/runtime-utils": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
51
- "@fluidframework/telemetry-utils": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
49
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
50
+ "@fluidframework/runtime-utils": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
51
+ "@fluidframework/telemetry-utils": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
52
52
  "lodash": "^4.17.21",
53
53
  "uuid": "^8.3.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@fluid-tools/build-cli": "^0.21.0",
57
- "@fluidframework/build-common": "^1.2.0",
57
+ "@fluidframework/build-common": "^2.0.0",
58
58
  "@fluidframework/build-tools": "^0.21.0",
59
- "@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0-internal.5.2.0",
59
+ "@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0-internal.6.0.0",
60
60
  "@fluidframework/eslint-config-fluid": "^2.0.0",
61
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
62
- "@fluidframework/test-runtime-utils": ">=2.0.0-internal.5.4.2 <2.0.0-internal.5.5.0",
61
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
62
+ "@fluidframework/test-runtime-utils": ">=2.0.0-internal.6.0.1 <2.0.0-internal.6.1.0",
63
63
  "@microsoft/api-extractor": "^7.34.4",
64
64
  "@types/mocha": "^9.1.1",
65
65
  "@types/node": "^16.18.38",
@@ -125,6 +125,9 @@ export class FluidDataStoreRuntime
125
125
  */
126
126
  public readonly entryPoint?: IFluidHandle<FluidObject>;
127
127
 
128
+ /**
129
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
130
+ */
128
131
  public get IFluidRouter() {
129
132
  return this;
130
133
  }
@@ -181,7 +184,6 @@ export class FluidDataStoreRuntime
181
184
  }
182
185
 
183
186
  private readonly contexts = new Map<string, IChannelContext>();
184
- private readonly contextsDeferred = new Map<string, Deferred<IChannelContext>>();
185
187
  private readonly pendingAttach = new Map<string, IAttachMessage>();
186
188
 
187
189
  private readonly deferredAttached = new Deferred<void>();
@@ -320,11 +322,8 @@ export class FluidDataStoreRuntime
320
322
  }),
321
323
  );
322
324
  }
323
- const deferred = new Deferred<IChannelContext>();
324
- deferred.resolve(channelContext);
325
325
 
326
326
  this.contexts.set(path, channelContext);
327
- this.contextsDeferred.set(path, deferred);
328
327
  });
329
328
  }
330
329
 
@@ -383,6 +382,9 @@ export class FluidDataStoreRuntime
383
382
  return this.request(request);
384
383
  }
385
384
 
385
+ /**
386
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
387
+ */
386
388
  public async request(request: IRequest): Promise<IResponse> {
387
389
  try {
388
390
  const parser = RequestParser.create(request);
@@ -393,11 +395,10 @@ export class FluidDataStoreRuntime
393
395
  }
394
396
 
395
397
  // Check for a data type reference first
396
- if (this.contextsDeferred.has(id) && parser.isLeaf(1)) {
398
+ const context = this.contexts.get(id);
399
+ if (context !== undefined && parser.isLeaf(1)) {
397
400
  try {
398
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
399
- const value = await this.contextsDeferred.get(id)!.promise;
400
- const channel = await value.getChannel();
401
+ const channel = await context.getChannel();
401
402
 
402
403
  return { mimeType: "fluid/object", status: 200, value: channel };
403
404
  } catch (error) {
@@ -420,18 +421,12 @@ export class FluidDataStoreRuntime
420
421
  public async getChannel(id: string): Promise<IChannel> {
421
422
  this.verifyNotClosed();
422
423
 
423
- // TODO we don't assume any channels (even root) in the runtime. If you request a channel that doesn't exist
424
- // we will never resolve the promise. May want a flag to getChannel that doesn't wait for the promise if
425
- // it doesn't exist
426
- if (!this.contextsDeferred.has(id)) {
427
- this.contextsDeferred.set(id, new Deferred<IChannelContext>());
424
+ const context = this.contexts.get(id);
425
+ if (context === undefined) {
426
+ throw new LoggingError("Channel does not exist");
428
427
  }
429
428
 
430
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
431
- const context = await this.contextsDeferred.get(id)!.promise;
432
- const channel = await context.getChannel();
433
-
434
- return channel;
429
+ return context.getChannel();
435
430
  }
436
431
 
437
432
  public createChannel(id: string = uuid(), type: string): IChannel {
@@ -458,15 +453,6 @@ export class FluidDataStoreRuntime
458
453
  );
459
454
  this.contexts.set(id, context);
460
455
 
461
- if (this.contextsDeferred.has(id)) {
462
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
463
- this.contextsDeferred.get(id)!.resolve(context);
464
- } else {
465
- const deferred = new Deferred<IChannelContext>();
466
- deferred.resolve(context);
467
- this.contextsDeferred.set(id, deferred);
468
- }
469
-
470
456
  // Channels (DDS) should not be created in summarizer client.
471
457
  this.identifyLocalChangeInSummarizer("DDSCreatedInSummarizer", id, type);
472
458
 
@@ -636,14 +622,6 @@ export class FluidDataStoreRuntime
636
622
  );
637
623
 
638
624
  this.contexts.set(id, remoteChannelContext);
639
- if (this.contextsDeferred.has(id)) {
640
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
641
- this.contextsDeferred.get(id)!.resolve(remoteChannelContext);
642
- } else {
643
- const deferred = new Deferred<IChannelContext>();
644
- deferred.resolve(remoteChannelContext);
645
- this.contextsDeferred.set(id, deferred);
646
- }
647
625
  }
648
626
  break;
649
627
  }