@fluidframework/datastore 2.1.0-274160 → 2.1.0-276985

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.1.0-274160",
3
+ "version": "2.1.0-276985",
4
4
  "description": "Fluid data store implementation",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -67,29 +67,29 @@
67
67
  "temp-directory": "nyc/.nyc_output"
68
68
  },
69
69
  "dependencies": {
70
- "@fluid-internal/client-utils": "2.1.0-274160",
71
- "@fluidframework/container-definitions": "2.1.0-274160",
72
- "@fluidframework/core-interfaces": "2.1.0-274160",
73
- "@fluidframework/core-utils": "2.1.0-274160",
74
- "@fluidframework/datastore-definitions": "2.1.0-274160",
75
- "@fluidframework/driver-definitions": "2.1.0-274160",
76
- "@fluidframework/driver-utils": "2.1.0-274160",
77
- "@fluidframework/id-compressor": "2.1.0-274160",
78
- "@fluidframework/runtime-definitions": "2.1.0-274160",
79
- "@fluidframework/runtime-utils": "2.1.0-274160",
80
- "@fluidframework/telemetry-utils": "2.1.0-274160",
70
+ "@fluid-internal/client-utils": "2.1.0-276985",
71
+ "@fluidframework/container-definitions": "2.1.0-276985",
72
+ "@fluidframework/core-interfaces": "2.1.0-276985",
73
+ "@fluidframework/core-utils": "2.1.0-276985",
74
+ "@fluidframework/datastore-definitions": "2.1.0-276985",
75
+ "@fluidframework/driver-definitions": "2.1.0-276985",
76
+ "@fluidframework/driver-utils": "2.1.0-276985",
77
+ "@fluidframework/id-compressor": "2.1.0-276985",
78
+ "@fluidframework/runtime-definitions": "2.1.0-276985",
79
+ "@fluidframework/runtime-utils": "2.1.0-276985",
80
+ "@fluidframework/telemetry-utils": "2.1.0-276985",
81
81
  "uuid": "^9.0.0"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@arethetypeswrong/cli": "^0.15.2",
85
85
  "@biomejs/biome": "^1.7.3",
86
- "@fluid-internal/mocha-test-setup": "2.1.0-274160",
86
+ "@fluid-internal/mocha-test-setup": "2.1.0-276985",
87
87
  "@fluid-tools/build-cli": "^0.39.0",
88
88
  "@fluidframework/build-common": "^2.0.3",
89
89
  "@fluidframework/build-tools": "^0.39.0",
90
90
  "@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0-rc.5.0.0",
91
91
  "@fluidframework/eslint-config-fluid": "^5.3.0",
92
- "@fluidframework/test-runtime-utils": "2.1.0-274160",
92
+ "@fluidframework/test-runtime-utils": "2.1.0-276985",
93
93
  "@microsoft/api-extractor": "^7.45.1",
94
94
  "@types/lodash": "^4.14.118",
95
95
  "@types/mocha": "^9.1.1",
@@ -113,8 +113,8 @@
113
113
  },
114
114
  "scripts": {
115
115
  "api": "fluid-build . --task api",
116
- "api-extractor:commonjs": "flub generate entrypoints --outFileAlpha legacy --outDir ./dist",
117
- "api-extractor:esnext": "flub generate entrypoints --outFileAlpha legacy --outDir ./lib --node10TypeCompat",
116
+ "api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
117
+ "api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
118
118
  "build": "fluid-build . --task build",
119
119
  "build:commonjs": "fluid-build . --task commonjs",
120
120
  "build:compile": "fluid-build . --task compile",
@@ -64,13 +64,13 @@ import {
64
64
  convertSummaryTreeToITree,
65
65
  create404Response,
66
66
  createResponseError,
67
- encodeCompactIdToString,
68
67
  exceptionToResponse,
69
68
  generateHandleContextPath,
70
69
  processAttachMessageGCData,
71
70
  toFluidHandleInternal,
72
71
  unpackChildNodesUsedRoutes,
73
72
  toDeltaManagerErased,
73
+ encodeCompactIdToString,
74
74
  } from "@fluidframework/runtime-utils/internal";
75
75
  import {
76
76
  ITelemetryLoggerExt,
@@ -96,6 +96,7 @@ import { pkgVersion } from "./packageVersion.js";
96
96
  import { RemoteChannelContext } from "./remoteChannelContext.js";
97
97
 
98
98
  /**
99
+ * @legacy
99
100
  * @alpha
100
101
  */
101
102
  export enum DataStoreMessageType {
@@ -105,6 +106,7 @@ export enum DataStoreMessageType {
105
106
  }
106
107
 
107
108
  /**
109
+ * @legacy
108
110
  * @alpha
109
111
  */
110
112
  export interface ISharedObjectRegistry {
@@ -115,6 +117,7 @@ export interface ISharedObjectRegistry {
115
117
 
116
118
  /**
117
119
  * Base data store class
120
+ * @legacy
118
121
  * @alpha
119
122
  */
120
123
  export class FluidDataStoreRuntime
@@ -439,21 +442,30 @@ export class FluidDataStoreRuntime
439
442
  id = idArg;
440
443
  this.validateChannelId(id);
441
444
  } else {
442
- // We use three non-overlapping namespaces:
443
- // - detached state: even numbers
444
- // - attached state: odd numbers
445
- // - uuids
446
- // In first two cases we will encode result as strings in more compact form, with leading underscore,
447
- // to ensure no overlap with user-provided DDS names (see validateChannelId())
448
- if (this.visibilityState !== VisibilityState.GloballyVisible) {
449
- // container is detached, only one client observes content, no way to hit collisions with other clients.
450
- id = encodeCompactIdToString(2 * this.contexts.size, "_");
445
+ /**
446
+ * There is currently a bug where certain data store ids such as "[" are getting converted to ASCII characters
447
+ * in the snapshot.
448
+ * So, return short ids only if explicitly enabled via feature flags. Else, return uuid();
449
+ */
450
+ if (this.mc.config.getBoolean("Fluid.Runtime.UseShortIds") === true) {
451
+ // We use three non-overlapping namespaces:
452
+ // - detached state: even numbers
453
+ // - attached state: odd numbers
454
+ // - uuids
455
+ // In first two cases we will encode result as strings in more compact form, with leading underscore,
456
+ // to ensure no overlap with user-provided DDS names (see validateChannelId())
457
+ if (this.visibilityState !== VisibilityState.GloballyVisible) {
458
+ // container is detached, only one client observes content, no way to hit collisions with other clients.
459
+ id = encodeCompactIdToString(2 * this.contexts.size, "_");
460
+ } else {
461
+ // Due to back-compat, we could not depend yet on generateDocumentUniqueId() being there.
462
+ // We can remove the need to leverage uuid() as fall-back in couple releases.
463
+ const res =
464
+ this.dataStoreContext.containerRuntime.generateDocumentUniqueId?.() ?? uuid();
465
+ id = typeof res === "number" ? encodeCompactIdToString(2 * res + 1, "_") : res;
466
+ }
451
467
  } else {
452
- // Due to back-compat, we could not depend yet on generateDocumentUniqueId() being there.
453
- // We can remove the need to leverage uuid() as fall-back in couple releases.
454
- const res =
455
- this.dataStoreContext.containerRuntime.generateDocumentUniqueId?.() ?? uuid();
456
- id = typeof res === "number" ? encodeCompactIdToString(2 * res + 1, "_") : res;
468
+ id = uuid();
457
469
  }
458
470
  assert(!id.includes("/"), 0x8fc /* slash */);
459
471
  }
@@ -1234,6 +1246,7 @@ export class FluidDataStoreRuntime
1234
1246
  * Request handler is only called when data store can't resolve request, i.e. for custom requests.
1235
1247
  * @param Base - base class, inherits from FluidDataStoreRuntime
1236
1248
  * @param requestHandler - request handler to mix in
1249
+ * @legacy
1237
1250
  * @alpha
1238
1251
  */
1239
1252
  export const mixinRequestHandler = (
@@ -1255,6 +1268,7 @@ export const mixinRequestHandler = (
1255
1268
  * @param handler - handler that returns info about blob to be added to summary.
1256
1269
  * Or undefined not to add anything to summary.
1257
1270
  * @param Base - base class, inherits from FluidDataStoreRuntime
1271
+ * @legacy
1258
1272
  * @alpha
1259
1273
  */
1260
1274
  export const mixinSummaryHandler = (
@@ -13,6 +13,7 @@ import {
13
13
 
14
14
  /**
15
15
  * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
16
+ * @legacy
16
17
  * @alpha
17
18
  */
18
19
  export class FluidObjectHandle<
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/datastore";
9
- export const pkgVersion = "2.1.0-274160";
9
+ export const pkgVersion = "2.1.0-276985";