@fluidframework/datastore 2.1.0-276985 → 2.1.0-281041
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/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.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.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/lib/public.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/datastore",
|
|
3
|
-
"version": "2.1.0-
|
|
3
|
+
"version": "2.1.0-281041",
|
|
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-
|
|
71
|
-
"@fluidframework/container-definitions": "2.1.0-
|
|
72
|
-
"@fluidframework/core-interfaces": "2.1.0-
|
|
73
|
-
"@fluidframework/core-utils": "2.1.0-
|
|
74
|
-
"@fluidframework/datastore-definitions": "2.1.0-
|
|
75
|
-
"@fluidframework/driver-definitions": "2.1.0-
|
|
76
|
-
"@fluidframework/driver-utils": "2.1.0-
|
|
77
|
-
"@fluidframework/id-compressor": "2.1.0-
|
|
78
|
-
"@fluidframework/runtime-definitions": "2.1.0-
|
|
79
|
-
"@fluidframework/runtime-utils": "2.1.0-
|
|
80
|
-
"@fluidframework/telemetry-utils": "2.1.0-
|
|
70
|
+
"@fluid-internal/client-utils": "2.1.0-281041",
|
|
71
|
+
"@fluidframework/container-definitions": "2.1.0-281041",
|
|
72
|
+
"@fluidframework/core-interfaces": "2.1.0-281041",
|
|
73
|
+
"@fluidframework/core-utils": "2.1.0-281041",
|
|
74
|
+
"@fluidframework/datastore-definitions": "2.1.0-281041",
|
|
75
|
+
"@fluidframework/driver-definitions": "2.1.0-281041",
|
|
76
|
+
"@fluidframework/driver-utils": "2.1.0-281041",
|
|
77
|
+
"@fluidframework/id-compressor": "2.1.0-281041",
|
|
78
|
+
"@fluidframework/runtime-definitions": "2.1.0-281041",
|
|
79
|
+
"@fluidframework/runtime-utils": "2.1.0-281041",
|
|
80
|
+
"@fluidframework/telemetry-utils": "2.1.0-281041",
|
|
81
81
|
"uuid": "^9.0.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
85
|
-
"@biomejs/biome": "
|
|
86
|
-
"@fluid-internal/mocha-test-setup": "2.1.0-
|
|
87
|
-
"@fluid-tools/build-cli": "^0.
|
|
85
|
+
"@biomejs/biome": "~1.8.3",
|
|
86
|
+
"@fluid-internal/mocha-test-setup": "2.1.0-281041",
|
|
87
|
+
"@fluid-tools/build-cli": "^0.40.0",
|
|
88
88
|
"@fluidframework/build-common": "^2.0.3",
|
|
89
|
-
"@fluidframework/build-tools": "^0.
|
|
90
|
-
"@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0
|
|
89
|
+
"@fluidframework/build-tools": "^0.40.0",
|
|
90
|
+
"@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0",
|
|
91
91
|
"@fluidframework/eslint-config-fluid": "^5.3.0",
|
|
92
|
-
"@fluidframework/test-runtime-utils": "2.1.0-
|
|
92
|
+
"@fluidframework/test-runtime-utils": "2.1.0-281041",
|
|
93
93
|
"@microsoft/api-extractor": "^7.45.1",
|
|
94
94
|
"@types/lodash": "^4.14.118",
|
|
95
95
|
"@types/mocha": "^9.1.1",
|
|
@@ -116,18 +116,19 @@
|
|
|
116
116
|
"api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
|
|
117
117
|
"api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
|
|
118
118
|
"build": "fluid-build . --task build",
|
|
119
|
+
"build:api-reports": "concurrently \"npm:build:api-reports:*\"",
|
|
120
|
+
"build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor.current.json",
|
|
121
|
+
"build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
|
|
119
122
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
120
123
|
"build:compile": "fluid-build . --task compile",
|
|
121
|
-
"build:docs": "
|
|
122
|
-
"build:docs:current": "api-extractor run --local",
|
|
123
|
-
"build:docs:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
|
|
124
|
+
"build:docs": "api-extractor run --local",
|
|
124
125
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
125
126
|
"build:genver": "gen-version",
|
|
126
127
|
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
127
128
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
128
129
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
129
130
|
"check:are-the-types-wrong": "attw --pack .",
|
|
130
|
-
"check:biome": "biome check .
|
|
131
|
+
"check:biome": "biome check .",
|
|
131
132
|
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
132
133
|
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
|
|
133
134
|
"check:exports:cjs:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.cjs.json",
|
|
@@ -136,14 +137,15 @@
|
|
|
136
137
|
"check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
|
|
137
138
|
"check:format": "npm run check:biome",
|
|
138
139
|
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
139
|
-
"ci:build:
|
|
140
|
-
"ci:build:
|
|
141
|
-
"ci:build:
|
|
140
|
+
"ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
|
|
141
|
+
"ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
|
|
142
|
+
"ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
|
|
143
|
+
"ci:build:docs": "api-extractor run",
|
|
142
144
|
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
143
145
|
"eslint": "eslint --format stylish src",
|
|
144
146
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
145
147
|
"format": "npm run format:biome",
|
|
146
|
-
"format:biome": "biome check . --
|
|
148
|
+
"format:biome": "biome check . --write",
|
|
147
149
|
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
148
150
|
"lint": "fluid-build . --task lint",
|
|
149
151
|
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
7
|
import { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
7
8
|
import {
|
|
8
9
|
IDocumentStorageService,
|
|
@@ -17,14 +18,12 @@ export class ChannelStorageService implements IChannelStorageService {
|
|
|
17
18
|
tree: ISnapshotTree,
|
|
18
19
|
results: { [path: string]: string },
|
|
19
20
|
) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
ChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);
|
|
21
|
+
for (const [path, subtree] of Object.entries(tree.trees)) {
|
|
22
|
+
ChannelStorageService.flattenTree(`${base}${path}/`, subtree, results);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
results[`${base}${blob}`] = tree.blobs[blob];
|
|
25
|
+
for (const [blobName, blobId] of Object.entries(tree.blobs)) {
|
|
26
|
+
results[`${base}${blobName}`] = blobId;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
|
|
@@ -49,6 +48,7 @@ export class ChannelStorageService implements IChannelStorageService {
|
|
|
49
48
|
|
|
50
49
|
public async readBlob(path: string): Promise<ArrayBufferLike> {
|
|
51
50
|
const id = await this.getIdForPath(path);
|
|
51
|
+
assert(id !== undefined, "id is undefined in ChannelStorageService.readBlob()");
|
|
52
52
|
const blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;
|
|
53
53
|
|
|
54
54
|
if (blob !== undefined) {
|
|
@@ -77,7 +77,7 @@ export class ChannelStorageService implements IChannelStorageService {
|
|
|
77
77
|
return Object.keys(tree?.blobs ?? {});
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
private async getIdForPath(path: string): Promise<string> {
|
|
80
|
+
private async getIdForPath(path: string): Promise<string | undefined> {
|
|
81
81
|
return this.flattenedTree[path];
|
|
82
82
|
}
|
|
83
83
|
}
|
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