@fluidframework/datastore 2.0.0-internal.4.0.6 → 2.0.0-internal.4.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 +34 -0
- package/README.md +38 -0
- package/dist/channelContext.d.ts +2 -2
- package/dist/channelContext.d.ts.map +1 -1
- package/dist/channelContext.js +2 -2
- package/dist/channelContext.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +2 -3
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/remoteChannelContext.d.ts.map +1 -1
- package/dist/remoteChannelContext.js +39 -58
- package/dist/remoteChannelContext.js.map +1 -1
- package/lib/channelContext.d.ts +2 -2
- package/lib/channelContext.d.ts.map +1 -1
- package/lib/channelContext.js +2 -2
- package/lib/channelContext.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +1 -2
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/remoteChannelContext.d.ts.map +1 -1
- package/lib/remoteChannelContext.js +39 -58
- package/lib/remoteChannelContext.js.map +1 -1
- package/package.json +20 -16
- package/src/channelContext.ts +8 -1
- package/src/dataStoreRuntime.ts +2 -1
- package/src/packageVersion.ts +1 -1
- package/src/remoteChannelContext.ts +49 -57
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/datastore",
|
|
3
|
-
"version": "2.0.0-internal.4.0
|
|
3
|
+
"version": "2.0.0-internal.4.1.0",
|
|
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.4.0
|
|
41
|
-
"@fluidframework/container-utils": ">=2.0.0-internal.4.0
|
|
42
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.4.0
|
|
43
|
-
"@fluidframework/datastore-definitions": ">=2.0.0-internal.4.0
|
|
44
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.4.0
|
|
45
|
-
"@fluidframework/driver-utils": ">=2.0.0-internal.4.0
|
|
46
|
-
"@fluidframework/garbage-collector": ">=2.0.0-internal.4.0
|
|
47
|
-
"@fluidframework/protocol-base": "^0.
|
|
40
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
41
|
+
"@fluidframework/container-utils": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
42
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
43
|
+
"@fluidframework/datastore-definitions": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
44
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
45
|
+
"@fluidframework/driver-utils": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
46
|
+
"@fluidframework/garbage-collector": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
47
|
+
"@fluidframework/protocol-base": "^0.1039.1000",
|
|
48
48
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
49
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-internal.4.0
|
|
50
|
-
"@fluidframework/runtime-utils": ">=2.0.0-internal.4.0
|
|
51
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-internal.4.0
|
|
49
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
50
|
+
"@fluidframework/runtime-utils": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
51
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
52
52
|
"lodash": "^4.17.21",
|
|
53
53
|
"uuid": "^8.3.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@fluid-tools/build-cli": "^0.
|
|
56
|
+
"@fluid-tools/build-cli": "^0.15.0",
|
|
57
57
|
"@fluidframework/build-common": "^1.1.0",
|
|
58
|
-
"@fluidframework/build-tools": "^0.
|
|
58
|
+
"@fluidframework/build-tools": "^0.15.0",
|
|
59
59
|
"@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0-internal.4.0.0",
|
|
60
60
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
61
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.4.0
|
|
62
|
-
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.4.0
|
|
61
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
62
|
+
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
63
63
|
"@microsoft/api-extractor": "^7.34.4",
|
|
64
64
|
"@types/mocha": "^9.1.1",
|
|
65
65
|
"@types/node": "^14.18.38",
|
|
@@ -69,6 +69,9 @@
|
|
|
69
69
|
"cross-env": "^7.0.3",
|
|
70
70
|
"eslint": "~8.6.0",
|
|
71
71
|
"mocha": "^10.2.0",
|
|
72
|
+
"mocha-json-output-reporter": "^2.0.1",
|
|
73
|
+
"mocha-multi-reporters": "^1.5.1",
|
|
74
|
+
"moment": "^2.21.0",
|
|
72
75
|
"nyc": "^15.1.0",
|
|
73
76
|
"prettier": "~2.6.2",
|
|
74
77
|
"rimraf": "^4.4.0",
|
|
@@ -99,6 +102,7 @@
|
|
|
99
102
|
"test": "npm run test:mocha",
|
|
100
103
|
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
101
104
|
"test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test --exit -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
105
|
+
"test:mocha:multireport": "cross-env FLUID_TEST_MULTIREPORT=1 npm run test:mocha",
|
|
102
106
|
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
103
107
|
"tsc": "tsc",
|
|
104
108
|
"tsc:watch": "tsc --watch",
|
package/src/channelContext.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
|
10
10
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
11
11
|
import {
|
|
12
12
|
IGarbageCollectionData,
|
|
13
|
+
IExperimentalIncrementalSummaryContext,
|
|
13
14
|
ISummarizeResult,
|
|
14
15
|
ISummaryTreeWithStats,
|
|
15
16
|
ITelemetryContext,
|
|
@@ -99,8 +100,14 @@ export async function summarizeChannelAsync(
|
|
|
99
100
|
fullTree: boolean = false,
|
|
100
101
|
trackState: boolean = false,
|
|
101
102
|
telemetryContext?: ITelemetryContext,
|
|
103
|
+
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext,
|
|
102
104
|
): Promise<ISummaryTreeWithStats> {
|
|
103
|
-
const summarizeResult = await channel.summarize(
|
|
105
|
+
const summarizeResult = await channel.summarize(
|
|
106
|
+
fullTree,
|
|
107
|
+
trackState,
|
|
108
|
+
telemetryContext,
|
|
109
|
+
incrementalSummaryContext,
|
|
110
|
+
);
|
|
104
111
|
|
|
105
112
|
// Add the channel attributes to the returned result.
|
|
106
113
|
addBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));
|
package/src/dataStoreRuntime.ts
CHANGED
|
@@ -65,8 +65,10 @@ import {
|
|
|
65
65
|
create404Response,
|
|
66
66
|
createResponseError,
|
|
67
67
|
exceptionToResponse,
|
|
68
|
+
GCDataBuilder,
|
|
68
69
|
requestFluidObject,
|
|
69
70
|
packagePathToTelemetryProperty,
|
|
71
|
+
unpackChildNodesUsedRoutes,
|
|
70
72
|
} from "@fluidframework/runtime-utils";
|
|
71
73
|
import {
|
|
72
74
|
IChannel,
|
|
@@ -74,7 +76,6 @@ import {
|
|
|
74
76
|
IFluidDataStoreRuntimeEvents,
|
|
75
77
|
IChannelFactory,
|
|
76
78
|
} from "@fluidframework/datastore-definitions";
|
|
77
|
-
import { GCDataBuilder, unpackChildNodesUsedRoutes } from "@fluidframework/garbage-collector";
|
|
78
79
|
import { v4 as uuid } from "uuid";
|
|
79
80
|
import { IChannelContext, summarizeChannel } from "./channelContext";
|
|
80
81
|
import {
|
package/src/packageVersion.ts
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
IChannel,
|
|
12
12
|
IChannelAttributes,
|
|
13
13
|
IFluidDataStoreRuntime,
|
|
14
|
-
IChannelFactory,
|
|
15
14
|
} from "@fluidframework/datastore-definitions";
|
|
16
15
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
17
16
|
import { readAndParse } from "@fluidframework/driver-utils";
|
|
@@ -20,6 +19,7 @@ import {
|
|
|
20
19
|
CreateChildSummarizerNodeFn,
|
|
21
20
|
IFluidDataStoreContext,
|
|
22
21
|
IGarbageCollectionData,
|
|
22
|
+
IExperimentalIncrementalSummaryContext,
|
|
23
23
|
ISummarizeInternalResult,
|
|
24
24
|
ISummarizeResult,
|
|
25
25
|
ISummarizerNodeWithGC,
|
|
@@ -84,7 +84,14 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
84
84
|
fullTree: boolean,
|
|
85
85
|
trackState: boolean,
|
|
86
86
|
telemetryContext?: ITelemetryContext,
|
|
87
|
-
|
|
87
|
+
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext,
|
|
88
|
+
) =>
|
|
89
|
+
this.summarizeInternal(
|
|
90
|
+
fullTree,
|
|
91
|
+
trackState,
|
|
92
|
+
telemetryContext,
|
|
93
|
+
incrementalSummaryContext,
|
|
94
|
+
);
|
|
88
95
|
|
|
89
96
|
this.summarizerNode = createSummarizerNode(
|
|
90
97
|
thisSummarizeInternal,
|
|
@@ -167,6 +174,7 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
167
174
|
fullTree: boolean,
|
|
168
175
|
trackState: boolean,
|
|
169
176
|
telemetryContext?: ITelemetryContext,
|
|
177
|
+
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext,
|
|
170
178
|
): Promise<ISummarizeInternalResult> {
|
|
171
179
|
const channel = await this.getChannel();
|
|
172
180
|
const summarizeResult = await summarizeChannelAsync(
|
|
@@ -174,6 +182,7 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
174
182
|
fullTree,
|
|
175
183
|
trackState,
|
|
176
184
|
telemetryContext,
|
|
185
|
+
incrementalSummaryContext,
|
|
177
186
|
);
|
|
178
187
|
return { ...summarizeResult, id: this.id };
|
|
179
188
|
}
|
|
@@ -192,62 +201,45 @@ export class RemoteChannelContext implements IChannelContext {
|
|
|
192
201
|
);
|
|
193
202
|
}
|
|
194
203
|
|
|
195
|
-
|
|
196
|
-
//
|
|
197
|
-
//
|
|
198
|
-
//
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
dataStorePackagePath: this.dataStoreContext.packagePath.join("/"),
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
factory = this.registry.get(this.attachMessageType);
|
|
217
|
-
if (factory === undefined) {
|
|
218
|
-
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
219
|
-
throw new DataCorruptionError("channelFactoryNotRegisteredForAttachMessageType", {
|
|
220
|
-
channelId: {
|
|
221
|
-
value: this.id,
|
|
222
|
-
tag: TelemetryDataTag.CodeArtifact,
|
|
223
|
-
},
|
|
224
|
-
dataStoreId: {
|
|
225
|
-
value: this.dataStoreContext.id,
|
|
226
|
-
tag: TelemetryDataTag.CodeArtifact,
|
|
227
|
-
},
|
|
228
|
-
dataStorePackagePath: this.dataStoreContext.packagePath.join("/"),
|
|
229
|
-
channelFactoryType: this.attachMessageType,
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
attributes = factory.attributes;
|
|
233
|
-
} else {
|
|
234
|
-
factory = this.registry.get(attributes.type);
|
|
235
|
-
if (factory === undefined) {
|
|
236
|
-
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
237
|
-
throw new DataCorruptionError("channelFactoryNotRegisteredForGivenType", {
|
|
238
|
-
channelId: {
|
|
239
|
-
value: this.id,
|
|
240
|
-
tag: TelemetryDataTag.CodeArtifact,
|
|
241
|
-
},
|
|
242
|
-
dataStoreId: {
|
|
243
|
-
value: this.dataStoreContext.id,
|
|
244
|
-
tag: TelemetryDataTag.CodeArtifact,
|
|
245
|
-
},
|
|
246
|
-
dataStorePackagePath: this.dataStoreContext.packagePath.join("/"),
|
|
247
|
-
channelFactoryType: attributes.type,
|
|
248
|
-
});
|
|
249
|
-
}
|
|
204
|
+
// This is a backward compatibility case where the attach message doesn't include attributes. They must
|
|
205
|
+
// include attach message type.
|
|
206
|
+
// Since old attach messages will not have attributes, we need to keep this as long as we support old attach
|
|
207
|
+
// messages.
|
|
208
|
+
const channelFactoryType = attributes ? attributes.type : this.attachMessageType;
|
|
209
|
+
if (channelFactoryType === undefined) {
|
|
210
|
+
throw new DataCorruptionError("channelTypeNotAvailable", {
|
|
211
|
+
channelId: {
|
|
212
|
+
value: this.id,
|
|
213
|
+
tag: TelemetryDataTag.CodeArtifact,
|
|
214
|
+
},
|
|
215
|
+
dataStoreId: {
|
|
216
|
+
value: this.dataStoreContext.id,
|
|
217
|
+
tag: TelemetryDataTag.CodeArtifact,
|
|
218
|
+
},
|
|
219
|
+
dataStorePackagePath: this.dataStoreContext.packagePath.join("/"),
|
|
220
|
+
channelFactoryType: this.attachMessageType,
|
|
221
|
+
});
|
|
250
222
|
}
|
|
223
|
+
const factory = this.registry.get(channelFactoryType);
|
|
224
|
+
if (factory === undefined) {
|
|
225
|
+
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
226
|
+
throw new DataCorruptionError("channelFactoryNotRegisteredForGivenType", {
|
|
227
|
+
channelId: {
|
|
228
|
+
value: this.id,
|
|
229
|
+
tag: TelemetryDataTag.CodeArtifact,
|
|
230
|
+
},
|
|
231
|
+
dataStoreId: {
|
|
232
|
+
value: this.dataStoreContext.id,
|
|
233
|
+
tag: TelemetryDataTag.CodeArtifact,
|
|
234
|
+
},
|
|
235
|
+
dataStorePackagePath: this.dataStoreContext.packagePath.join("/"),
|
|
236
|
+
channelFactoryType,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// This is a backward compatibility case where the attach message doesn't include attributes. Get the attributes
|
|
241
|
+
// from the factory.
|
|
242
|
+
attributes = attributes ?? factory.attributes;
|
|
251
243
|
|
|
252
244
|
// Compare snapshot version to collaborative object version
|
|
253
245
|
if (
|