@fluidframework/datastore 2.23.0 → 2.31.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 +285 -253
- package/api-report/datastore.legacy.alpha.api.md +1 -2
- package/dist/channelDeltaConnection.d.ts.map +1 -1
- package/dist/channelDeltaConnection.js +6 -19
- package/dist/channelDeltaConnection.js.map +1 -1
- package/dist/dataStoreLayerCompatState.d.ts +35 -0
- package/dist/dataStoreLayerCompatState.d.ts.map +1 -0
- package/dist/dataStoreLayerCompatState.js +74 -0
- package/dist/dataStoreLayerCompatState.js.map +1 -0
- package/dist/dataStoreRuntime.d.ts +8 -6
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +13 -19
- 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/lib/channelDeltaConnection.d.ts.map +1 -1
- package/lib/channelDeltaConnection.js +6 -19
- package/lib/channelDeltaConnection.js.map +1 -1
- package/lib/dataStoreLayerCompatState.d.ts +35 -0
- package/lib/dataStoreLayerCompatState.d.ts.map +1 -0
- package/lib/dataStoreLayerCompatState.js +70 -0
- package/lib/dataStoreLayerCompatState.js.map +1 -0
- package/lib/dataStoreRuntime.d.ts +8 -6
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +15 -19
- 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/tsdoc-metadata.json +1 -1
- package/package.json +19 -20
- package/src/channelDeltaConnection.ts +8 -19
- package/src/dataStoreLayerCompatState.ts +85 -0
- package/src/dataStoreRuntime.ts +23 -25
- package/src/packageVersion.ts +1 -1
- package/prettier.config.cjs +0 -8
|
@@ -61,6 +61,7 @@ export class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRunt
|
|
|
61
61
|
get idCompressor(): IIdCompressor | undefined;
|
|
62
62
|
// (undocumented)
|
|
63
63
|
get IFluidHandleContext(): this;
|
|
64
|
+
readonly ILayerCompatDetails?: unknown;
|
|
64
65
|
// (undocumented)
|
|
65
66
|
get isAttached(): boolean;
|
|
66
67
|
// (undocumented)
|
|
@@ -70,8 +71,6 @@ export class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRunt
|
|
|
70
71
|
get objectsRoutingContext(): this;
|
|
71
72
|
// (undocumented)
|
|
72
73
|
readonly options: Record<string | number, any>;
|
|
73
|
-
// @deprecated
|
|
74
|
-
process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
75
74
|
processMessages(messageCollection: IRuntimeMessageCollection): void;
|
|
76
75
|
// (undocumented)
|
|
77
76
|
processSignal(message: IInboundSignalMessage, local: boolean): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelDeltaConnection.d.ts","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"channelDeltaConnection.d.ts","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,yBAAyB,EAEzB,MAAM,8CAA8C,CAAC;AA0DtD,qBAAa,sBAAuB,YAAW,gBAAgB;IAa7D,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,QAAQ,CAAC,QAAQ;aACT,KAAK,EAAE,MAAM,IAAI;IACjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAftC,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,WAAW,CAAgC;IAEnD,OAAO,KAAK,OAAO,GAGlB;IACD,IAAW,SAAS,IAAI,OAAO,CAE9B;gBAGQ,UAAU,EAAE,OAAO,EACV,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,EAC3D,KAAK,EAAE,MAAM,IAAI,EAChB,oBAAoB,EAAE,MAAM,OAAO;IAG9C,MAAM,CAAC,OAAO,EAAE,aAAa;IAK7B,kBAAkB,CAAC,SAAS,EAAE,OAAO;IAKrC,eAAe,CAAC,iBAAiB,EAAE,yBAAyB,GAAG,IAAI;IAmBnE,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAQ/C,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAW/C,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAUrC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;CAOrD"}
|
|
@@ -71,29 +71,16 @@ class ChannelDeltaConnection {
|
|
|
71
71
|
this.handler.setConnectionState(connected);
|
|
72
72
|
}
|
|
73
73
|
processMessages(messageCollection) {
|
|
74
|
-
const { envelope, messagesContent, local } = messageCollection;
|
|
75
74
|
// catches as data processing error whether or not they come from async pending queues
|
|
76
75
|
try {
|
|
77
|
-
const newMessagesContent = getContentsWithStashedOpHandling(messagesContent);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
for (const { contents, localOpMetadata, clientSequenceNumber } of newMessagesContent) {
|
|
86
|
-
const compatMessage = {
|
|
87
|
-
...envelope,
|
|
88
|
-
contents,
|
|
89
|
-
clientSequenceNumber,
|
|
90
|
-
};
|
|
91
|
-
this.handler.process(compatMessage, local, localOpMetadata);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
76
|
+
const newMessagesContent = getContentsWithStashedOpHandling(messageCollection.messagesContent);
|
|
77
|
+
this.handler.processMessages({
|
|
78
|
+
...messageCollection,
|
|
79
|
+
messagesContent: newMessagesContent,
|
|
80
|
+
});
|
|
94
81
|
}
|
|
95
82
|
catch (error) {
|
|
96
|
-
throw internal_2.DataProcessingError.wrapIfUnrecognized(error, "channelDeltaConnectionFailedToProcessMessages", envelope);
|
|
83
|
+
throw internal_2.DataProcessingError.wrapIfUnrecognized(error, "channelDeltaConnectionFailedToProcessMessages", messageCollection.envelope);
|
|
97
84
|
}
|
|
98
85
|
}
|
|
99
86
|
reSubmit(content, localOpMetadata) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelDeltaConnection.js","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;
|
|
1
|
+
{"version":3,"file":"channelDeltaConnection.js","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAS7D,uEAA+E;AAE/E,MAAM,qBAAqB,GAAG,MAAM,EAAE,CAAC;AAKvC,SAAS,uBAAuB;IAC/B,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;QACjD,KAAK,EAAE,qBAAqB;QAC5B,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE,IAAI;KAChB,CAAC,CAAC;IACH,OAAO,GAA+B,CAAC;AACxC,CAAC;AAED,SAAS,mBAAmB,CAAC,EAAW;IACvC,OAAO,CACN,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACjB,qBAAqB,IAAI,EAAE;QAC3B,EAAE,CAAC,qBAAqB,CAAC,KAAK,qBAAqB,CACnD,CAAC;AACH,CAAC;AAED,SAAS,oCAAoC,CAC5C,OAAY,EACZ,eAAwB,EACxB,IAAgD;IAEhD,IAAI,mBAAmB,CAAC,eAAe,CAAC,EAAE,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;IACH,CAAC;IAEM,cAAc,CAAC,OAAY;QACjC,IAAI,CAAC;YACJ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YACvF,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YACrC,OAAO,IAAI,CAAC,WAAW,CAAC;QACzB,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC9B,CAAC;IACF,CAAC;IAEM,MAAM,CAAC,QAAa,EAAE,QAAiB;QAC7C,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnC,CAAC;IACF,CAAC;CACD;AApFD,wDAoFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDeltaConnection,\n\tIDeltaHandler,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { DataProcessingError } from \"@fluidframework/telemetry-utils/internal\";\n\nconst stashedOpMetadataMark = Symbol();\n\ntype StashedOpMetadata = { contents: any; metadata: unknown }[] &\n\tRecord<typeof stashedOpMetadataMark, typeof stashedOpMetadataMark>;\n\nfunction createStashedOpMetadata(): StashedOpMetadata {\n\tconst arr = [];\n\tObject.defineProperty(arr, stashedOpMetadataMark, {\n\t\tvalue: stashedOpMetadataMark,\n\t\twritable: false,\n\t\tenumerable: true,\n\t});\n\treturn arr as any as StashedOpMetadata;\n}\n\nfunction isStashedOpMetadata(md: unknown): md is StashedOpMetadata {\n\treturn (\n\t\tArray.isArray(md) &&\n\t\tstashedOpMetadataMark in md &&\n\t\tmd[stashedOpMetadataMark] === stashedOpMetadataMark\n\t);\n}\n\nfunction processWithStashedOpMetadataHandling(\n\tcontent: any,\n\tlocalOpMetaData: unknown,\n\tfunc: (contents: any, metadata: unknown) => void,\n) {\n\tif (isStashedOpMetadata(localOpMetaData)) {\n\t\tlocalOpMetaData.forEach(({ contents, metadata }) => func(contents, metadata));\n\t} else {\n\t\tfunc(content, localOpMetaData);\n\t}\n}\n\nfunction getContentsWithStashedOpHandling(\n\tmessagesContent: readonly IRuntimeMessagesContent[],\n) {\n\tconst newMessageContents: IRuntimeMessagesContent[] = [];\n\tfor (const messageContent of messagesContent) {\n\t\tif (isStashedOpMetadata(messageContent.localOpMetadata)) {\n\t\t\tmessageContent.localOpMetadata.forEach(({ contents, metadata }) => {\n\t\t\t\tnewMessageContents.push({\n\t\t\t\t\tcontents,\n\t\t\t\t\tlocalOpMetadata: metadata,\n\t\t\t\t\tclientSequenceNumber: messageContent.clientSequenceNumber,\n\t\t\t\t});\n\t\t\t});\n\t\t} else {\n\t\t\tnewMessageContents.push(messageContent);\n\t\t}\n\t}\n\treturn newMessageContents;\n}\n\nexport class ChannelDeltaConnection implements IDeltaConnection {\n\tprivate _handler: IDeltaHandler | undefined;\n\tprivate stashedOpMd: StashedOpMetadata | undefined;\n\n\tprivate get handler(): IDeltaHandler {\n\t\tassert(!!this._handler, 0x177 /* \"Missing delta handler\" */);\n\t\treturn this._handler;\n\t}\n\tpublic get connected(): boolean {\n\t\treturn this._connected;\n\t}\n\n\tconstructor(\n\t\tprivate _connected: boolean,\n\t\tprivate readonly submitFn: (content: any, localOpMetadata: unknown) => void,\n\t\tpublic readonly dirty: () => void,\n\t\tprivate readonly isAttachedAndVisible: () => boolean,\n\t) {}\n\n\tpublic attach(handler: IDeltaHandler) {\n\t\tassert(this._handler === undefined, 0x178 /* \"Missing delta handler on attach\" */);\n\t\tthis._handler = handler;\n\t}\n\n\tpublic setConnectionState(connected: boolean) {\n\t\tthis._connected = connected;\n\t\tthis.handler.setConnectionState(connected);\n\t}\n\n\tpublic processMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\t// catches as data processing error whether or not they come from async pending queues\n\t\ttry {\n\t\t\tconst newMessagesContent = getContentsWithStashedOpHandling(\n\t\t\t\tmessageCollection.messagesContent,\n\t\t\t);\n\t\t\tthis.handler.processMessages({\n\t\t\t\t...messageCollection,\n\t\t\t\tmessagesContent: newMessagesContent,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthrow DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terror,\n\t\t\t\t\"channelDeltaConnectionFailedToProcessMessages\",\n\t\t\t\tmessageCollection.envelope,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic reSubmit(content: any, localOpMetadata: unknown) {\n\t\tprocessWithStashedOpMetadataHandling(\n\t\t\tcontent,\n\t\t\tlocalOpMetadata,\n\t\t\tthis.handler.reSubmit.bind(this.handler),\n\t\t);\n\t}\n\n\tpublic rollback(content: any, localOpMetadata: unknown) {\n\t\tif (this.handler.rollback === undefined) {\n\t\t\tthrow new Error(\"Handler doesn't support rollback\");\n\t\t}\n\t\tprocessWithStashedOpMetadataHandling(\n\t\t\tcontent,\n\t\t\tlocalOpMetadata,\n\t\t\tthis.handler.rollback.bind(this.handler),\n\t\t);\n\t}\n\n\tpublic applyStashedOp(content: any): unknown {\n\t\ttry {\n\t\t\tthis.stashedOpMd = this.isAttachedAndVisible() ? createStashedOpMetadata() : undefined;\n\t\t\tthis.handler.applyStashedOp(content);\n\t\t\treturn this.stashedOpMd;\n\t\t} finally {\n\t\t\tthis.stashedOpMd = undefined;\n\t\t}\n\t}\n\n\tpublic submit(contents: any, metadata: unknown): void {\n\t\tif (this.stashedOpMd !== undefined) {\n\t\t\tthis.stashedOpMd.push({ contents, metadata });\n\t\t} else {\n\t\t\tthis.submitFn(contents, metadata);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { type ILayerCompatDetails, type ILayerCompatSupportRequirements } from "@fluid-internal/client-utils";
|
|
6
|
+
/**
|
|
7
|
+
* The core compatibility details of the DataStore layer that is the same across all layer boundaries.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const dataStoreCoreCompatDetails: {
|
|
11
|
+
/**
|
|
12
|
+
* The package version of the Runtime layer.
|
|
13
|
+
*/
|
|
14
|
+
pkgVersion: string;
|
|
15
|
+
/**
|
|
16
|
+
* The current generation of the Runtime layer.
|
|
17
|
+
*/
|
|
18
|
+
generation: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* DataStore's compatibility details that is exposed to the Runtime layer.
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare const dataStoreCompatDetailsForRuntime: ILayerCompatDetails;
|
|
25
|
+
/**
|
|
26
|
+
* The requirements that the Runtime layer must meet to be compatible with this DataStore.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const runtimeSupportRequirements: ILayerCompatSupportRequirements;
|
|
30
|
+
/**
|
|
31
|
+
* Validates that the Runtime layer is compatible with this DataStore.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare function validateRuntimeCompatibility(maybeRuntimeCompatDetails: ILayerCompatDetails | undefined, disposeFn: () => void): void;
|
|
35
|
+
//# sourceMappingURL=dataStoreLayerCompatState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataStoreLayerCompatState.d.ts","sourceRoot":"","sources":["../src/dataStoreLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AAKtC;;;GAGG;AACH,eAAO,MAAM,0BAA0B;IACtC;;OAEG;;IAEH;;OAEG;;CAEH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gCAAgC,EAAE,mBAM9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,+BAUxC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,yBAAyB,EAAE,mBAAmB,GAAG,SAAS,EAC1D,SAAS,EAAE,MAAM,IAAI,GACnB,IAAI,CAoBN"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.validateRuntimeCompatibility = exports.runtimeSupportRequirements = exports.dataStoreCompatDetailsForRuntime = exports.dataStoreCoreCompatDetails = void 0;
|
|
8
|
+
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
|
+
const internal_1 = require("@fluidframework/telemetry-utils/internal");
|
|
10
|
+
const packageVersion_js_1 = require("./packageVersion.js");
|
|
11
|
+
/**
|
|
12
|
+
* The core compatibility details of the DataStore layer that is the same across all layer boundaries.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
exports.dataStoreCoreCompatDetails = {
|
|
16
|
+
/**
|
|
17
|
+
* The package version of the Runtime layer.
|
|
18
|
+
*/
|
|
19
|
+
pkgVersion: packageVersion_js_1.pkgVersion,
|
|
20
|
+
/**
|
|
21
|
+
* The current generation of the Runtime layer.
|
|
22
|
+
*/
|
|
23
|
+
generation: 1,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* DataStore's compatibility details that is exposed to the Runtime layer.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
exports.dataStoreCompatDetailsForRuntime = {
|
|
30
|
+
...exports.dataStoreCoreCompatDetails,
|
|
31
|
+
/**
|
|
32
|
+
* The features supported by the DataStore layer across the DataStore / Runtime boundary.
|
|
33
|
+
*/
|
|
34
|
+
supportedFeatures: new Set(),
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The requirements that the Runtime layer must meet to be compatible with this DataStore.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
exports.runtimeSupportRequirements = {
|
|
41
|
+
/**
|
|
42
|
+
* Minimum generation that Runtime must be at to be compatible with DataStore. Note that 0 is used here so
|
|
43
|
+
* that Runtime layers before the introduction of the layer compatibility enforcement are compatible.
|
|
44
|
+
*/
|
|
45
|
+
minSupportedGeneration: 0,
|
|
46
|
+
/**
|
|
47
|
+
* The features that the Runtime must support to be compatible with DataStore.
|
|
48
|
+
*/
|
|
49
|
+
requiredFeatures: [],
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Validates that the Runtime layer is compatible with this DataStore.
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeFn) {
|
|
56
|
+
const layerCheckResult = (0, client_utils_1.checkLayerCompatibility)(exports.runtimeSupportRequirements, maybeRuntimeCompatDetails);
|
|
57
|
+
if (!layerCheckResult.isCompatible) {
|
|
58
|
+
const error = new internal_1.UsageError("DataStore is not compatible with Runtime", {
|
|
59
|
+
errorDetails: JSON.stringify({
|
|
60
|
+
dataStoreVersion: exports.dataStoreCoreCompatDetails.pkgVersion,
|
|
61
|
+
runtimeVersion: maybeRuntimeCompatDetails?.pkgVersion,
|
|
62
|
+
dataStoreGeneration: exports.dataStoreCoreCompatDetails.generation,
|
|
63
|
+
runtimeGeneration: maybeRuntimeCompatDetails?.generation,
|
|
64
|
+
minSupportedGeneration: exports.runtimeSupportRequirements.minSupportedGeneration,
|
|
65
|
+
isGenerationCompatible: layerCheckResult.isGenerationCompatible,
|
|
66
|
+
unsupportedFeatures: layerCheckResult.unsupportedFeatures,
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
69
|
+
disposeFn();
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.validateRuntimeCompatibility = validateRuntimeCompatibility;
|
|
74
|
+
//# sourceMappingURL=dataStoreLayerCompatState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataStoreLayerCompatState.js","sourceRoot":"","sources":["../src/dataStoreLayerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAIsC;AACtC,uEAAsE;AAEtE,2DAAiD;AAEjD;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACzC;;OAEG;IACH,UAAU,EAAV,8BAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACb,CAAC;AAEF;;;GAGG;AACU,QAAA,gCAAgC,GAAwB;IACpE,GAAG,kCAA0B;IAC7B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACU,QAAA,0BAA0B,GAAoC;IAC1E;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,SAAgB,4BAA4B,CAC3C,yBAA0D,EAC1D,SAAqB;IAErB,MAAM,gBAAgB,GAAG,IAAA,sCAAuB,EAC/C,kCAA0B,EAC1B,yBAAyB,CACzB,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,qBAAU,CAAC,0CAA0C,EAAE;YACxE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;gBAC5B,gBAAgB,EAAE,kCAA0B,CAAC,UAAU;gBACvD,cAAc,EAAE,yBAAyB,EAAE,UAAU;gBACrD,mBAAmB,EAAE,kCAA0B,CAAC,UAAU;gBAC1D,iBAAiB,EAAE,yBAAyB,EAAE,UAAU;gBACxD,sBAAsB,EAAE,kCAA0B,CAAC,sBAAsB;gBACzE,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB;gBAC/D,mBAAmB,EAAE,gBAAgB,CAAC,mBAAmB;aACzD,CAAC;SACF,CAAC,CAAC;QACH,SAAS,EAAE,CAAC;QACZ,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAvBD,oEAuBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the DataStore layer that is the same across all layer boundaries.\n * @internal\n */\nexport const dataStoreCoreCompatDetails = {\n\t/**\n\t * The package version of the Runtime layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Runtime layer.\n\t */\n\tgeneration: 1,\n};\n\n/**\n * DataStore's compatibility details that is exposed to the Runtime layer.\n * @internal\n */\nexport const dataStoreCompatDetailsForRuntime: ILayerCompatDetails = {\n\t...dataStoreCoreCompatDetails,\n\t/**\n\t * The features supported by the DataStore layer across the DataStore / Runtime boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Runtime layer must meet to be compatible with this DataStore.\n * @internal\n */\nexport const runtimeSupportRequirements: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Runtime must be at to be compatible with DataStore. Note that 0 is used here so\n\t * that Runtime layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Runtime must support to be compatible with DataStore.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Runtime layer is compatible with this DataStore.\n * @internal\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\truntimeSupportRequirements,\n\t\tmaybeRuntimeCompatDetails,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst error = new UsageError(\"DataStore is not compatible with Runtime\", {\n\t\t\terrorDetails: JSON.stringify({\n\t\t\t\tdataStoreVersion: dataStoreCoreCompatDetails.pkgVersion,\n\t\t\t\truntimeVersion: maybeRuntimeCompatDetails?.pkgVersion,\n\t\t\t\tdataStoreGeneration: dataStoreCoreCompatDetails.generation,\n\t\t\t\truntimeGeneration: maybeRuntimeCompatDetails?.generation,\n\t\t\t\tminSupportedGeneration: runtimeSupportRequirements.minSupportedGeneration,\n\t\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t\t}),\n\t\t});\n\t\tdisposeFn();\n\t\tthrow error;\n\t}\n}\n"]}
|
|
@@ -76,6 +76,14 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
76
76
|
* controlled via feature flags.
|
|
77
77
|
*/
|
|
78
78
|
private localChangesTelemetryCount;
|
|
79
|
+
/**
|
|
80
|
+
* The compatibility details of the DataStore layer that is exposed to the Runtime layer
|
|
81
|
+
* for validating Runtime-DataStore compatibility.
|
|
82
|
+
* @remarks This is for internal use only.
|
|
83
|
+
* The type of this should be ILayerCompatDetails. However, ILayerCompatDetails is internal and this class
|
|
84
|
+
* is currently marked as legacy alpha. So, using unknown here.
|
|
85
|
+
*/
|
|
86
|
+
readonly ILayerCompatDetails?: unknown;
|
|
79
87
|
/**
|
|
80
88
|
* Create an instance of a DataStore runtime.
|
|
81
89
|
*
|
|
@@ -151,12 +159,6 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
151
159
|
* @param messageCollection - The collection of messages to process.
|
|
152
160
|
*/
|
|
153
161
|
processMessages(messageCollection: IRuntimeMessageCollection): void;
|
|
154
|
-
/**
|
|
155
|
-
* back-compat ADO 21575.
|
|
156
|
-
* @deprecated {@link FluidDataStoreRuntime.processMessages} should be used instead to process messages. This is still here for back-compat
|
|
157
|
-
* because it exists on IFluidDataStoreChannel. Once it is removed from the interface, this method can be removed.
|
|
158
|
-
*/
|
|
159
|
-
process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
160
162
|
processSignal(message: IInboundSignalMessage, local: boolean): void;
|
|
161
163
|
private isChannelAttached;
|
|
162
164
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAA4B,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EACN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAOrF,OAAO,EACN,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,KAAK,mBAAmB,EACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,cAAc,EACd,cAAc,EAId,MAAM,oCAAoC,C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,IAAI;CA4CtF;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,mBACf,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,QAAQ,SAAS,CAAC,SACnF,4BAA4B,iCAUD,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,YACtB,CACR,OAAO,EAAE,qBAAqB,KAC1B,QAAQ;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,SACvD,4BAA4B,iCAyCD,CAAC"}
|
package/dist/dataStoreRuntime.js
CHANGED
|
@@ -15,6 +15,7 @@ const internal_4 = require("@fluidframework/runtime-utils/internal");
|
|
|
15
15
|
const internal_5 = require("@fluidframework/telemetry-utils/internal");
|
|
16
16
|
const uuid_1 = require("uuid");
|
|
17
17
|
const channelContext_js_1 = require("./channelContext.js");
|
|
18
|
+
const dataStoreLayerCompatState_js_1 = require("./dataStoreLayerCompatState.js");
|
|
18
19
|
const fluidHandle_js_1 = require("./fluidHandle.js");
|
|
19
20
|
const localChannelContext_js_1 = require("./localChannelContext.js");
|
|
20
21
|
const packageVersion_js_1 = require("./packageVersion.js");
|
|
@@ -101,7 +102,18 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
101
102
|
// A list of handles that are bound when the data store is not visible. We have to make them visible when the data
|
|
102
103
|
// store becomes visible.
|
|
103
104
|
this.pendingHandlesToMakeVisible = new Set();
|
|
105
|
+
/**
|
|
106
|
+
* The compatibility details of the DataStore layer that is exposed to the Runtime layer
|
|
107
|
+
* for validating Runtime-DataStore compatibility.
|
|
108
|
+
* @remarks This is for internal use only.
|
|
109
|
+
* The type of this should be ILayerCompatDetails. However, ILayerCompatDetails is internal and this class
|
|
110
|
+
* is currently marked as legacy alpha. So, using unknown here.
|
|
111
|
+
*/
|
|
112
|
+
this.ILayerCompatDetails = dataStoreLayerCompatState_js_1.dataStoreCompatDetailsForRuntime;
|
|
104
113
|
(0, internal_1.assert)(!dataStoreContext.id.includes("/"), 0x30e /* Id cannot contain slashes. DataStoreContext should have validated this. */);
|
|
114
|
+
// Validate that the Runtime is compatible with this DataStore.
|
|
115
|
+
const maybeRuntimeCompatDetails = dataStoreContext;
|
|
116
|
+
(0, dataStoreLayerCompatState_js_1.validateRuntimeCompatibility)(maybeRuntimeCompatDetails.ILayerCompatDetails, this.dispose.bind(this));
|
|
105
117
|
this.mc = (0, internal_5.createChildMonitoringContext)({
|
|
106
118
|
logger: dataStoreContext.baseLogger,
|
|
107
119
|
namespace: "FluidDataStoreRuntime",
|
|
@@ -286,7 +298,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
286
298
|
* in the snapshot.
|
|
287
299
|
* So, return short ids only if explicitly enabled via feature flags. Else, return uuid();
|
|
288
300
|
*/
|
|
289
|
-
if (this.mc.config.getBoolean("Fluid.Runtime.
|
|
301
|
+
if (this.mc.config.getBoolean("Fluid.Runtime.IsShortIdEnabled") === true) {
|
|
290
302
|
// We use three non-overlapping namespaces:
|
|
291
303
|
// - detached state: even numbers
|
|
292
304
|
// - attached state: odd numbers
|
|
@@ -512,24 +524,6 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
512
524
|
this.emit("op", { ...envelope, contents, clientSequenceNumber });
|
|
513
525
|
}
|
|
514
526
|
}
|
|
515
|
-
/**
|
|
516
|
-
* back-compat ADO 21575.
|
|
517
|
-
* @deprecated {@link FluidDataStoreRuntime.processMessages} should be used instead to process messages. This is still here for back-compat
|
|
518
|
-
* because it exists on IFluidDataStoreChannel. Once it is removed from the interface, this method can be removed.
|
|
519
|
-
*/
|
|
520
|
-
process(message, local, localOpMetadata) {
|
|
521
|
-
this.processMessages({
|
|
522
|
-
envelope: message,
|
|
523
|
-
messagesContent: [
|
|
524
|
-
{
|
|
525
|
-
contents: message.contents,
|
|
526
|
-
localOpMetadata,
|
|
527
|
-
clientSequenceNumber: message.clientSequenceNumber,
|
|
528
|
-
},
|
|
529
|
-
],
|
|
530
|
-
local,
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
527
|
processSignal(message, local) {
|
|
534
528
|
this.emit("signal", message, local);
|
|
535
529
|
}
|