@fluidframework/container-runtime 2.116.0-416006 → 2.116.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 +61 -0
- package/README.md +5 -3
- package/api-report/container-runtime.legacy.alpha.api.md +6 -4
- package/api-report/container-runtime.legacy.beta.api.md +30 -1
- package/container-runtime.test-files.tar +0 -0
- package/dist/channelCollection.d.ts +2 -2
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +3 -3
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerCompatibility.d.ts +3 -3
- package/dist/containerCompatibility.d.ts.map +1 -1
- package/dist/containerCompatibility.js +3 -3
- package/dist/containerCompatibility.js.map +1 -1
- package/dist/containerRuntime.d.ts +40 -16
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +33 -10
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -2
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/legacy.d.ts +3 -0
- package/dist/legacyAlpha.d.ts +3 -3
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/runtimeLayerCompatState.d.ts +1 -1
- package/dist/summary/documentSchema.d.ts +3 -3
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/versionMarks/versionMarkResolver.d.ts +3 -3
- package/dist/versionMarks/versionMarkResolver.js.map +1 -1
- package/lib/channelCollection.d.ts +2 -2
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +4 -4
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerCompatibility.d.ts +3 -3
- package/lib/containerCompatibility.d.ts.map +1 -1
- package/lib/containerCompatibility.js +3 -3
- package/lib/containerCompatibility.js.map +1 -1
- package/lib/containerRuntime.d.ts +40 -16
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +33 -10
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -2
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/legacy.d.ts +3 -0
- package/lib/legacyAlpha.d.ts +3 -3
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/runtimeLayerCompatState.d.ts +1 -1
- package/lib/summary/documentSchema.d.ts +3 -3
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/versionMarks/versionMarkResolver.d.ts +3 -3
- package/lib/versionMarks/versionMarkResolver.js.map +1 -1
- package/package.json +22 -22
- package/src/channelCollection.ts +6 -6
- package/src/containerCompatibility.ts +6 -6
- package/src/containerRuntime.ts +69 -25
- package/src/dataStoreContext.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/summary/documentSchema.ts +3 -3
- package/src/versionMarks/versionMarkResolver.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentSchema.js","sourceRoot":"","sources":["../../src/summary/documentSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,uEAA+E;AAC/E,yCAA0C;AAE1C,4DAAkD;AA0JlD;;;;;;;;;;;GAWG;AACU,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAsC9C,MAAM,eAAe;IACb,GAAG,CAAC,eAAsB,EAAE,cAAqB;QACvD,OAAO,eAAe,KAAK,IAAI,IAAI,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;IAEM,EAAE,CAAC,eAAsB,EAAE,cAAqB;QACtD,OAAO,eAAe,KAAK,IAAI,IAAI,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,C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AG,KAAK,CAAC;IACxB,CAAC;CACD;AAlSD,8DAkSC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,OAAe;IAClC,MAAM,MAAM,GAAG,IAAA,iBAAK,EAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC;AACrD,CAAC;AAED,2CAA2C","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 type { SemanticVersion } from \"@fluidframework/runtime-utils/internal\";\nimport type { TelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\nimport { DataProcessingError } from \"@fluidframework/telemetry-utils/internal\";\nimport { gt, lt, parse } from \"semver-ts\";\n\nimport { pkgVersion } from \"../packageVersion.js\";\n\n/**\n * Descripe allowed type for properties in document schema.\n * Please note that for all property types we should use undefined to indicate that particular capability is off.\n * Using false, or some string value (like \"off\") will result in clients who do not understand that property failing, whereas\n * we want them to continue to collaborate alongside clients who support that capability, but such capability is shipping dark for now.\n * @internal\n */\nexport type DocumentSchemaValueType = string | string[] | true | number | undefined;\n\n/**\n * ID Compressor mode.\n * \"on\" - compressor is On. It's loaded as part of container load. This mode is sticky - once on, compressor is On for all\n * sessions for a given document. This results in IContainerRuntime.idCompressor to be always available.\n * \"delayed\" - ID compressor bundle is loaded only on establishing of first delta connection, i.e. it does not impact boot of cotnainer.\n * In such mode IContainerRuntime.idCompressor is not made available (unless previous sessions of same document had it \"On\").\n * The only thing that is available is IContainerRuntime.generateDocumentUniqueId() that provides opportunistically short IDs.\n * undefined - ID compressor is not loaded.\n * While IContainerRuntime.generateDocumentUniqueId() is available, it will produce long IDs that are do not compress well.\n *\n * @legacy @beta\n */\nexport type IdCompressorMode = \"on\" | \"delayed\" | undefined;\n\n/**\n * Document schema information.\n * Describes overall shape of document schema, including unknown (to this version) properties.\n *\n * Used by runtime to make a call if it can understand document schema.\n * If it can't, it should not continue with document and immediately fail, preventing random (cryptic) failures\n * down the road and potentially corrupting documents.\n * For now this structure and appropriate interpretation / behavior is focused only on runtime features.\n * In the future that could be interpolated to more areas, including DDSs used, and even possibly - application\n * schema.\n *\n * Runtime will ignore any properties at the root that it does not understand (i.e. IDocumentSchema.app), but will\n * stop (and fail session) on any unknown properties within \"runtime\" sub-tree.\n *\n * In most cases values preserved in the document will not dictate if such features should be enabled in a given session.\n * I.e. if compression is mentioned in document schema, this means that runtime version that opens such document must know\n * how to interpret such ops, but does not need to actually use compression itself. That said, some options could be\n * sticky, i.e. influence feature selection for all runtimes opening a document. ID compression is one such example.\n * Currently there is no mechanism to remove feature from this property bag, i.e. once compression was used, even if it's\n * disabled (through feature gate or code deployment), all existing documents that used compression will continue to fail\n * if opened by clients who do not support compression.\n *\n * For now we are limiting it to just plain properties, and only really simple types, but that can be changed in the future.\n *\n * @internal\n */\nexport interface IDocumentSchema {\n\t// Note: Incoming schemas from other clients may have additional root-level properties (i.e. IDocumentSchema.app)\n\t// that this client does not understand. The runtime will ignore these properties, unless they are within the\n\t// \"runtime\" sub-tree, in which case it will fail if it is unable to understand any runtime properties.\n\n\t/**\n\t * Describes how data needed to understand the schema is stored in this structure.\n\t * If runtime sees a version it does not understand, it should immediately fail and not\n\t * attempt to interpret any further data.\n\t */\n\tversion: number;\n\n\t/**\n\t * Sequence number when this schema became active.\n\t */\n\trefSeq: number;\n\n\t/**\n\t * Runtime configurations that affect the document schema. Other clients must understand these\n\t * properties to be able to open the document.\n\t */\n\truntime: Record<string, DocumentSchemaValueType>;\n\n\t/**\n\t * Info about this document that can be updated via Document Schema change op, but isn't required\n\t * to be understood by all clients (unlike the rest of IDocumentSchema properties). Because of this,\n\t * some older documents may not have this property, so it's an optional property.\n\t */\n\tinfo?: IDocumentSchemaInfo;\n}\n\n/**\n * Informational properties of the document that are not subject to strict schema enforcement.\n *\n * @internal\n */\nexport interface IDocumentSchemaInfo {\n\t/**\n\t * The minimum version of the FF runtime that should be used to load this document.\n\t * Will likely be advanced over time as applications pick up later FF versions.\n\t *\n\t * We use this to issue telemetry warning events if a client tries to open a document\n\t * with a runtime version lower than this.\n\t *\n\t * See {@link @fluidframework/container-runtime#LoadContainerRuntimeParams} for additional details on `minVersionForCollab`.\n\t *\n\t * @remarks\n\t * We use `SemanticVersion` instead of `MinimumVersionForCollab` since we may open future documents with a\n\t * minVersionForCollab version that `MinimumVersionForCollab` does not support.\n\t * Note that in such a case (where minVersionForCollab is not a valid `MinimumVersionForCollab`),\n\t * loading the document might not work since this version of the runtime may not support it.\n\t */\n\tminVersionForCollab: SemanticVersion;\n}\n\n/**\n * Content of the type=ContainerMessageType.DocumentSchemaChange ops.\n * The meaning of refSeq field is different in such messages (compared to other usages of IDocumentSchemaCurrent)\n * ContainerMessageType.DocumentSchemaChange messages use CAS (Compare-and-swap) semantics, and convey\n * regSeq of last known schema change (known to a client proposing schema change).\n * @see InboundContainerRuntimeDocumentSchemaMessage\n * @internal\n */\nexport type IDocumentSchemaChangeMessageIncoming = IDocumentSchema;\n\n/**\n * Similar to {@link IDocumentSchemaChangeMessageIncoming}, but used for outgoing schema messages.\n * @see OutboundContainerRuntimeDocumentSchemaMessage\n * @internal\n */\nexport type IDocumentSchemaChangeMessageOutgoing = IDocumentSchemaCurrent;\n\n/**\n * Settings that this session would like to have, based on options and feature gates.\n *\n * WARNING: This type is used to infer IDocumentSchemaCurrent type!\n * Any changes here (including renaming of properties) are potentially changing document format and should be considered carefully!\n *\n * @internal\n */\nexport interface IDocumentSchemaFeatures {\n\t// Tells if client uses legacy behavior of changing schema.\n\t// - Legacy behavior - changing schema without leveraging schema change ops.\n\t// - New behavior - changes in schema require ops and take into affect with delay.\n\texplicitSchemaControl: boolean;\n\tcompressionLz4: boolean;\n\tidCompressorMode: IdCompressorMode;\n\topGroupingEnabled: boolean;\n\tcreateBlobPayloadPending: true | undefined;\n\n\t/**\n\t * List of disallowed versions of the runtime.\n\t * This option is sticky. Once a version of runtime is added to this list (when supplied to DocumentsSchemaController's constructor)\n\t * it will be added to the list of disallowed versions and stored in document metadata.\n\t * Each runtime checks if its version is in this list on container open. If it is, it immediately exits with error message\n\t * indicating to the user that this version is no longer supported.\n\t * Currently there is no mechanism to remove version from this list. I.e. If it was once added to the list,\n\t * it gets added to any document metadata (documents that gets open by this runtime) and there is no way to clear it from document's\n\t * metadata.\n\t */\n\tdisallowedVersions: string[];\n}\n\n/**\n * Current version known properties that define document schema\n * This must be bumped whenever the format of document schema or protocol for changing the current document schema changes\n * in a way that all old/new clients are required to understand.\n * Ex: Adding a new configuration property (under IDocumentSchema.runtime) does not require changing this version since there is logic\n * in old clients for handling new/unknown properties.\n * Ex: Adding a new property to IDocumentSchema.info does not require changing this version, since info properties are not required to be\n * understood by all clients.\n * Ex: Changing the 'document schema acceptance' mechanism from convert-and-swap to one requiring consensus does require changing this version\n * since all clients need to understand the new protocol.\n * @internal\n */\nexport const currentDocumentVersionSchema = 1;\n\n/**\n * Current document schema.\n * This interface represents the schema that we currently understand and know the\n * structure of (which properties will be present).\n *\n * @internal\n */\nexport interface IDocumentSchemaCurrent extends Required<IDocumentSchema> {\n\t// This is the version of the schema that we currently understand.\n\tversion: typeof currentDocumentVersionSchema;\n\t// This narrows the runtime property to only include the properties in IDocumentSchemaFeatures (all as optional)\n\truntime: {\n\t\t[P in keyof IDocumentSchemaFeatures]?: IDocumentSchemaFeatures[P] extends boolean\n\t\t\t? true\n\t\t\t: IDocumentSchemaFeatures[P];\n\t};\n}\n\n/**\n * Document schema that is incoming from another client but validated to be \"current\".\n *\n * This interface represents when we have validated that an incoming IDocumentSchema object\n * is compatible with the current runtime (by calling `checkRuntimeCompatibility()`).\n * However, the `info` property is optional because some older documents may not have this property, but\n * `info` is not required to be understood by all clients to be compatible.\n */\ninterface IDocumentSchemaCurrentIncoming extends Omit<IDocumentSchemaCurrent, \"info\"> {\n\tinfo?: IDocumentSchemaInfo;\n}\n\ninterface IProperty<T = unknown> {\n\tand: (persistedSchema: T, providedSchema: T) => T;\n\tor: (persistedSchema: T, providedSchema: T) => T;\n\tvalidate(t: unknown): boolean;\n}\n\nclass TrueOrUndefined implements IProperty<true | undefined> {\n\tpublic and(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn persistedSchema === true && providedSchema === true ? true : undefined;\n\t}\n\n\tpublic or(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn persistedSchema === true || providedSchema === true ? true : undefined;\n\t}\n\n\tpublic validate(t: unknown): t is true | undefined {\n\t\treturn t === undefined || t === true;\n\t}\n}\n\nclass TrueOrUndefinedMax extends TrueOrUndefined {\n\tpublic and(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn this.or(persistedSchema, providedSchema);\n\t}\n}\n\nclass MultiChoice implements IProperty<string | undefined> {\n\tconstructor(private readonly choices: string[]) {}\n\n\tpublic and(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\tif (persistedSchema === undefined || providedSchema === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.choices[\n\t\t\tMath.min(this.choices.indexOf(persistedSchema), this.choices.indexOf(providedSchema))\n\t\t];\n\t}\n\n\tpublic or(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\tif (persistedSchema === undefined) {\n\t\t\treturn providedSchema;\n\t\t}\n\t\tif (providedSchema === undefined) {\n\t\t\treturn persistedSchema;\n\t\t}\n\t\treturn this.choices[\n\t\t\tMath.max(this.choices.indexOf(persistedSchema), this.choices.indexOf(providedSchema))\n\t\t];\n\t}\n\n\tpublic validate(t: unknown): boolean {\n\t\treturn t === undefined || (typeof t === \"string\" && this.choices.includes(t));\n\t}\n}\n\nclass IdCompressorProperty extends MultiChoice {\n\t// document schema always wins!\n\tpublic and(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\treturn persistedSchema;\n\t}\n}\n\nclass CheckVersions implements IProperty<string[] | undefined> {\n\tpublic or(\n\t\tpersistedSchema: string[] = [],\n\t\tprovidedSchema: string[] = [],\n\t): string[] | undefined {\n\t\tconst set = new Set<string>([...persistedSchema, ...providedSchema]);\n\t\treturn arrayToProp([...set.values()]);\n\t}\n\n\t// Once version is there, it stays there forever.\n\tpublic and(\n\t\tpersistedSchema: string[] = [],\n\t\tprovidedSchema: string[] = [],\n\t): string[] | undefined {\n\t\treturn this.or(persistedSchema, providedSchema);\n\t}\n\n\tpublic validate(t: unknown): boolean {\n\t\treturn t === undefined || (Array.isArray(t) && !t.includes(pkgVersion));\n\t}\n}\n\n/**\n * Helper structure to valida if a schema is compatible with existing code.\n */\nconst documentSchemaSupportedConfigs = {\n\texplicitSchemaControl: new TrueOrUndefinedMax(), // once new behavior shows up, it's sticky\n\tidCompressorMode: new IdCompressorProperty([\"delayed\", \"on\"]),\n\topGroupingEnabled: new TrueOrUndefined(),\n\tcompressionLz4: new TrueOrUndefined(),\n\tcreateBlobPayloadPending: new TrueOrUndefined(),\n\tdisallowedVersions: new CheckVersions(),\n};\n\n/**\n * Entry in {@link retiredDocumentSchemaFeatures}.\n *\n * - `handler` validates/merges the persisted value (same as a \"non-retired\" feature).\n * - `value` is the hardcoded value that this runtime will always use for the desired schema.\n */\ninterface IRetiredFeatureEntry {\n\thandler: IProperty;\n\tvalue: DocumentSchemaValueType;\n}\n\n/**\n * Retired runtime features. A retired feature is one this runtime version no longer toggles\n * via {@link IDocumentSchemaFeatures}, but that older documents may still carry in their\n * persisted schema. Each entry bundles the property handler with the hardcoded value for the feature.\n *\n * Retired features participate in the normal merge / schema-change-op flow exactly like\n * non-retired features — the only difference is that their values are hardcoded.\n */\nconst retiredDocumentSchemaFeatures = {\n\t// Note: There are currently no retired retired features. To retire a feature, remove it from IDocumentSchemaFeatures\n\t// and documentSchemaSupportedConfigs and add an entry here, e.g.:\n\t// featureFoo: { handler: new TrueOrUndefined(), value: true },\n} satisfies Record<string, IRetiredFeatureEntry> & {\n\t// This ensures that retiredDocumentSchemaFeatures and IDocumentSchemaFeatures are mutually exclusive.\n\t[K in keyof IDocumentSchemaFeatures]?: never;\n};\n\n/**\n * Looks up the validator/merger for a given runtime property name across both supported and\n * retired configs. Returns `undefined` if the property is unknown to this runtime.\n */\nfunction getRuntimeConfigHandler(name: string): IProperty | undefined {\n\treturn (\n\t\t(documentSchemaSupportedConfigs as Record<string, IProperty>)[name] ??\n\t\t(retiredDocumentSchemaFeatures as Record<string, IRetiredFeatureEntry>)[name]?.handler\n\t);\n}\n\n/**\n * Builds the `{ key: value }` for retired features (for building the desired schema).\n */\nfunction retiredFeatureValues(): Record<string, DocumentSchemaValueType> {\n\tconst result: Record<string, DocumentSchemaValueType> = {};\n\tfor (const [key, entry] of Object.entries(\n\t\tretiredDocumentSchemaFeatures as Record<string, IRetiredFeatureEntry>,\n\t)) {\n\t\tresult[key] = entry.value;\n\t}\n\treturn result;\n}\n\n/**\n * Checks if a given schema is compatible with current code, i.e. if current code can understand all the features of that schema.\n * If schema is not compatible with current code, it throws an exception.\n * @param documentSchema - current schema\n */\nfunction checkRuntimeCompatibility(\n\tdocumentSchema: IDocumentSchema | undefined,\n\tschemaName: string,\n): asserts documentSchema is IDocumentSchemaCurrentIncoming {\n\t// Back-compat - we can't do anything about legacy documents.\n\t// There is no way to validate them, so we are taking a guess that safe deployment processes used by a given app\n\t// do not run into compat problems.\n\tif (documentSchema === undefined) {\n\t\treturn;\n\t}\n\n\tconst msg = \"Document can't be opened with current version of the code\";\n\tif (documentSchema.version !== currentDocumentVersionSchema) {\n\t\tthrow DataProcessingError.create(\n\t\t\tmsg,\n\t\t\t\"checkRuntimeCompat1\",\n\t\t\tundefined, // message\n\t\t\t{\n\t\t\t\truntimeSchemaVersion: documentSchema.version,\n\t\t\t\tcurrentRuntimeSchemaVersion: currentDocumentVersionSchema,\n\t\t\t\tschemaName,\n\t\t\t},\n\t\t);\n\t}\n\n\tlet unknownProperty: string | undefined;\n\n\tconst regSeq = documentSchema.refSeq;\n\t// defence in depth - it should not be possible to get here anything other than integer, but worth validating it.\n\tif (typeof regSeq !== \"number\" || regSeq < 0 || !Number.isInteger(regSeq)) {\n\t\tunknownProperty = \"refSeq\";\n\t} else if (documentSchema.runtime === null || typeof documentSchema.runtime !== \"object\") {\n\t\tunknownProperty = \"runtime\";\n\t} else {\n\t\tfor (const [name, value] of Object.entries(documentSchema.runtime)) {\n\t\t\tconst validator = getRuntimeConfigHandler(name);\n\t\t\tif (!(validator?.validate(value) ?? false)) {\n\t\t\t\tunknownProperty = `runtime/${name}`;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (unknownProperty !== undefined) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\tconst value = documentSchema[unknownProperty];\n\t\tthrow DataProcessingError.create(\n\t\t\tmsg,\n\t\t\t\"checkRuntimeCompat2\",\n\t\t\tundefined, // message\n\t\t\t{\n\t\t\t\tcodeVersion: currentDocumentVersionSchema,\n\t\t\t\tproperty: unknownProperty,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tvalue,\n\t\t\t\tschemaName,\n\t\t\t},\n\t\t);\n\t}\n}\n\nfunction and(\n\tpersistedSchema: IDocumentSchemaCurrentIncoming,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): IDocumentSchemaCurrent {\n\tconst runtime = {};\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\truntime[key] = (getRuntimeConfigHandler(key) as IProperty).and(\n\t\t\tpersistedSchema.runtime[key],\n\t\t\tprovidedSchema.runtime[key],\n\t\t);\n\t}\n\n\t// We keep the persisted minVersionForCollab if present, even if the provided minVersionForCollab\n\t// is higher.\n\tconst minVersionForCollab =\n\t\tpersistedSchema.info?.minVersionForCollab ?? providedSchema.info.minVersionForCollab;\n\n\treturn {\n\t\tversion: currentDocumentVersionSchema,\n\t\trefSeq: persistedSchema.refSeq,\n\t\tinfo: { minVersionForCollab },\n\t\truntime,\n\t};\n}\n\nfunction or(\n\tpersistedSchema: IDocumentSchemaCurrentIncoming,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): IDocumentSchemaCurrent {\n\tconst runtime = {};\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\truntime[key] = (getRuntimeConfigHandler(key) as IProperty).or(\n\t\t\tpersistedSchema.runtime[key],\n\t\t\tprovidedSchema.runtime[key],\n\t\t);\n\t}\n\n\t// We take the greater of the persisted/provided minVersionForCollab\n\tconst minVersionForCollab =\n\t\tpersistedSchema.info === undefined\n\t\t\t? providedSchema.info.minVersionForCollab\n\t\t\t: gt(persistedSchema.info.minVersionForCollab, providedSchema.info.minVersionForCollab)\n\t\t\t\t? persistedSchema.info.minVersionForCollab\n\t\t\t\t: providedSchema.info.minVersionForCollab;\n\n\treturn {\n\t\tversion: currentDocumentVersionSchema,\n\t\trefSeq: persistedSchema.refSeq,\n\t\tinfo: { minVersionForCollab },\n\t\truntime,\n\t};\n}\n\n/**\n * Determines if two schemas are the \"same\".\n * Schemas are considered **not** the same if a schema change op is required to make\n * the properties of `persistedSchema` match to the properties of `providedSchema`.\n */\nfunction same(\n\tpersistedSchema: IDocumentSchemaCurrentIncoming,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): boolean {\n\tif (\n\t\tpersistedSchema.info === undefined ||\n\t\tlt(persistedSchema.info.minVersionForCollab, providedSchema.info.minVersionForCollab)\n\t) {\n\t\t// If the persisted schema's minVersionForCollab is undefined or less than the provided schema's\n\t\t// minVersionForCollab, then we should send a schema change op to update the minVersionForCollab.\n\t\treturn false;\n\t}\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\t// If schemas differ only by type of behavior, then we should not send schema change ops!\n\t\tif (\n\t\t\tkey !== \"explicitSchemaControl\" &&\n\t\t\tpersistedSchema.runtime[key] !== providedSchema.runtime[key]\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction boolToProp(b: boolean): true | undefined {\n\treturn b ? true : undefined;\n}\n\nfunction arrayToProp(arr: string[]): string[] | undefined {\n\treturn arr.length === 0 ? undefined : arr;\n}\n\n/* eslint-disable jsdoc/check-indentation */\n\n/**\n * Controller of document schema.\n *\n * Recommended pre-reading: https://github.com/microsoft/FluidFramework/blob/main/packages/dds/SchemaVersioning.md\n *\n * This class manages current document schema and transitions between document schemas.\n * At the moment, it only focuses on subset of document schema, specifically - how FluidFramework runtime serializes data\n * (summary and op format), features & capabilities that a version of runtime has to support and understand in\n * order to collaborate on a document.\n * New features that modify document format have to be included in document schema definition.\n * Usage of such features could only happen after document schema has been updated to reflect such feature.\n *\n * This formality allows clients that do not understand such features to fail right away when they observe\n * document schema listing capabilities that such client does not understand.\n * Old clients will fail in predictable way. This allows us to\n * 1) Immediately see such issues and adjust if features are enabled too early, before changes have been saturated.\n * 2) There is no way to get to 100% saturation with new code. Even if we have 99.99% saturation, there are\n * still 0.01% of clients who will fail. Failing early and predictably ensures they have no chance to limp along\n * and potentially corrupt the document. This is especially true for summarizer client, who could simply \"undo\"\n * changes it does not understands.\n *\n * It's important to note how it overlaps with feature gates and safe velocity.\n * If new feature was in use, that resulted in a number of documents referencing such feature in document schema.\n * But, developers (through code deployment or feature gates) could disable usage of such features.\n * That will stop a process of further document schema changes (for documents that were not using such feature).\n * And documents that already list such capability in their schema will continue to do so. Later ensures that old\n * clients who do not understand such feature will continue to fail to open such documents, as such documents very\n * likely contain data in a new format.\n *\n * Controller operates with 4 schemas:\n * - document schema: whatever we loaded from summary metadata + ops. It follows eventuall consistency rules (i.e. like DDS).\n * - desired schema - what client is asking for to have (i.e. all the desired settings, based on runtime options / feature gates).\n * - session schema - current session schema. It's \"and\" of the above two schemas.\n * - future schema - \"or\" of document and desires schemas.\n *\n * \"or\" & \"and\" operators are defined individually for each property. For Boolean properties it's literally &&, || operators.\n * But for other properties it's more nuanced.\n *\n * Whenver document schema does not match future schema, controller will send an op that attempts to changs documents schema to\n * future schema.\n *\n * Users of this class need to use DocumentsSchemaController.sessionSchema to determine what features can be used.\n *\n * There are three modes this class can operate:\n * 1) Legacy mode. In such mode it does not issue any ops to change document schema. Any changes happen implicitly,\n * right away, and new features are available right away\n * 2) Non-legacy mode. In such mode any changes to schema require an op roundtrip. This class will manage such transitions.\n * However code should assume that any new features that were not enabled in a given document will not be available\n * for a given session. That's because this session may never send any ops (including read-only documents). Or it may\n * fail to convert schema.\n * This class promises eventual movement forward. I.e. if new feature is allowed (let's say - through feature gates),\n * then eventually all documents that are modified will have that feature reflected in their schema. It could require\n * multiple reloads / new sessions to get there (depends on if code reacts to schema changes right away, or only consults\n * schema on document load).\n * 3) Schema upgrade disabled mode (disableSchemaUpgrade = true). In this mode the controller will never send DocumentSchemaChange ops\n * and will throw an error if any incoming schema change ops are received. The document schema is effectively frozen at the schema\n * loaded for this session (snapshot) and will not accept further schema-change ops.\n *\n * How schemas are changed (in non-legacy mode):\n * If a client needs to change a schema, it will attempt to do so as part of normal ops sending process.\n * Changes happen in CAS (Compare-and-swap) fashion, i.e. client tells current schema and schema it wants to change to.\n * When a number of clients race to change a schema, then only one of them will win, all others will fail because they will\n * reference old schema that is no longer in effect.\n * Clients can retry, but current implementation is simply - they will not (and will rely on next session / reload to do\n * recalc and decide if schema needs to be changed or not).\n *\n * @internal\n * @sealed\n */\nexport class DocumentsSchemaController {\n\tprivate explicitSchemaControl: boolean;\n\n\t/**\n\t * Have we generated a DocumentSchemaChange op and we're waiting for the ack?\n\t * This is used to ensure that we do not generate multiple schema change ops - this client should only ever send one (if any).\n\t */\n\tprivate opPending = false;\n\n\t// schema coming from document metadata (snapshot we loaded from)\n\tprivate documentSchema: IDocumentSchema;\n\n\t// desired schema, based on feature gates / runtime options.\n\t// This includes requests to enable to disable functionality\n\tprivate readonly desiredSchema: IDocumentSchemaCurrent;\n\n\t// OR() of document schema and desired schema. It enables all the features that are enabled in either of schemas.\n\tprivate futureSchema: IDocumentSchemaCurrent | undefined;\n\n\t// Current schema this session operates with.\n\t// 1) Legacy mode (explicitSchemaControl === false): this is same as desired schema - all options that were requested to be on are on, and all options requested to be off are off.\n\t// 2) Non-legacy mode (explicitSchemaControl === true): this is AND() of document schema and desired schema. Only options that are enabled in both are enabled here.\n\t// If there are any options that are not enabled in document schema, but are enabled in desired schema, then attempt to change schema\n\t// (and enable such options) will be made through the session.\n\tpublic sessionSchema: IDocumentSchemaCurrent;\n\n\t/**\n\t * Constructs DocumentsSchemaController that controls current schema and processes around it, including changes in schema.\n\t * @param existing - Is the document existing document, or a new doc.\n\t * @param documentMetadataSchema - current document's schema, if present.\n\t * @param features - features of the document schema that current session wants to see enabled.\n\t * @param onSchemaChange - callback that is called whenever schema is changed (not called on creation / load, only when processing document schema change ops)\n\t * @param info - Informational properties of the document that are not subject to strict schema enforcement\n\t * @param logger - telemetry logger from the runtime\n\t * @param disableSchemaUpgrade - when true, the controller will never send or accept DocumentSchemaChange ops\n\t */\n\tconstructor(\n\t\texisting: boolean,\n\t\tsnapshotSequenceNumber: number,\n\t\tdocumentMetadataSchema: IDocumentSchema | undefined,\n\t\tfeatures: IDocumentSchemaFeatures,\n\t\tprivate readonly onSchemaChange: (schema: IDocumentSchemaCurrent) => void,\n\t\tinfo: IDocumentSchemaInfo,\n\t\tlogger: TelemetryLoggerExt,\n\t\tprivate readonly disableSchemaUpgrade: boolean,\n\t) {\n\t\t// For simplicity, let's only support new schema features for explicit schema control mode\n\t\tassert(\n\t\t\tfeatures.disallowedVersions.length === 0 || features.explicitSchemaControl,\n\t\t\t0x949 /* not supported */,\n\t\t);\n\n\t\t// We check the document's metadata to see if there is a minVersionForCollab. If it's not an existing document or\n\t\t// if the document is older, then it won't have one. If it does have a minVersionForCollab, we check if it's greater\n\t\t// than this client's runtime version. If so, we log a telemetry event to warn the customer that the client is outdated.\n\t\t// Note: We only send a warning because we will confirm via `checkRuntimeCompatibility` if this client **can** understand\n\t\t// the existing document's schema. We still want to issue a warning regardless if this client can or cannot understand the\n\t\t// schema since it may be a sign that the customer is not properly waiting for saturation before updating their\n\t\t// `minVersionForCollab` value, which could cause disruptions to users in the future.\n\t\tconst existingMinVersionForCollab = documentMetadataSchema?.info?.minVersionForCollab;\n\t\tif (\n\t\t\texistingMinVersionForCollab !== undefined &&\n\t\t\tgt(existingMinVersionForCollab, pkgVersion) &&\n\t\t\t// We also want to avoid sending the telemetry warning for dev builds, since they currently are formatted as\n\t\t\t// `0.0.0-#####-test`. This will cause the telemetry warning to constantly fire.\n\t\t\t// TODO: This can be removed after ADO:41351\n\t\t\t!isDevBuild(pkgVersion)\n\t\t) {\n\t\t\tconst warnMsg = `WARNING: The version of Fluid Framework used by this client (${pkgVersion}) is not supported by this document! Please upgrade to version ${existingMinVersionForCollab} or later to ensure compatibility.`;\n\t\t\tlogger.sendTelemetryEvent({\n\t\t\t\teventName: \"MinVersionForCollabWarning\",\n\t\t\t\tmessage: warnMsg,\n\t\t\t});\n\t\t}\n\n\t\t// Desired schema by this session - almost all props are coming from arguments\n\t\tthis.desiredSchema = {\n\t\t\tversion: currentDocumentVersionSchema,\n\t\t\trefSeq: documentMetadataSchema?.refSeq ?? 0,\n\t\t\tinfo,\n\t\t\truntime: {\n\t\t\t\texplicitSchemaControl: boolToProp(features.explicitSchemaControl),\n\t\t\t\tcompressionLz4: boolToProp(features.compressionLz4),\n\t\t\t\tidCompressorMode: features.idCompressorMode,\n\t\t\t\topGroupingEnabled: boolToProp(features.opGroupingEnabled),\n\t\t\t\tcreateBlobPayloadPending: features.createBlobPayloadPending,\n\t\t\t\tdisallowedVersions: arrayToProp(features.disallowedVersions),\n\t\t\t\t...retiredFeatureValues(),\n\t\t\t},\n\t\t};\n\n\t\t// Schema coming from document metadata (snapshot we loaded from), or if no document exists\n\t\t// (this is a new document) then this is the same as desiredSchema (same as session schema in such case).\n\t\t// Latter is important sure that's what will go into summary.\n\t\tthis.documentSchema = existing\n\t\t\t? (documentMetadataSchema ??\n\t\t\t\t({\n\t\t\t\t\tversion: currentDocumentVersionSchema,\n\t\t\t\t\t// see comment in summarizeDocumentSchema() on why it has to stay zero\n\t\t\t\t\trefSeq: 0,\n\t\t\t\t\tinfo,\n\t\t\t\t\t// If it's existing document and it has no schema, then it was written by legacy client.\n\t\t\t\t\t// If it's a new document, then we define it's legacy-related behaviors.\n\t\t\t\t\truntime: {\n\t\t\t\t\t\texplicitSchemaControl: boolToProp(!existing && features.explicitSchemaControl),\n\t\t\t\t\t},\n\t\t\t\t} satisfies IDocumentSchemaCurrent))\n\t\t\t: this.desiredSchema;\n\n\t\tcheckRuntimeCompatibility(this.documentSchema, \"document\");\n\t\tthis.validateSeqNumber(this.documentSchema.refSeq, snapshotSequenceNumber, \"summary\");\n\n\t\t// Use legacy behavior only if both document and options tell us to use legacy.\n\t\t// Otherwise it's no longer legacy time!\n\t\tthis.explicitSchemaControl =\n\t\t\tthis.documentSchema.runtime.explicitSchemaControl === true ||\n\t\t\tfeatures.explicitSchemaControl;\n\n\t\t// Calculate\n\t\t// - current session schema (overlap of document schema and desired schema)\n\t\t// - future schema to propose (concatination of document schema and desired schema)\n\t\tif (!this.explicitSchemaControl || !existing) {\n\t\t\tthis.sessionSchema = this.desiredSchema;\n\t\t\tassert(\n\t\t\t\tboolToProp(this.explicitSchemaControl) ===\n\t\t\t\t\tthis.sessionSchema.runtime.explicitSchemaControl,\n\t\t\t\t0x94a /* explicitSchemaControl */,\n\t\t\t);\n\t\t\tthis.futureSchema = undefined;\n\t\t} else {\n\t\t\tthis.sessionSchema = and(this.documentSchema, this.desiredSchema);\n\t\t\tthis.futureSchema = or(this.documentSchema, this.desiredSchema);\n\t\t\tassert(this.sessionSchema.runtime.explicitSchemaControl === true, 0x94b /* legacy */);\n\t\t\tassert(this.futureSchema.runtime.explicitSchemaControl === true, 0x94c /* legacy */);\n\t\t\tif (same(this.documentSchema, this.futureSchema)) {\n\t\t\t\tthis.futureSchema = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Validate that schema we are operating in is actually a schema we consider compatible with current runtime.\n\t\tcheckRuntimeCompatibility(this.desiredSchema, \"desired\");\n\t\tcheckRuntimeCompatibility(this.sessionSchema, \"session\");\n\t\tcheckRuntimeCompatibility(this.futureSchema, \"future\");\n\t}\n\n\tpublic summarizeDocumentSchema(\n\t\trefSeq: number,\n\t): IDocumentSchema | IDocumentSchemaCurrent | undefined {\n\t\t// For legacy behavior, we could write nothing (return undefined).\n\t\t// It does not buy us anything, as whatever written in summary does not actually impact clients operating in legacy mode.\n\t\t// But writing current used config (and assuming most of the clients settle on same config over time) will help with transition\n\t\t// out of legacy mode, as clients transitioning out of it would be able to use all the\n\t\t// features that are mentioned in schema right away, without a need to go through schema transition (and thus for a session or\n\t\t// two losing ability to use all the features)\n\t\tconst schema = this.explicitSchemaControl ? this.documentSchema : this.desiredSchema;\n\n\t\t// It's important to keep refSeq at zero in legacy mode, such that transition out of it is simple and we do not have\n\t\t// race conditions. If we put any other number (including latest seq number), then we will have two clients\n\t\t// (loading from two different summaries) with different numbers, and eventual consistency will be broken as schema\n\t\t// change ops will be interpretted differently by those two clients.\n\t\tassert(\n\t\t\tthis.explicitSchemaControl || schema.refSeq === 0,\n\t\t\t0x94d /* refSeq should be zero */,\n\t\t);\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Called by Container runtime whenever it is about to send some op.\n\t * It gives opportunity for controller to issue its own ops - we do not want to send ops if there are no local changes in document.\n\t * Please consider note above constructor about race conditions - current design is to generate op only once in a session lifetime.\n\t * @returns Optional message to send. Always returns undefined when disableSchemaUpgrade is true.\n\t */\n\tpublic maybeGenerateSchemaMessage(): IDocumentSchemaChangeMessageOutgoing | undefined {\n\t\tif (this.disableSchemaUpgrade) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (this.futureSchema !== undefined && !this.opPending) {\n\t\t\tthis.opPending = true;\n\t\t\tassert(\n\t\t\t\tthis.explicitSchemaControl && this.futureSchema.runtime.explicitSchemaControl === true,\n\t\t\t\t0x94e /* not legacy */,\n\t\t\t);\n\t\t\treturn this.futureSchema;\n\t\t}\n\t}\n\n\tprivate validateSeqNumber(\n\t\tschemaSeqNumber: number,\n\t\tlastKnowSeqNumber: number,\n\t\tmessage: string,\n\t): void {\n\t\tif (!Number.isInteger(schemaSeqNumber) || !(schemaSeqNumber <= lastKnowSeqNumber)) {\n\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\"DocSchema: Incorrect sequence number\",\n\t\t\t\t\"checkRuntimeCompat3\",\n\t\t\t\tundefined, // message\n\t\t\t\t{\n\t\t\t\t\tschemaSeqNumber,\n\t\t\t\t\tsequenceNumber: lastKnowSeqNumber,\n\t\t\t\t\tmessage,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Process document schema change messages\n\t * Called by ContainerRuntime whenever it sees document schema messages.\n\t * When disableSchemaUpgrade is true, an error is thrown if any incoming schema change ops are received.\n\t * @param contents - contents of the messages\n\t * @param local - whether op is local\n\t * @param sequenceNumber - sequence number of the op\n\t * @returns true if schema was accepted, otherwise false (rejected due to failed CAS)\n\t */\n\tpublic processDocumentSchemaMessages(\n\t\tcontents: IDocumentSchemaChangeMessageIncoming[],\n\t\tlocal: boolean,\n\t\tsequenceNumber: number,\n\t): boolean {\n\t\tif (this.disableSchemaUpgrade) {\n\t\t\tassert(\n\t\t\t\t!local,\n\t\t\t\t0xceb /* local schema change messages should never be generated when disableSchemaUpgrade is enabled */,\n\t\t\t);\n\t\t\t// Clients with disableSchemaUpgrade enabled should never generate schema change messages, but they\n\t\t\t// may receive them from misconfigured clients. In such case, throw on any incoming schema change ops\n\t\t\t// to prevent unexpected schema upgrades.\n\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\"DocSchema: Received schema change op while disableSchemaUpgrade is enabled\",\n\t\t\t\t\"processDocumentSchemaMessages\",\n\t\t\t\tundefined,\n\t\t\t);\n\t\t}\n\t\tfor (const content of contents) {\n\t\t\tthis.validateSeqNumber(content.refSeq, this.documentSchema.refSeq, \"content.refSeq\");\n\t\t\tthis.validateSeqNumber(this.documentSchema.refSeq, sequenceNumber, \"refSeq\");\n\t\t\t// validate is strickly less, not equal\n\t\t\tassert(\n\t\t\t\tthis.documentSchema.refSeq < sequenceNumber,\n\t\t\t\t0x950 /* time should move forward only! */,\n\t\t\t);\n\n\t\t\tif (content.refSeq !== this.documentSchema.refSeq) {\n\t\t\t\t// CAS failed\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// This assert should be after checking for successful CAS above.\n\t\t\t// This will ensure we do not trip on our own messages that are no longer wanted as we processed someone else schema change message.\n\t\t\tassert(\n\t\t\t\t!local || (this.explicitSchemaControl && this.futureSchema !== undefined),\n\t\t\t\t0x951 /* not sending ops */,\n\t\t\t);\n\n\t\t\t// Changes are in effect. Immediately check that this client understands these changes\n\t\t\tcheckRuntimeCompatibility(content, \"change\");\n\t\t\tconst schema = {\n\t\t\t\t...content,\n\t\t\t\trefSeq: sequenceNumber,\n\t\t\t} satisfies IDocumentSchemaCurrentIncoming;\n\t\t\tthis.documentSchema = schema;\n\t\t\tthis.sessionSchema = and(schema, this.desiredSchema);\n\t\t\tassert(this.sessionSchema.refSeq === sequenceNumber, 0x97d /* seq# */);\n\n\t\t\t// legacy behavior is automatically off for the document once someone sends a schema op -\n\t\t\t// from now on it's fully controlled by ops.\n\t\t\t// This is very important, as summarizeDocumentSchema() should use this new schema!\n\t\t\tthis.explicitSchemaControl = true;\n\n\t\t\t// Stop attempting changing schema.\n\t\t\t// If it was local op, then we succeeded and do not need to try again.\n\t\t\t// If it was remote op, then some changes happened to schema.\n\t\t\t// We would need to recalculate this.futureSchema by merging changes that we just received.\n\t\t\t// Avoid this complexity for now - a new client session (loading from new summary with these changes)\n\t\t\t// will automatically do this recalculation and will figure out\n\t\t\tthis.futureSchema = undefined;\n\n\t\t\tthis.onSchemaChange(this.sessionSchema);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Indicates the pending op was not ack'd and we may try to send it again if needed.\n\t */\n\tpublic pendingOpNotAcked(): void {\n\t\tthis.opPending = false;\n\t}\n}\n\n/**\n * Determines if a given version is a dev-build (i.e. `0.0.0-#####-test`).\n */\nfunction isDevBuild(version: string): boolean {\n\tconst parsed = parse(version);\n\treturn parsed?.prerelease.includes(\"test\") ?? false;\n}\n\n/* eslint-enable jsdoc/check-indentation */\n"]}
|
|
1
|
+
{"version":3,"file":"documentSchema.js","sourceRoot":"","sources":["../../src/summary/documentSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,uEAA+E;AAC/E,yCAA0C;AAE1C,4DAAkD;AA0JlD;;;;;;;;;;;GAWG;AACU,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAsC9C,MAAM,eAAe;IACb,GAAG,CAAC,eAAsB,EAAE,cAAqB;QACvD,OAAO,eAAe,KAAK,IAAI,IAAI,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;IAEM,EAAE,CAAC,eAAsB,EAAE,cAAqB;QACtD,OAAO,eAAe,KAAK,IAAI,IAAI,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;IAEM,QAAQ,CAAC,CAAU;QACzB,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;IACtC,CAAC;CACD;AAED,MAAM,kBAAmB,SAAQ,eAAe;IACxC,GAAG,CAAC,eAAsB,EAAE,cAAqB;QACvD,OAAO,IAAI,CAAC,EAAE,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IACjD,CAAC;CACD;AAED,MAAM,WAAW;IAChB,YAA6B,OAAiB;QAAjB,YAAO,GAAP,OAAO,CAAU;IAAG,CAAC;IAE3C,GAAG,CAAC,eAAwB,EAAE,cAAuB;QAC3D,IAAI,eAAe,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS,EA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C;YAEF,sFAAsF;YACtF,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC7C,MAAM,MAAM,GAAG;gBACd,GAAG,OAAO;gBACV,MAAM,EAAE,cAAc;aACmB,CAAC;YAC3C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;YAC7B,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YACrD,IAAA,iBAAM,EAAC,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;YAEvE,yFAAyF;YACzF,4CAA4C;YAC5C,mFAAmF;YACnF,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;YAElC,mCAAmC;YACnC,sEAAsE;YACtE,6DAA6D;YAC7D,2FAA2F;YAC3F,qGAAqG;YACrG,+DAA+D;YAC/D,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;YAE9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACI,iBAAiB;QACvB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACxB,CAAC;CACD;AAlSD,8DAkSC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,OAAe;IAClC,MAAM,MAAM,GAAG,IAAA,iBAAK,EAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC;AACrD,CAAC;AAED,2CAA2C","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 type { SemanticVersion } from \"@fluidframework/runtime-utils/internal\";\nimport type { TelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\nimport { DataProcessingError } from \"@fluidframework/telemetry-utils/internal\";\nimport { gt, lt, parse } from \"semver-ts\";\n\nimport { pkgVersion } from \"../packageVersion.js\";\n\n/**\n * Descripe allowed type for properties in document schema.\n * Please note that for all property types we should use undefined to indicate that particular capability is off.\n * Using false, or some string value (like \"off\") will result in clients who do not understand that property failing, whereas\n * we want them to continue to collaborate alongside clients who support that capability, but such capability is shipping dark for now.\n * @internal\n */\nexport type DocumentSchemaValueType = string | string[] | true | number | undefined;\n\n/**\n * ID Compressor mode.\n * \"on\" - compressor is On. It's loaded as part of container load. This mode is sticky - once on, compressor is On for all\n * sessions for a given document. This results in IContainerRuntime.idCompressor to be always available.\n * \"delayed\" - ID compressor bundle is loaded only on establishing of first delta connection, i.e. it does not impact boot of cotnainer.\n * In such mode IContainerRuntime.idCompressor is not made available (unless previous sessions of same document had it \"On\").\n * The only thing that is available is IContainerRuntime.generateDocumentUniqueId() that provides opportunistically short IDs.\n * undefined - ID compressor is not loaded.\n * While IContainerRuntime.generateDocumentUniqueId() is available, it will produce long IDs that are do not compress well.\n *\n * @legacy @beta\n */\nexport type IdCompressorMode = \"on\" | \"delayed\" | undefined;\n\n/**\n * Document schema information.\n * Describes overall shape of document schema, including unknown (to this version) properties.\n *\n * Used by runtime to make a call if it can understand document schema.\n * If it can't, it should not continue with document and immediately fail, preventing random (cryptic) failures\n * down the road and potentially corrupting documents.\n * For now this structure and appropriate interpretation / behavior is focused only on runtime features.\n * In the future that could be interpolated to more areas, including DDSs used, and even possibly - application\n * schema.\n *\n * Runtime will ignore any properties at the root that it does not understand (i.e. IDocumentSchema.app), but will\n * stop (and fail session) on any unknown properties within \"runtime\" sub-tree.\n *\n * In most cases values preserved in the document will not dictate if such features should be enabled in a given session.\n * I.e. if compression is mentioned in document schema, this means that runtime version that opens such document must know\n * how to interpret such ops, but does not need to actually use compression itself. That said, some options could be\n * sticky, i.e. influence feature selection for all runtimes opening a document. ID compression is one such example.\n * Currently there is no mechanism to remove feature from this property bag, i.e. once compression was used, even if it's\n * disabled (through feature gate or code deployment), all existing documents that used compression will continue to fail\n * if opened by clients who do not support compression.\n *\n * For now we are limiting it to just plain properties, and only really simple types, but that can be changed in the future.\n *\n * @internal\n */\nexport interface IDocumentSchema {\n\t// Note: Incoming schemas from other clients may have additional root-level properties (i.e. IDocumentSchema.app)\n\t// that this client does not understand. The runtime will ignore these properties, unless they are within the\n\t// \"runtime\" sub-tree, in which case it will fail if it is unable to understand any runtime properties.\n\n\t/**\n\t * Describes how data needed to understand the schema is stored in this structure.\n\t * If runtime sees a version it does not understand, it should immediately fail and not\n\t * attempt to interpret any further data.\n\t */\n\tversion: number;\n\n\t/**\n\t * Sequence number when this schema became active.\n\t */\n\trefSeq: number;\n\n\t/**\n\t * Runtime configurations that affect the document schema. Other clients must understand these\n\t * properties to be able to open the document.\n\t */\n\truntime: Record<string, DocumentSchemaValueType>;\n\n\t/**\n\t * Info about this document that can be updated via Document Schema change op, but isn't required\n\t * to be understood by all clients (unlike the rest of IDocumentSchema properties). Because of this,\n\t * some older documents may not have this property, so it's an optional property.\n\t */\n\tinfo?: IDocumentSchemaInfo;\n}\n\n/**\n * Informational properties of the document that are not subject to strict schema enforcement.\n *\n * @internal\n */\nexport interface IDocumentSchemaInfo {\n\t/**\n\t * The minimum version of the FF runtime that should be used to load this document.\n\t * Will likely be advanced over time as applications pick up later FF versions.\n\t *\n\t * We use this to issue telemetry warning events if a client tries to open a document\n\t * with a runtime version lower than this.\n\t *\n\t * See {@link @fluidframework/container-runtime#LoadContainerRuntimeParams} for additional details on `minVersionForCollab`.\n\t *\n\t * @remarks\n\t * We use `SemanticVersion` instead of `OldestSupportedClientVersion` since we may open future documents with a\n\t * minVersionForCollab version that `OldestSupportedClientVersion` does not support.\n\t * Note that in such a case (where minVersionForCollab is not a valid `OldestSupportedClientVersion`),\n\t * loading the document might not work since this version of the runtime may not support it.\n\t */\n\tminVersionForCollab: SemanticVersion;\n}\n\n/**\n * Content of the type=ContainerMessageType.DocumentSchemaChange ops.\n * The meaning of refSeq field is different in such messages (compared to other usages of IDocumentSchemaCurrent)\n * ContainerMessageType.DocumentSchemaChange messages use CAS (Compare-and-swap) semantics, and convey\n * regSeq of last known schema change (known to a client proposing schema change).\n * @see InboundContainerRuntimeDocumentSchemaMessage\n * @internal\n */\nexport type IDocumentSchemaChangeMessageIncoming = IDocumentSchema;\n\n/**\n * Similar to {@link IDocumentSchemaChangeMessageIncoming}, but used for outgoing schema messages.\n * @see OutboundContainerRuntimeDocumentSchemaMessage\n * @internal\n */\nexport type IDocumentSchemaChangeMessageOutgoing = IDocumentSchemaCurrent;\n\n/**\n * Settings that this session would like to have, based on options and feature gates.\n *\n * WARNING: This type is used to infer IDocumentSchemaCurrent type!\n * Any changes here (including renaming of properties) are potentially changing document format and should be considered carefully!\n *\n * @internal\n */\nexport interface IDocumentSchemaFeatures {\n\t// Tells if client uses legacy behavior of changing schema.\n\t// - Legacy behavior - changing schema without leveraging schema change ops.\n\t// - New behavior - changes in schema require ops and take into affect with delay.\n\texplicitSchemaControl: boolean;\n\tcompressionLz4: boolean;\n\tidCompressorMode: IdCompressorMode;\n\topGroupingEnabled: boolean;\n\tcreateBlobPayloadPending: true | undefined;\n\n\t/**\n\t * List of disallowed versions of the runtime.\n\t * This option is sticky. Once a version of runtime is added to this list (when supplied to DocumentsSchemaController's constructor)\n\t * it will be added to the list of disallowed versions and stored in document metadata.\n\t * Each runtime checks if its version is in this list on container open. If it is, it immediately exits with error message\n\t * indicating to the user that this version is no longer supported.\n\t * Currently there is no mechanism to remove version from this list. I.e. If it was once added to the list,\n\t * it gets added to any document metadata (documents that gets open by this runtime) and there is no way to clear it from document's\n\t * metadata.\n\t */\n\tdisallowedVersions: string[];\n}\n\n/**\n * Current version known properties that define document schema\n * This must be bumped whenever the format of document schema or protocol for changing the current document schema changes\n * in a way that all old/new clients are required to understand.\n * Ex: Adding a new configuration property (under IDocumentSchema.runtime) does not require changing this version since there is logic\n * in old clients for handling new/unknown properties.\n * Ex: Adding a new property to IDocumentSchema.info does not require changing this version, since info properties are not required to be\n * understood by all clients.\n * Ex: Changing the 'document schema acceptance' mechanism from convert-and-swap to one requiring consensus does require changing this version\n * since all clients need to understand the new protocol.\n * @internal\n */\nexport const currentDocumentVersionSchema = 1;\n\n/**\n * Current document schema.\n * This interface represents the schema that we currently understand and know the\n * structure of (which properties will be present).\n *\n * @internal\n */\nexport interface IDocumentSchemaCurrent extends Required<IDocumentSchema> {\n\t// This is the version of the schema that we currently understand.\n\tversion: typeof currentDocumentVersionSchema;\n\t// This narrows the runtime property to only include the properties in IDocumentSchemaFeatures (all as optional)\n\truntime: {\n\t\t[P in keyof IDocumentSchemaFeatures]?: IDocumentSchemaFeatures[P] extends boolean\n\t\t\t? true\n\t\t\t: IDocumentSchemaFeatures[P];\n\t};\n}\n\n/**\n * Document schema that is incoming from another client but validated to be \"current\".\n *\n * This interface represents when we have validated that an incoming IDocumentSchema object\n * is compatible with the current runtime (by calling `checkRuntimeCompatibility()`).\n * However, the `info` property is optional because some older documents may not have this property, but\n * `info` is not required to be understood by all clients to be compatible.\n */\ninterface IDocumentSchemaCurrentIncoming extends Omit<IDocumentSchemaCurrent, \"info\"> {\n\tinfo?: IDocumentSchemaInfo;\n}\n\ninterface IProperty<T = unknown> {\n\tand: (persistedSchema: T, providedSchema: T) => T;\n\tor: (persistedSchema: T, providedSchema: T) => T;\n\tvalidate(t: unknown): boolean;\n}\n\nclass TrueOrUndefined implements IProperty<true | undefined> {\n\tpublic and(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn persistedSchema === true && providedSchema === true ? true : undefined;\n\t}\n\n\tpublic or(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn persistedSchema === true || providedSchema === true ? true : undefined;\n\t}\n\n\tpublic validate(t: unknown): t is true | undefined {\n\t\treturn t === undefined || t === true;\n\t}\n}\n\nclass TrueOrUndefinedMax extends TrueOrUndefined {\n\tpublic and(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn this.or(persistedSchema, providedSchema);\n\t}\n}\n\nclass MultiChoice implements IProperty<string | undefined> {\n\tconstructor(private readonly choices: string[]) {}\n\n\tpublic and(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\tif (persistedSchema === undefined || providedSchema === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.choices[\n\t\t\tMath.min(this.choices.indexOf(persistedSchema), this.choices.indexOf(providedSchema))\n\t\t];\n\t}\n\n\tpublic or(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\tif (persistedSchema === undefined) {\n\t\t\treturn providedSchema;\n\t\t}\n\t\tif (providedSchema === undefined) {\n\t\t\treturn persistedSchema;\n\t\t}\n\t\treturn this.choices[\n\t\t\tMath.max(this.choices.indexOf(persistedSchema), this.choices.indexOf(providedSchema))\n\t\t];\n\t}\n\n\tpublic validate(t: unknown): boolean {\n\t\treturn t === undefined || (typeof t === \"string\" && this.choices.includes(t));\n\t}\n}\n\nclass IdCompressorProperty extends MultiChoice {\n\t// document schema always wins!\n\tpublic and(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\treturn persistedSchema;\n\t}\n}\n\nclass CheckVersions implements IProperty<string[] | undefined> {\n\tpublic or(\n\t\tpersistedSchema: string[] = [],\n\t\tprovidedSchema: string[] = [],\n\t): string[] | undefined {\n\t\tconst set = new Set<string>([...persistedSchema, ...providedSchema]);\n\t\treturn arrayToProp([...set.values()]);\n\t}\n\n\t// Once version is there, it stays there forever.\n\tpublic and(\n\t\tpersistedSchema: string[] = [],\n\t\tprovidedSchema: string[] = [],\n\t): string[] | undefined {\n\t\treturn this.or(persistedSchema, providedSchema);\n\t}\n\n\tpublic validate(t: unknown): boolean {\n\t\treturn t === undefined || (Array.isArray(t) && !t.includes(pkgVersion));\n\t}\n}\n\n/**\n * Helper structure to valida if a schema is compatible with existing code.\n */\nconst documentSchemaSupportedConfigs = {\n\texplicitSchemaControl: new TrueOrUndefinedMax(), // once new behavior shows up, it's sticky\n\tidCompressorMode: new IdCompressorProperty([\"delayed\", \"on\"]),\n\topGroupingEnabled: new TrueOrUndefined(),\n\tcompressionLz4: new TrueOrUndefined(),\n\tcreateBlobPayloadPending: new TrueOrUndefined(),\n\tdisallowedVersions: new CheckVersions(),\n};\n\n/**\n * Entry in {@link retiredDocumentSchemaFeatures}.\n *\n * - `handler` validates/merges the persisted value (same as a \"non-retired\" feature).\n * - `value` is the hardcoded value that this runtime will always use for the desired schema.\n */\ninterface IRetiredFeatureEntry {\n\thandler: IProperty;\n\tvalue: DocumentSchemaValueType;\n}\n\n/**\n * Retired runtime features. A retired feature is one this runtime version no longer toggles\n * via {@link IDocumentSchemaFeatures}, but that older documents may still carry in their\n * persisted schema. Each entry bundles the property handler with the hardcoded value for the feature.\n *\n * Retired features participate in the normal merge / schema-change-op flow exactly like\n * non-retired features — the only difference is that their values are hardcoded.\n */\nconst retiredDocumentSchemaFeatures = {\n\t// Note: There are currently no retired retired features. To retire a feature, remove it from IDocumentSchemaFeatures\n\t// and documentSchemaSupportedConfigs and add an entry here, e.g.:\n\t// featureFoo: { handler: new TrueOrUndefined(), value: true },\n} satisfies Record<string, IRetiredFeatureEntry> & {\n\t// This ensures that retiredDocumentSchemaFeatures and IDocumentSchemaFeatures are mutually exclusive.\n\t[K in keyof IDocumentSchemaFeatures]?: never;\n};\n\n/**\n * Looks up the validator/merger for a given runtime property name across both supported and\n * retired configs. Returns `undefined` if the property is unknown to this runtime.\n */\nfunction getRuntimeConfigHandler(name: string): IProperty | undefined {\n\treturn (\n\t\t(documentSchemaSupportedConfigs as Record<string, IProperty>)[name] ??\n\t\t(retiredDocumentSchemaFeatures as Record<string, IRetiredFeatureEntry>)[name]?.handler\n\t);\n}\n\n/**\n * Builds the `{ key: value }` for retired features (for building the desired schema).\n */\nfunction retiredFeatureValues(): Record<string, DocumentSchemaValueType> {\n\tconst result: Record<string, DocumentSchemaValueType> = {};\n\tfor (const [key, entry] of Object.entries(\n\t\tretiredDocumentSchemaFeatures as Record<string, IRetiredFeatureEntry>,\n\t)) {\n\t\tresult[key] = entry.value;\n\t}\n\treturn result;\n}\n\n/**\n * Checks if a given schema is compatible with current code, i.e. if current code can understand all the features of that schema.\n * If schema is not compatible with current code, it throws an exception.\n * @param documentSchema - current schema\n */\nfunction checkRuntimeCompatibility(\n\tdocumentSchema: IDocumentSchema | undefined,\n\tschemaName: string,\n): asserts documentSchema is IDocumentSchemaCurrentIncoming {\n\t// Back-compat - we can't do anything about legacy documents.\n\t// There is no way to validate them, so we are taking a guess that safe deployment processes used by a given app\n\t// do not run into compat problems.\n\tif (documentSchema === undefined) {\n\t\treturn;\n\t}\n\n\tconst msg = \"Document can't be opened with current version of the code\";\n\tif (documentSchema.version !== currentDocumentVersionSchema) {\n\t\tthrow DataProcessingError.create(\n\t\t\tmsg,\n\t\t\t\"checkRuntimeCompat1\",\n\t\t\tundefined, // message\n\t\t\t{\n\t\t\t\truntimeSchemaVersion: documentSchema.version,\n\t\t\t\tcurrentRuntimeSchemaVersion: currentDocumentVersionSchema,\n\t\t\t\tschemaName,\n\t\t\t},\n\t\t);\n\t}\n\n\tlet unknownProperty: string | undefined;\n\n\tconst regSeq = documentSchema.refSeq;\n\t// defence in depth - it should not be possible to get here anything other than integer, but worth validating it.\n\tif (typeof regSeq !== \"number\" || regSeq < 0 || !Number.isInteger(regSeq)) {\n\t\tunknownProperty = \"refSeq\";\n\t} else if (documentSchema.runtime === null || typeof documentSchema.runtime !== \"object\") {\n\t\tunknownProperty = \"runtime\";\n\t} else {\n\t\tfor (const [name, value] of Object.entries(documentSchema.runtime)) {\n\t\t\tconst validator = getRuntimeConfigHandler(name);\n\t\t\tif (!(validator?.validate(value) ?? false)) {\n\t\t\t\tunknownProperty = `runtime/${name}`;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (unknownProperty !== undefined) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\tconst value = documentSchema[unknownProperty];\n\t\tthrow DataProcessingError.create(\n\t\t\tmsg,\n\t\t\t\"checkRuntimeCompat2\",\n\t\t\tundefined, // message\n\t\t\t{\n\t\t\t\tcodeVersion: currentDocumentVersionSchema,\n\t\t\t\tproperty: unknownProperty,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tvalue,\n\t\t\t\tschemaName,\n\t\t\t},\n\t\t);\n\t}\n}\n\nfunction and(\n\tpersistedSchema: IDocumentSchemaCurrentIncoming,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): IDocumentSchemaCurrent {\n\tconst runtime = {};\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\truntime[key] = (getRuntimeConfigHandler(key) as IProperty).and(\n\t\t\tpersistedSchema.runtime[key],\n\t\t\tprovidedSchema.runtime[key],\n\t\t);\n\t}\n\n\t// We keep the persisted minVersionForCollab if present, even if the provided minVersionForCollab\n\t// is higher.\n\tconst minVersionForCollab =\n\t\tpersistedSchema.info?.minVersionForCollab ?? providedSchema.info.minVersionForCollab;\n\n\treturn {\n\t\tversion: currentDocumentVersionSchema,\n\t\trefSeq: persistedSchema.refSeq,\n\t\tinfo: { minVersionForCollab },\n\t\truntime,\n\t};\n}\n\nfunction or(\n\tpersistedSchema: IDocumentSchemaCurrentIncoming,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): IDocumentSchemaCurrent {\n\tconst runtime = {};\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\truntime[key] = (getRuntimeConfigHandler(key) as IProperty).or(\n\t\t\tpersistedSchema.runtime[key],\n\t\t\tprovidedSchema.runtime[key],\n\t\t);\n\t}\n\n\t// We take the greater of the persisted/provided minVersionForCollab\n\tconst minVersionForCollab =\n\t\tpersistedSchema.info === undefined\n\t\t\t? providedSchema.info.minVersionForCollab\n\t\t\t: gt(persistedSchema.info.minVersionForCollab, providedSchema.info.minVersionForCollab)\n\t\t\t\t? persistedSchema.info.minVersionForCollab\n\t\t\t\t: providedSchema.info.minVersionForCollab;\n\n\treturn {\n\t\tversion: currentDocumentVersionSchema,\n\t\trefSeq: persistedSchema.refSeq,\n\t\tinfo: { minVersionForCollab },\n\t\truntime,\n\t};\n}\n\n/**\n * Determines if two schemas are the \"same\".\n * Schemas are considered **not** the same if a schema change op is required to make\n * the properties of `persistedSchema` match to the properties of `providedSchema`.\n */\nfunction same(\n\tpersistedSchema: IDocumentSchemaCurrentIncoming,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): boolean {\n\tif (\n\t\tpersistedSchema.info === undefined ||\n\t\tlt(persistedSchema.info.minVersionForCollab, providedSchema.info.minVersionForCollab)\n\t) {\n\t\t// If the persisted schema's minVersionForCollab is undefined or less than the provided schema's\n\t\t// minVersionForCollab, then we should send a schema change op to update the minVersionForCollab.\n\t\treturn false;\n\t}\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\t// If schemas differ only by type of behavior, then we should not send schema change ops!\n\t\tif (\n\t\t\tkey !== \"explicitSchemaControl\" &&\n\t\t\tpersistedSchema.runtime[key] !== providedSchema.runtime[key]\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction boolToProp(b: boolean): true | undefined {\n\treturn b ? true : undefined;\n}\n\nfunction arrayToProp(arr: string[]): string[] | undefined {\n\treturn arr.length === 0 ? undefined : arr;\n}\n\n/* eslint-disable jsdoc/check-indentation */\n\n/**\n * Controller of document schema.\n *\n * Recommended pre-reading: https://github.com/microsoft/FluidFramework/blob/main/packages/dds/SchemaVersioning.md\n *\n * This class manages current document schema and transitions between document schemas.\n * At the moment, it only focuses on subset of document schema, specifically - how FluidFramework runtime serializes data\n * (summary and op format), features & capabilities that a version of runtime has to support and understand in\n * order to collaborate on a document.\n * New features that modify document format have to be included in document schema definition.\n * Usage of such features could only happen after document schema has been updated to reflect such feature.\n *\n * This formality allows clients that do not understand such features to fail right away when they observe\n * document schema listing capabilities that such client does not understand.\n * Old clients will fail in predictable way. This allows us to\n * 1) Immediately see such issues and adjust if features are enabled too early, before changes have been saturated.\n * 2) There is no way to get to 100% saturation with new code. Even if we have 99.99% saturation, there are\n * still 0.01% of clients who will fail. Failing early and predictably ensures they have no chance to limp along\n * and potentially corrupt the document. This is especially true for summarizer client, who could simply \"undo\"\n * changes it does not understands.\n *\n * It's important to note how it overlaps with feature gates and safe velocity.\n * If new feature was in use, that resulted in a number of documents referencing such feature in document schema.\n * But, developers (through code deployment or feature gates) could disable usage of such features.\n * That will stop a process of further document schema changes (for documents that were not using such feature).\n * And documents that already list such capability in their schema will continue to do so. Later ensures that old\n * clients who do not understand such feature will continue to fail to open such documents, as such documents very\n * likely contain data in a new format.\n *\n * Controller operates with 4 schemas:\n * - document schema: whatever we loaded from summary metadata + ops. It follows eventuall consistency rules (i.e. like DDS).\n * - desired schema - what client is asking for to have (i.e. all the desired settings, based on runtime options / feature gates).\n * - session schema - current session schema. It's \"and\" of the above two schemas.\n * - future schema - \"or\" of document and desires schemas.\n *\n * \"or\" & \"and\" operators are defined individually for each property. For Boolean properties it's literally &&, || operators.\n * But for other properties it's more nuanced.\n *\n * Whenver document schema does not match future schema, controller will send an op that attempts to changs documents schema to\n * future schema.\n *\n * Users of this class need to use DocumentsSchemaController.sessionSchema to determine what features can be used.\n *\n * There are three modes this class can operate:\n * 1) Legacy mode. In such mode it does not issue any ops to change document schema. Any changes happen implicitly,\n * right away, and new features are available right away\n * 2) Non-legacy mode. In such mode any changes to schema require an op roundtrip. This class will manage such transitions.\n * However code should assume that any new features that were not enabled in a given document will not be available\n * for a given session. That's because this session may never send any ops (including read-only documents). Or it may\n * fail to convert schema.\n * This class promises eventual movement forward. I.e. if new feature is allowed (let's say - through feature gates),\n * then eventually all documents that are modified will have that feature reflected in their schema. It could require\n * multiple reloads / new sessions to get there (depends on if code reacts to schema changes right away, or only consults\n * schema on document load).\n * 3) Schema upgrade disabled mode (disableSchemaUpgrade = true). In this mode the controller will never send DocumentSchemaChange ops\n * and will throw an error if any incoming schema change ops are received. The document schema is effectively frozen at the schema\n * loaded for this session (snapshot) and will not accept further schema-change ops.\n *\n * How schemas are changed (in non-legacy mode):\n * If a client needs to change a schema, it will attempt to do so as part of normal ops sending process.\n * Changes happen in CAS (Compare-and-swap) fashion, i.e. client tells current schema and schema it wants to change to.\n * When a number of clients race to change a schema, then only one of them will win, all others will fail because they will\n * reference old schema that is no longer in effect.\n * Clients can retry, but current implementation is simply - they will not (and will rely on next session / reload to do\n * recalc and decide if schema needs to be changed or not).\n *\n * @internal\n * @sealed\n */\nexport class DocumentsSchemaController {\n\tprivate explicitSchemaControl: boolean;\n\n\t/**\n\t * Have we generated a DocumentSchemaChange op and we're waiting for the ack?\n\t * This is used to ensure that we do not generate multiple schema change ops - this client should only ever send one (if any).\n\t */\n\tprivate opPending = false;\n\n\t// schema coming from document metadata (snapshot we loaded from)\n\tprivate documentSchema: IDocumentSchema;\n\n\t// desired schema, based on feature gates / runtime options.\n\t// This includes requests to enable to disable functionality\n\tprivate readonly desiredSchema: IDocumentSchemaCurrent;\n\n\t// OR() of document schema and desired schema. It enables all the features that are enabled in either of schemas.\n\tprivate futureSchema: IDocumentSchemaCurrent | undefined;\n\n\t// Current schema this session operates with.\n\t// 1) Legacy mode (explicitSchemaControl === false): this is same as desired schema - all options that were requested to be on are on, and all options requested to be off are off.\n\t// 2) Non-legacy mode (explicitSchemaControl === true): this is AND() of document schema and desired schema. Only options that are enabled in both are enabled here.\n\t// If there are any options that are not enabled in document schema, but are enabled in desired schema, then attempt to change schema\n\t// (and enable such options) will be made through the session.\n\tpublic sessionSchema: IDocumentSchemaCurrent;\n\n\t/**\n\t * Constructs DocumentsSchemaController that controls current schema and processes around it, including changes in schema.\n\t * @param existing - Is the document existing document, or a new doc.\n\t * @param documentMetadataSchema - current document's schema, if present.\n\t * @param features - features of the document schema that current session wants to see enabled.\n\t * @param onSchemaChange - callback that is called whenever schema is changed (not called on creation / load, only when processing document schema change ops)\n\t * @param info - Informational properties of the document that are not subject to strict schema enforcement\n\t * @param logger - telemetry logger from the runtime\n\t * @param disableSchemaUpgrade - when true, the controller will never send or accept DocumentSchemaChange ops\n\t */\n\tconstructor(\n\t\texisting: boolean,\n\t\tsnapshotSequenceNumber: number,\n\t\tdocumentMetadataSchema: IDocumentSchema | undefined,\n\t\tfeatures: IDocumentSchemaFeatures,\n\t\tprivate readonly onSchemaChange: (schema: IDocumentSchemaCurrent) => void,\n\t\tinfo: IDocumentSchemaInfo,\n\t\tlogger: TelemetryLoggerExt,\n\t\tprivate readonly disableSchemaUpgrade: boolean,\n\t) {\n\t\t// For simplicity, let's only support new schema features for explicit schema control mode\n\t\tassert(\n\t\t\tfeatures.disallowedVersions.length === 0 || features.explicitSchemaControl,\n\t\t\t0x949 /* not supported */,\n\t\t);\n\n\t\t// We check the document's metadata to see if there is a minVersionForCollab. If it's not an existing document or\n\t\t// if the document is older, then it won't have one. If it does have a minVersionForCollab, we check if it's greater\n\t\t// than this client's runtime version. If so, we log a telemetry event to warn the customer that the client is outdated.\n\t\t// Note: We only send a warning because we will confirm via `checkRuntimeCompatibility` if this client **can** understand\n\t\t// the existing document's schema. We still want to issue a warning regardless if this client can or cannot understand the\n\t\t// schema since it may be a sign that the customer is not properly waiting for saturation before updating their\n\t\t// `minVersionForCollab` value, which could cause disruptions to users in the future.\n\t\tconst existingMinVersionForCollab = documentMetadataSchema?.info?.minVersionForCollab;\n\t\tif (\n\t\t\texistingMinVersionForCollab !== undefined &&\n\t\t\tgt(existingMinVersionForCollab, pkgVersion) &&\n\t\t\t// We also want to avoid sending the telemetry warning for dev builds, since they currently are formatted as\n\t\t\t// `0.0.0-#####-test`. This will cause the telemetry warning to constantly fire.\n\t\t\t// TODO: This can be removed after ADO:41351\n\t\t\t!isDevBuild(pkgVersion)\n\t\t) {\n\t\t\tconst warnMsg = `WARNING: The version of Fluid Framework used by this client (${pkgVersion}) is not supported by this document! Please upgrade to version ${existingMinVersionForCollab} or later to ensure compatibility.`;\n\t\t\tlogger.sendTelemetryEvent({\n\t\t\t\teventName: \"MinVersionForCollabWarning\",\n\t\t\t\tmessage: warnMsg,\n\t\t\t});\n\t\t}\n\n\t\t// Desired schema by this session - almost all props are coming from arguments\n\t\tthis.desiredSchema = {\n\t\t\tversion: currentDocumentVersionSchema,\n\t\t\trefSeq: documentMetadataSchema?.refSeq ?? 0,\n\t\t\tinfo,\n\t\t\truntime: {\n\t\t\t\texplicitSchemaControl: boolToProp(features.explicitSchemaControl),\n\t\t\t\tcompressionLz4: boolToProp(features.compressionLz4),\n\t\t\t\tidCompressorMode: features.idCompressorMode,\n\t\t\t\topGroupingEnabled: boolToProp(features.opGroupingEnabled),\n\t\t\t\tcreateBlobPayloadPending: features.createBlobPayloadPending,\n\t\t\t\tdisallowedVersions: arrayToProp(features.disallowedVersions),\n\t\t\t\t...retiredFeatureValues(),\n\t\t\t},\n\t\t};\n\n\t\t// Schema coming from document metadata (snapshot we loaded from), or if no document exists\n\t\t// (this is a new document) then this is the same as desiredSchema (same as session schema in such case).\n\t\t// Latter is important sure that's what will go into summary.\n\t\tthis.documentSchema = existing\n\t\t\t? (documentMetadataSchema ??\n\t\t\t\t({\n\t\t\t\t\tversion: currentDocumentVersionSchema,\n\t\t\t\t\t// see comment in summarizeDocumentSchema() on why it has to stay zero\n\t\t\t\t\trefSeq: 0,\n\t\t\t\t\tinfo,\n\t\t\t\t\t// If it's existing document and it has no schema, then it was written by legacy client.\n\t\t\t\t\t// If it's a new document, then we define it's legacy-related behaviors.\n\t\t\t\t\truntime: {\n\t\t\t\t\t\texplicitSchemaControl: boolToProp(!existing && features.explicitSchemaControl),\n\t\t\t\t\t},\n\t\t\t\t} satisfies IDocumentSchemaCurrent))\n\t\t\t: this.desiredSchema;\n\n\t\tcheckRuntimeCompatibility(this.documentSchema, \"document\");\n\t\tthis.validateSeqNumber(this.documentSchema.refSeq, snapshotSequenceNumber, \"summary\");\n\n\t\t// Use legacy behavior only if both document and options tell us to use legacy.\n\t\t// Otherwise it's no longer legacy time!\n\t\tthis.explicitSchemaControl =\n\t\t\tthis.documentSchema.runtime.explicitSchemaControl === true ||\n\t\t\tfeatures.explicitSchemaControl;\n\n\t\t// Calculate\n\t\t// - current session schema (overlap of document schema and desired schema)\n\t\t// - future schema to propose (concatination of document schema and desired schema)\n\t\tif (!this.explicitSchemaControl || !existing) {\n\t\t\tthis.sessionSchema = this.desiredSchema;\n\t\t\tassert(\n\t\t\t\tboolToProp(this.explicitSchemaControl) ===\n\t\t\t\t\tthis.sessionSchema.runtime.explicitSchemaControl,\n\t\t\t\t0x94a /* explicitSchemaControl */,\n\t\t\t);\n\t\t\tthis.futureSchema = undefined;\n\t\t} else {\n\t\t\tthis.sessionSchema = and(this.documentSchema, this.desiredSchema);\n\t\t\tthis.futureSchema = or(this.documentSchema, this.desiredSchema);\n\t\t\tassert(this.sessionSchema.runtime.explicitSchemaControl === true, 0x94b /* legacy */);\n\t\t\tassert(this.futureSchema.runtime.explicitSchemaControl === true, 0x94c /* legacy */);\n\t\t\tif (same(this.documentSchema, this.futureSchema)) {\n\t\t\t\tthis.futureSchema = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Validate that schema we are operating in is actually a schema we consider compatible with current runtime.\n\t\tcheckRuntimeCompatibility(this.desiredSchema, \"desired\");\n\t\tcheckRuntimeCompatibility(this.sessionSchema, \"session\");\n\t\tcheckRuntimeCompatibility(this.futureSchema, \"future\");\n\t}\n\n\tpublic summarizeDocumentSchema(\n\t\trefSeq: number,\n\t): IDocumentSchema | IDocumentSchemaCurrent | undefined {\n\t\t// For legacy behavior, we could write nothing (return undefined).\n\t\t// It does not buy us anything, as whatever written in summary does not actually impact clients operating in legacy mode.\n\t\t// But writing current used config (and assuming most of the clients settle on same config over time) will help with transition\n\t\t// out of legacy mode, as clients transitioning out of it would be able to use all the\n\t\t// features that are mentioned in schema right away, without a need to go through schema transition (and thus for a session or\n\t\t// two losing ability to use all the features)\n\t\tconst schema = this.explicitSchemaControl ? this.documentSchema : this.desiredSchema;\n\n\t\t// It's important to keep refSeq at zero in legacy mode, such that transition out of it is simple and we do not have\n\t\t// race conditions. If we put any other number (including latest seq number), then we will have two clients\n\t\t// (loading from two different summaries) with different numbers, and eventual consistency will be broken as schema\n\t\t// change ops will be interpretted differently by those two clients.\n\t\tassert(\n\t\t\tthis.explicitSchemaControl || schema.refSeq === 0,\n\t\t\t0x94d /* refSeq should be zero */,\n\t\t);\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Called by Container runtime whenever it is about to send some op.\n\t * It gives opportunity for controller to issue its own ops - we do not want to send ops if there are no local changes in document.\n\t * Please consider note above constructor about race conditions - current design is to generate op only once in a session lifetime.\n\t * @returns Optional message to send. Always returns undefined when disableSchemaUpgrade is true.\n\t */\n\tpublic maybeGenerateSchemaMessage(): IDocumentSchemaChangeMessageOutgoing | undefined {\n\t\tif (this.disableSchemaUpgrade) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (this.futureSchema !== undefined && !this.opPending) {\n\t\t\tthis.opPending = true;\n\t\t\tassert(\n\t\t\t\tthis.explicitSchemaControl && this.futureSchema.runtime.explicitSchemaControl === true,\n\t\t\t\t0x94e /* not legacy */,\n\t\t\t);\n\t\t\treturn this.futureSchema;\n\t\t}\n\t}\n\n\tprivate validateSeqNumber(\n\t\tschemaSeqNumber: number,\n\t\tlastKnowSeqNumber: number,\n\t\tmessage: string,\n\t): void {\n\t\tif (!Number.isInteger(schemaSeqNumber) || !(schemaSeqNumber <= lastKnowSeqNumber)) {\n\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\"DocSchema: Incorrect sequence number\",\n\t\t\t\t\"checkRuntimeCompat3\",\n\t\t\t\tundefined, // message\n\t\t\t\t{\n\t\t\t\t\tschemaSeqNumber,\n\t\t\t\t\tsequenceNumber: lastKnowSeqNumber,\n\t\t\t\t\tmessage,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Process document schema change messages\n\t * Called by ContainerRuntime whenever it sees document schema messages.\n\t * When disableSchemaUpgrade is true, an error is thrown if any incoming schema change ops are received.\n\t * @param contents - contents of the messages\n\t * @param local - whether op is local\n\t * @param sequenceNumber - sequence number of the op\n\t * @returns true if schema was accepted, otherwise false (rejected due to failed CAS)\n\t */\n\tpublic processDocumentSchemaMessages(\n\t\tcontents: IDocumentSchemaChangeMessageIncoming[],\n\t\tlocal: boolean,\n\t\tsequenceNumber: number,\n\t): boolean {\n\t\tif (this.disableSchemaUpgrade) {\n\t\t\tassert(\n\t\t\t\t!local,\n\t\t\t\t0xceb /* local schema change messages should never be generated when disableSchemaUpgrade is enabled */,\n\t\t\t);\n\t\t\t// Clients with disableSchemaUpgrade enabled should never generate schema change messages, but they\n\t\t\t// may receive them from misconfigured clients. In such case, throw on any incoming schema change ops\n\t\t\t// to prevent unexpected schema upgrades.\n\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\"DocSchema: Received schema change op while disableSchemaUpgrade is enabled\",\n\t\t\t\t\"processDocumentSchemaMessages\",\n\t\t\t\tundefined,\n\t\t\t);\n\t\t}\n\t\tfor (const content of contents) {\n\t\t\tthis.validateSeqNumber(content.refSeq, this.documentSchema.refSeq, \"content.refSeq\");\n\t\t\tthis.validateSeqNumber(this.documentSchema.refSeq, sequenceNumber, \"refSeq\");\n\t\t\t// validate is strickly less, not equal\n\t\t\tassert(\n\t\t\t\tthis.documentSchema.refSeq < sequenceNumber,\n\t\t\t\t0x950 /* time should move forward only! */,\n\t\t\t);\n\n\t\t\tif (content.refSeq !== this.documentSchema.refSeq) {\n\t\t\t\t// CAS failed\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// This assert should be after checking for successful CAS above.\n\t\t\t// This will ensure we do not trip on our own messages that are no longer wanted as we processed someone else schema change message.\n\t\t\tassert(\n\t\t\t\t!local || (this.explicitSchemaControl && this.futureSchema !== undefined),\n\t\t\t\t0x951 /* not sending ops */,\n\t\t\t);\n\n\t\t\t// Changes are in effect. Immediately check that this client understands these changes\n\t\t\tcheckRuntimeCompatibility(content, \"change\");\n\t\t\tconst schema = {\n\t\t\t\t...content,\n\t\t\t\trefSeq: sequenceNumber,\n\t\t\t} satisfies IDocumentSchemaCurrentIncoming;\n\t\t\tthis.documentSchema = schema;\n\t\t\tthis.sessionSchema = and(schema, this.desiredSchema);\n\t\t\tassert(this.sessionSchema.refSeq === sequenceNumber, 0x97d /* seq# */);\n\n\t\t\t// legacy behavior is automatically off for the document once someone sends a schema op -\n\t\t\t// from now on it's fully controlled by ops.\n\t\t\t// This is very important, as summarizeDocumentSchema() should use this new schema!\n\t\t\tthis.explicitSchemaControl = true;\n\n\t\t\t// Stop attempting changing schema.\n\t\t\t// If it was local op, then we succeeded and do not need to try again.\n\t\t\t// If it was remote op, then some changes happened to schema.\n\t\t\t// We would need to recalculate this.futureSchema by merging changes that we just received.\n\t\t\t// Avoid this complexity for now - a new client session (loading from new summary with these changes)\n\t\t\t// will automatically do this recalculation and will figure out\n\t\t\tthis.futureSchema = undefined;\n\n\t\t\tthis.onSchemaChange(this.sessionSchema);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Indicates the pending op was not ack'd and we may try to send it again if needed.\n\t */\n\tpublic pendingOpNotAcked(): void {\n\t\tthis.opPending = false;\n\t}\n}\n\n/**\n * Determines if a given version is a dev-build (i.e. `0.0.0-#####-test`).\n */\nfunction isDevBuild(version: string): boolean {\n\tconst parsed = parse(version);\n\treturn parsed?.prerelease.includes(\"test\") ?? false;\n}\n\n/* eslint-enable jsdoc/check-indentation */\n"]}
|
|
@@ -17,7 +17,7 @@ export interface IHistoricalOpReader {
|
|
|
17
17
|
/**
|
|
18
18
|
* Result of resolving a pending batchId.
|
|
19
19
|
*
|
|
20
|
-
* @legacy @
|
|
20
|
+
* @legacy @beta
|
|
21
21
|
*/
|
|
22
22
|
export type ResolveResult = {
|
|
23
23
|
readonly kind: "resolved";
|
|
@@ -33,7 +33,7 @@ export type ResolveResult = {
|
|
|
33
33
|
* work, so the mark already points at a durable sequence number. The app packs its own stored record from
|
|
34
34
|
* this — the runtime does not define the stored locator shape.
|
|
35
35
|
*
|
|
36
|
-
* @legacy @
|
|
36
|
+
* @legacy @beta
|
|
37
37
|
*/
|
|
38
38
|
export type VersionMarkCapture = {
|
|
39
39
|
readonly kind: "pending";
|
|
@@ -46,7 +46,7 @@ export type VersionMarkCapture = {
|
|
|
46
46
|
/**
|
|
47
47
|
* Runtime-owned resolver for app-stored version mark locators.
|
|
48
48
|
*
|
|
49
|
-
* @legacy @
|
|
49
|
+
* @legacy @beta
|
|
50
50
|
*/
|
|
51
51
|
export interface IVersionMarkResolver {
|
|
52
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionMarkResolver.js","sourceRoot":"","sources":["../../src/versionMarks/versionMarkResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,kEAA6D;AAI7D,gDAAiD;AAEjD,uDAA6D;AAiH7D;;;;;GAKG;AACH,MAAa,mBAAmB;IAY/B,YAAoC,KAAsC;QAAtC,UAAK,GAAL,KAAK,CAAiC;QAXzD,4BAAuB,GAAG,IAAI,GAAG,EAAkB,CAAC;QACpD,mBAAc,GAAG,IAAI,GAAG,EAEtC,CAAC;QACJ;;;;WAIG;QACK,aAAQ,GAAG,KAAK,CAAC;IAEoD,CAAC;IAE9E,8GAA8G;IAC9G,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAEM,yBAAyB;QAC/B,iGAAiG;QACjG,sEAAsE;QACtE,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC/B,MAAM,wBAAwB,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,EAAE,CAAC;QACvE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,EAAE,CAAC;QACtD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;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Ae;QACzC,OAAO,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,wGAAwG;IACjG,mBAAmB,CAAC,OAAe,EAAE,cAAsB;QACjE,MAAM,sBAAsB,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,sBAAsB,KAAK,cAAc,EAAE,CAAC;YAC/C,OAAO;QACR,CAAC;QAED,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC1D,IAAI,CAAC,+BAA+B,EAAE,CAAC;QACvC,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,IAAI,CAAC;gBACJ,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YACnC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,4FAA4F;gBAC5F,0FAA0F;gBAC1F,8EAA8E;gBAC9E,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,8BAA8B,EAAE,EAAE,KAAK,CAAC,CAAC;YACxF,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACK,+BAA+B;QACtC,MAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC,+BAA+B,EAAE,CAAC;QAC3E,KAAK,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjE,IAAI,cAAc,IAAI,qBAAqB,EAAE,CAAC;gBAC7C,MAAM;YACP,CAAC;YACD,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;CACD;AA7MD,kDA6MC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tISequencedDocumentMessage,\n\tIStream,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { TelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { InboundMessageResult } from \"../opLifecycle/index.js\";\nimport { asBatchMetadata } from \"../metadata.js\";\n\nimport { inboundVersionMarkUpdate } from \"./inboundBatch.js\";\n\n/**\n * Reads sequenced ops in `[from, to)` from delta storage, injected by the container so the runtime stays\n * driver-agnostic. `abortSignal` cancels an in-flight fetch.\n *\n * @internal\n */\nexport interface IHistoricalOpReader {\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto?: number,\n\t\tabortSignal?: AbortSignal,\n\t): Promise<IStream<ISequencedDocumentMessage[]>>;\n}\n\n/**\n * Result of resolving a pending batchId.\n *\n * @legacy @alpha\n */\nexport type ResolveResult =\n\t| { readonly kind: \"resolved\"; readonly sequenceNumber: number }\n\t| { readonly kind: \"pending\" }\n\t| { readonly kind: \"unresolvable\" };\n\n/**\n * The data captured for a version mark. `pending` when the captured edit is local and not yet sequenced\n * (resolve it later via {@link IVersionMarkResolver.resolve}); `resolved` when there is no in-flight local\n * work, so the mark already points at a durable sequence number. The app packs its own stored record from\n * this — the runtime does not define the stored locator shape.\n *\n * @legacy @alpha\n */\nexport type VersionMarkCapture =\n\t| {\n\t\t\treadonly kind: \"pending\";\n\t\t\treadonly batchId: string;\n\t\t\treadonly sequenceNumberLowerBound: number;\n\t }\n\t| { readonly kind: \"resolved\"; readonly sequenceNumber: number };\n\n/**\n * Runtime-owned resolver for app-stored version mark locators.\n *\n * @legacy @alpha\n */\nexport interface IVersionMarkResolver {\n\t/**\n\t * Captures a version mark at the current point. Seals the current outbound batch first (so a just-made\n\t * local edit has a stable `batchId`, which is only assigned when a batch is flushed), then returns the\n\t * mark data atomically: a `pending` capture (`batchId` + `sequenceNumberLowerBound`) when there is an\n\t * unacked local batch, or a `resolved` capture (`sequenceNumber`) when there is no in-flight local work.\n\t *\n\t * @remarks Sealing the batch is a side effect (it submits the current batch), so capture at savepoint\n\t * boundaries, not per keystroke.\n\t *\n\t * @returns The pending batch identity and exclusive sequence number lower bound, or the current sequence number\n\t * when there is no pending local batch.\n\t */\n\tsealAndCaptureVersionMark(): VersionMarkCapture;\n\t/**\n\t * Resolves a pending mark's batchId to a global sequence number (`sequenceNumberLowerBound` is the\n\t * exclusive lower bound for a history read). A `resolved` sequence number feeds the loader's\n\t * `loadContainerToSequenceNumber`.\n\t *\n\t * @param batchId - The stable identity of the pending batch.\n\t * @param sequenceNumberLowerBound - The exclusive lower bound for the historical op search.\n\t * @returns The resolved sequence number, or a result indicating that the batch remains pending or can\n\t * no longer be resolved.\n\t */\n\tresolve(batchId: string, sequenceNumberLowerBound: number): Promise<ResolveResult>;\n\t/**\n\t * Subscribes to inbound batch sequencing: fires `(batchId, sequenceNumber)` per batch so any connected\n\t * client can promote a matching pending mark. Returns an unsubscribe function.\n\t *\n\t * @param listener - Called with the stable batch identity and its final sequence number.\n\t * @returns A function that unsubscribes the listener.\n\t */\n\tonBatchSequenced(listener: (batchId: string, sequenceNumber: number) => void): () => void;\n}\n\n/**\n * @internal\n */\nexport interface VersionMarkResolverRuntimeHooks {\n\treadonly getCurrentSequenceNumber: () => number;\n\treadonly getCurrentMinimumSequenceNumber: () => number;\n\treadonly getCurrentPendingBatchId: () => string | undefined;\n\t/** Logs faults from app-supplied `onBatchSequenced` listeners (see {@link VersionMarkResolver.processInboundBatch}). */\n\treadonly logger: TelemetryLoggerExt;\n\t/**\n\t * Seals the current outbound batch (flushes the runtime), so a just-submitted local edit is moved into\n\t * the pending state with a stable `batchId` before\n\t * {@link IVersionMarkResolver.sealAndCaptureVersionMark} reads it.\n\t */\n\treadonly flushPendingBatch: () => void;\n\t/**\n\t * Injected by the container, backed by delta storage. When absent, unknown batchIds resolve as `pending`.\n\t */\n\treadonly getHistoricalOpReader?: () => IHistoricalOpReader | undefined;\n\t/**\n\t * Creates a per-scan op unpacker that mirrors the live inbound path (chunk reassembly, ungroup,\n\t * decompress), so the history scan observes the same restored `batchId` — in particular for chunked\n\t * batches, whose id is stripped from the final chunk's wire metadata and restored only after\n\t * reassembly. A fresh unpacker is created per scan since it holds reassembly state. When absent, the\n\t * history scan cannot identify batches and reports `pending`/`unresolvable`.\n\t */\n\treadonly createHistoricalOpUnpacker?: () => (\n\t\top: ISequencedDocumentMessage,\n\t) => InboundMessageResult | undefined;\n}\n\n/**\n * Resolves a mark's batchId to a global sequence number. The app owns mark storage and promotion; the\n * runtime exposes the capture point and an ephemeral in-session `batchId -> sequenceNumber` map.\n *\n * @internal\n */\nexport class VersionMarkResolver implements IVersionMarkResolver {\n\tprivate readonly sequenceNumberByBatchId = new Map<string, number>();\n\tprivate readonly batchListeners = new Set<\n\t\t(batchId: string, sequenceNumber: number) => void\n\t>();\n\t/**\n\t * Sticky flag: false until the feature is first used this session (a pending capture or a listener).\n\t * While false the runtime skips all per-inbound-batch tracking, so a container that never uses version\n\t * marks pays nothing on the hot path (mirrors #22497 gating `DuplicateBatchDetector` on offline load).\n\t */\n\tprivate tracking = false;\n\n\tpublic constructor(private readonly hooks: VersionMarkResolverRuntimeHooks) {}\n\n\t/** Whether inbound batches need tracking (see {@link tracking}). Read by the runtime to gate the hot path. */\n\tpublic get isTracking(): boolean {\n\t\treturn this.tracking;\n\t}\n\n\tpublic sealAndCaptureVersionMark(): VersionMarkCapture {\n\t\t// Seal the current batch so a just-submitted local edit is flushed into the pending state with a\n\t\t// stable batchId (which is only assigned at flush) before we read it.\n\t\tthis.hooks.flushPendingBatch();\n\t\tconst sequenceNumberLowerBound = this.hooks.getCurrentSequenceNumber();\n\t\tconst batchId = this.hooks.getCurrentPendingBatchId();\n\t\tif (batchId === undefined) {\n\t\t\t// No unacked local batch: the mark already points at a durable sequence number.\n\t\t\treturn { kind: \"resolved\", sequenceNumber: sequenceNumberLowerBound };\n\t\t}\n\t\t// A pending mark needs its batch tracked so resolve() can promote it from the live map.\n\t\tthis.tracking = true;\n\t\treturn { kind: \"pending\", batchId, sequenceNumberLowerBound };\n\t}\n\n\tpublic async resolve(\n\t\tbatchId: string,\n\t\tsequenceNumberLowerBound: number,\n\t): Promise<ResolveResult> {\n\t\t// Fast path: batch sequenced live this session.\n\t\tconst sequenceNumber = this.sessionSequenceFor(batchId);\n\t\tif (sequenceNumber !== undefined) {\n\t\t\treturn { kind: \"resolved\", sequenceNumber };\n\t\t}\n\n\t\t// Otherwise scan history from the mark's reference point.\n\t\tconst reader = this.hooks.getHistoricalOpReader?.();\n\t\tif (reader === undefined) {\n\t\t\t// No reader: the batch may still sequence live, so report pending.\n\t\t\treturn { kind: \"pending\" };\n\t\t}\n\t\treturn this.resolveFromHistory(reader, batchId, sequenceNumberLowerBound);\n\t}\n\n\t/**\n\t * Scans sequenced ops after `sequenceNumberLowerBound` for `batchId`, returning its last op's\n\t * sequence number when found and aborting the fetch once found or exhausted. Each op is routed through\n\t * the same unpack pipeline the live inbound path uses (chunk reassembly, ungroup, decompress) and\n\t * {@link inboundVersionMarkUpdate} derives its batch identity, so chunked batches resolve here too. The\n\t * scan anchor is not guaranteed to be a batch boundary, so a leading batch clipped by the anchor is\n\t * tolerated (its orphan end marker is dropped rather than fed to the processor). On a miss,\n\t * {@link classifyMiss} distinguishes `pending` (not sequenced yet) from `unresolvable` (ops trimmed).\n\t * See DEV.md.\n\t */\n\tprivate async resolveFromHistory(\n\t\treader: IHistoricalOpReader,\n\t\tbatchId: string,\n\t\tsequenceNumberLowerBound: number,\n\t): Promise<ResolveResult> {\n\t\tconst from = sequenceNumberLowerBound + 1;\n\t\tconst unpack = this.hooks.createHistoricalOpUnpacker?.();\n\t\tconst abortController = new AbortController();\n\t\ttry {\n\t\t\tconst stream = await reader.fetchMessages(from, undefined, abortController.signal);\n\t\t\tlet firstScannedSequenceNumber: number | undefined;\n\t\t\tlet carriedBatchId: string | undefined;\n\t\t\t// Mirrors the processor's batch-in-progress state so we can drop an orphan end marker (below).\n\t\t\tlet inBatch = false;\n\t\t\twhile (true) {\n\t\t\t\tconst result = await stream.read();\n\t\t\t\tif (result.done) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor (const op of result.value) {\n\t\t\t\t\tfirstScannedSequenceNumber ??= op.sequenceNumber;\n\t\t\t\t\tif (!inBatch && asBatchMetadata(op.metadata)?.batch === false) {\n\t\t\t\t\t\t// The anchor (`sequenceNumberLowerBound + 1`) may land inside a batch whose start\n\t\t\t\t\t\t// precedes the window; its orphan end marker would trip the processor's 0x9d5 assert.\n\t\t\t\t\t\t// Drop the clipped tail. The target batch is fully in-window, so this can't skip it.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// undefined = a system op, or an incomplete chunk awaiting later fragments.\n\t\t\t\t\tconst inboundResult = unpack?.(op);\n\t\t\t\t\tif (inboundResult === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Track batch progress with the processor so the guard above skips only orphan ends.\n\t\t\t\t\tif (inboundResult.type === \"batchStartingMessage\") {\n\t\t\t\t\t\tinBatch = true;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tinboundResult.type === \"nextBatchMessage\" &&\n\t\t\t\t\t\tinboundResult.batchEnd === true\n\t\t\t\t\t) {\n\t\t\t\t\t\tinBatch = false;\n\t\t\t\t\t}\n\t\t\t\t\t// Derive batch identity exactly as the live inbound path does, carrying the id across a\n\t\t\t\t\t// piecemeal batch's messages.\n\t\t\t\t\tconst update = inboundVersionMarkUpdate(inboundResult, carriedBatchId);\n\t\t\t\t\tcarriedBatchId = update.carriedBatchId;\n\t\t\t\t\tif (update.sequenced?.batchId === batchId) {\n\t\t\t\t\t\treturn { kind: \"resolved\", sequenceNumber: update.sequenced.sequenceNumber };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Not found: distinguish \"not sequenced yet\" from \"trimmed\" via the tip and where the scan landed.\n\t\t\treturn this.classifyMiss(from, firstScannedSequenceNumber);\n\t\t} finally {\n\t\t\t// Cancel any in-flight fetch once we stop reading (found or exhausted).\n\t\t\tabortController.abort();\n\t\t}\n\t}\n\n\t/**\n\t * Classifies a history-scan miss as `pending` or `unresolvable`. See {@link resolveFromHistory}.\n\t */\n\tprivate classifyMiss(\n\t\tfrom: number,\n\t\tfirstScannedSequenceNumber: number | undefined,\n\t): ResolveResult {\n\t\t// Invariant: a reader must never return an op before the requested range start. If it does, the\n\t\t// trim inference below is meaningless, so fail loudly rather than misclassify.\n\t\tassert(\n\t\t\tfirstScannedSequenceNumber === undefined || firstScannedSequenceNumber >= from,\n\t\t\t0xd1c /* historical op reader returned an op before the requested range start */,\n\t\t);\n\t\tconst tip = this.hooks.getCurrentSequenceNumber();\n\t\tif (from > tip) {\n\t\t\t// Nothing is sequenced at/after the mark's reference point yet, so the batch cannot have landed.\n\t\t\treturn { kind: \"pending\" };\n\t\t}\n\t\tif (firstScannedSequenceNumber === undefined) {\n\t\t\t// Empty read though ops should exist in `[from, tip]` → trimmed. ODSP-specific: a strict driver\n\t\t\t// empties a `from`-misaligned trimmed range (validateMessages); a return-from-earliest driver\n\t\t\t// would instead surface the trim via the `firstScannedSequenceNumber > from` branch below.\n\t\t\treturn { kind: \"unresolvable\" };\n\t\t}\n\t\tif (firstScannedSequenceNumber > from) {\n\t\t\t// A trim gap at the anchor: the mark's ops (just after the reference point) are gone.\n\t\t\treturn { kind: \"unresolvable\" };\n\t\t}\n\t\t// Ops are present from the reference point and the batch is not among them: not yet sequenced.\n\t\treturn { kind: \"pending\" };\n\t}\n\n\tpublic onBatchSequenced(\n\t\tlistener: (batchId: string, sequenceNumber: number) => void,\n\t): () => void {\n\t\t// A subscriber wants live promotions, so start tracking inbound batches from here on.\n\t\tthis.tracking = true;\n\t\tthis.batchListeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.batchListeners.delete(listener);\n\t\t};\n\t}\n\n\t/** The sequence number for a batch seen live this session, or undefined. */\n\tprivate sessionSequenceFor(batchId: string): number | undefined {\n\t\treturn this.sequenceNumberByBatchId.get(batchId);\n\t}\n\n\t/** Records an inbound batch and notifies listeners so any client can promote matching pending marks. */\n\tpublic processInboundBatch(batchId: string, sequenceNumber: number): void {\n\t\tconst existingSequenceNumber = this.sequenceNumberByBatchId.get(batchId);\n\t\tif (existingSequenceNumber === sequenceNumber) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.sequenceNumberByBatchId.set(batchId, sequenceNumber);\n\t\tthis.evictBelowMinimumSequenceNumber();\n\t\tfor (const listener of this.batchListeners) {\n\t\t\ttry {\n\t\t\t\tlistener(batchId, sequenceNumber);\n\t\t\t} catch (error) {\n\t\t\t\t// Isolate each app listener (like the container's EventEmitterWithErrorHandling): one throw\n\t\t\t\t// must not abort op processing or starve the rest. Log and continue rather than fault the\n\t\t\t\t// container — a missed promotion is recoverable via resolve()'s history scan.\n\t\t\t\tthis.hooks.logger.sendErrorEvent({ eventName: \"VersionMarkListenerException\" }, error);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Bounds the map to the collaboration window by dropping entries below the MSN (mirrors\n\t * `DuplicateBatchDetector`). Safe because below the MSN every client has processed the batch, so its\n\t * `onBatchSequenced` already fired; a dropped entry falls back to the history scan. Entries insert in\n\t * sequence order, so iteration stops at the first retained one.\n\t */\n\tprivate evictBelowMinimumSequenceNumber(): void {\n\t\tconst minimumSequenceNumber = this.hooks.getCurrentMinimumSequenceNumber();\n\t\tfor (const [id, sequenceNumber] of this.sequenceNumberByBatchId) {\n\t\t\tif (sequenceNumber >= minimumSequenceNumber) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.sequenceNumberByBatchId.delete(id);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"versionMarkResolver.js","sourceRoot":"","sources":["../../src/versionMarks/versionMarkResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,kEAA6D;AAI7D,gDAAiD;AAEjD,uDAA6D;AAiH7D;;;;;GAKG;AACH,MAAa,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MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,8BAA8B,EAAE,EAAE,KAAK,CAAC,CAAC;YACxF,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACK,+BAA+B;QACtC,MAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC,+BAA+B,EAAE,CAAC;QAC3E,KAAK,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjE,IAAI,cAAc,IAAI,qBAAqB,EAAE,CAAC;gBAC7C,MAAM;YACP,CAAC;YACD,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;CACD;AA7MD,kDA6MC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tISequencedDocumentMessage,\n\tIStream,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { TelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { InboundMessageResult } from \"../opLifecycle/index.js\";\nimport { asBatchMetadata } from \"../metadata.js\";\n\nimport { inboundVersionMarkUpdate } from \"./inboundBatch.js\";\n\n/**\n * Reads sequenced ops in `[from, to)` from delta storage, injected by the container so the runtime stays\n * driver-agnostic. `abortSignal` cancels an in-flight fetch.\n *\n * @internal\n */\nexport interface IHistoricalOpReader {\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto?: number,\n\t\tabortSignal?: AbortSignal,\n\t): Promise<IStream<ISequencedDocumentMessage[]>>;\n}\n\n/**\n * Result of resolving a pending batchId.\n *\n * @legacy @beta\n */\nexport type ResolveResult =\n\t| { readonly kind: \"resolved\"; readonly sequenceNumber: number }\n\t| { readonly kind: \"pending\" }\n\t| { readonly kind: \"unresolvable\" };\n\n/**\n * The data captured for a version mark. `pending` when the captured edit is local and not yet sequenced\n * (resolve it later via {@link IVersionMarkResolver.resolve}); `resolved` when there is no in-flight local\n * work, so the mark already points at a durable sequence number. The app packs its own stored record from\n * this — the runtime does not define the stored locator shape.\n *\n * @legacy @beta\n */\nexport type VersionMarkCapture =\n\t| {\n\t\t\treadonly kind: \"pending\";\n\t\t\treadonly batchId: string;\n\t\t\treadonly sequenceNumberLowerBound: number;\n\t }\n\t| { readonly kind: \"resolved\"; readonly sequenceNumber: number };\n\n/**\n * Runtime-owned resolver for app-stored version mark locators.\n *\n * @legacy @beta\n */\nexport interface IVersionMarkResolver {\n\t/**\n\t * Captures a version mark at the current point. Seals the current outbound batch first (so a just-made\n\t * local edit has a stable `batchId`, which is only assigned when a batch is flushed), then returns the\n\t * mark data atomically: a `pending` capture (`batchId` + `sequenceNumberLowerBound`) when there is an\n\t * unacked local batch, or a `resolved` capture (`sequenceNumber`) when there is no in-flight local work.\n\t *\n\t * @remarks Sealing the batch is a side effect (it submits the current batch), so capture at savepoint\n\t * boundaries, not per keystroke.\n\t *\n\t * @returns The pending batch identity and exclusive sequence number lower bound, or the current sequence number\n\t * when there is no pending local batch.\n\t */\n\tsealAndCaptureVersionMark(): VersionMarkCapture;\n\t/**\n\t * Resolves a pending mark's batchId to a global sequence number (`sequenceNumberLowerBound` is the\n\t * exclusive lower bound for a history read). A `resolved` sequence number feeds the loader's\n\t * `loadContainerToSequenceNumber`.\n\t *\n\t * @param batchId - The stable identity of the pending batch.\n\t * @param sequenceNumberLowerBound - The exclusive lower bound for the historical op search.\n\t * @returns The resolved sequence number, or a result indicating that the batch remains pending or can\n\t * no longer be resolved.\n\t */\n\tresolve(batchId: string, sequenceNumberLowerBound: number): Promise<ResolveResult>;\n\t/**\n\t * Subscribes to inbound batch sequencing: fires `(batchId, sequenceNumber)` per batch so any connected\n\t * client can promote a matching pending mark. Returns an unsubscribe function.\n\t *\n\t * @param listener - Called with the stable batch identity and its final sequence number.\n\t * @returns A function that unsubscribes the listener.\n\t */\n\tonBatchSequenced(listener: (batchId: string, sequenceNumber: number) => void): () => void;\n}\n\n/**\n * @internal\n */\nexport interface VersionMarkResolverRuntimeHooks {\n\treadonly getCurrentSequenceNumber: () => number;\n\treadonly getCurrentMinimumSequenceNumber: () => number;\n\treadonly getCurrentPendingBatchId: () => string | undefined;\n\t/** Logs faults from app-supplied `onBatchSequenced` listeners (see {@link VersionMarkResolver.processInboundBatch}). */\n\treadonly logger: TelemetryLoggerExt;\n\t/**\n\t * Seals the current outbound batch (flushes the runtime), so a just-submitted local edit is moved into\n\t * the pending state with a stable `batchId` before\n\t * {@link IVersionMarkResolver.sealAndCaptureVersionMark} reads it.\n\t */\n\treadonly flushPendingBatch: () => void;\n\t/**\n\t * Injected by the container, backed by delta storage. When absent, unknown batchIds resolve as `pending`.\n\t */\n\treadonly getHistoricalOpReader?: () => IHistoricalOpReader | undefined;\n\t/**\n\t * Creates a per-scan op unpacker that mirrors the live inbound path (chunk reassembly, ungroup,\n\t * decompress), so the history scan observes the same restored `batchId` — in particular for chunked\n\t * batches, whose id is stripped from the final chunk's wire metadata and restored only after\n\t * reassembly. A fresh unpacker is created per scan since it holds reassembly state. When absent, the\n\t * history scan cannot identify batches and reports `pending`/`unresolvable`.\n\t */\n\treadonly createHistoricalOpUnpacker?: () => (\n\t\top: ISequencedDocumentMessage,\n\t) => InboundMessageResult | undefined;\n}\n\n/**\n * Resolves a mark's batchId to a global sequence number. The app owns mark storage and promotion; the\n * runtime exposes the capture point and an ephemeral in-session `batchId -> sequenceNumber` map.\n *\n * @internal\n */\nexport class VersionMarkResolver implements IVersionMarkResolver {\n\tprivate readonly sequenceNumberByBatchId = new Map<string, number>();\n\tprivate readonly batchListeners = new Set<\n\t\t(batchId: string, sequenceNumber: number) => void\n\t>();\n\t/**\n\t * Sticky flag: false until the feature is first used this session (a pending capture or a listener).\n\t * While false the runtime skips all per-inbound-batch tracking, so a container that never uses version\n\t * marks pays nothing on the hot path (mirrors #22497 gating `DuplicateBatchDetector` on offline load).\n\t */\n\tprivate tracking = false;\n\n\tpublic constructor(private readonly hooks: VersionMarkResolverRuntimeHooks) {}\n\n\t/** Whether inbound batches need tracking (see {@link tracking}). Read by the runtime to gate the hot path. */\n\tpublic get isTracking(): boolean {\n\t\treturn this.tracking;\n\t}\n\n\tpublic sealAndCaptureVersionMark(): VersionMarkCapture {\n\t\t// Seal the current batch so a just-submitted local edit is flushed into the pending state with a\n\t\t// stable batchId (which is only assigned at flush) before we read it.\n\t\tthis.hooks.flushPendingBatch();\n\t\tconst sequenceNumberLowerBound = this.hooks.getCurrentSequenceNumber();\n\t\tconst batchId = this.hooks.getCurrentPendingBatchId();\n\t\tif (batchId === undefined) {\n\t\t\t// No unacked local batch: the mark already points at a durable sequence number.\n\t\t\treturn { kind: \"resolved\", sequenceNumber: sequenceNumberLowerBound };\n\t\t}\n\t\t// A pending mark needs its batch tracked so resolve() can promote it from the live map.\n\t\tthis.tracking = true;\n\t\treturn { kind: \"pending\", batchId, sequenceNumberLowerBound };\n\t}\n\n\tpublic async resolve(\n\t\tbatchId: string,\n\t\tsequenceNumberLowerBound: number,\n\t): Promise<ResolveResult> {\n\t\t// Fast path: batch sequenced live this session.\n\t\tconst sequenceNumber = this.sessionSequenceFor(batchId);\n\t\tif (sequenceNumber !== undefined) {\n\t\t\treturn { kind: \"resolved\", sequenceNumber };\n\t\t}\n\n\t\t// Otherwise scan history from the mark's reference point.\n\t\tconst reader = this.hooks.getHistoricalOpReader?.();\n\t\tif (reader === undefined) {\n\t\t\t// No reader: the batch may still sequence live, so report pending.\n\t\t\treturn { kind: \"pending\" };\n\t\t}\n\t\treturn this.resolveFromHistory(reader, batchId, sequenceNumberLowerBound);\n\t}\n\n\t/**\n\t * Scans sequenced ops after `sequenceNumberLowerBound` for `batchId`, returning its last op's\n\t * sequence number when found and aborting the fetch once found or exhausted. Each op is routed through\n\t * the same unpack pipeline the live inbound path uses (chunk reassembly, ungroup, decompress) and\n\t * {@link inboundVersionMarkUpdate} derives its batch identity, so chunked batches resolve here too. The\n\t * scan anchor is not guaranteed to be a batch boundary, so a leading batch clipped by the anchor is\n\t * tolerated (its orphan end marker is dropped rather than fed to the processor). On a miss,\n\t * {@link classifyMiss} distinguishes `pending` (not sequenced yet) from `unresolvable` (ops trimmed).\n\t * See DEV.md.\n\t */\n\tprivate async resolveFromHistory(\n\t\treader: IHistoricalOpReader,\n\t\tbatchId: string,\n\t\tsequenceNumberLowerBound: number,\n\t): Promise<ResolveResult> {\n\t\tconst from = sequenceNumberLowerBound + 1;\n\t\tconst unpack = this.hooks.createHistoricalOpUnpacker?.();\n\t\tconst abortController = new AbortController();\n\t\ttry {\n\t\t\tconst stream = await reader.fetchMessages(from, undefined, abortController.signal);\n\t\t\tlet firstScannedSequenceNumber: number | undefined;\n\t\t\tlet carriedBatchId: string | undefined;\n\t\t\t// Mirrors the processor's batch-in-progress state so we can drop an orphan end marker (below).\n\t\t\tlet inBatch = false;\n\t\t\twhile (true) {\n\t\t\t\tconst result = await stream.read();\n\t\t\t\tif (result.done) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor (const op of result.value) {\n\t\t\t\t\tfirstScannedSequenceNumber ??= op.sequenceNumber;\n\t\t\t\t\tif (!inBatch && asBatchMetadata(op.metadata)?.batch === false) {\n\t\t\t\t\t\t// The anchor (`sequenceNumberLowerBound + 1`) may land inside a batch whose start\n\t\t\t\t\t\t// precedes the window; its orphan end marker would trip the processor's 0x9d5 assert.\n\t\t\t\t\t\t// Drop the clipped tail. The target batch is fully in-window, so this can't skip it.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// undefined = a system op, or an incomplete chunk awaiting later fragments.\n\t\t\t\t\tconst inboundResult = unpack?.(op);\n\t\t\t\t\tif (inboundResult === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Track batch progress with the processor so the guard above skips only orphan ends.\n\t\t\t\t\tif (inboundResult.type === \"batchStartingMessage\") {\n\t\t\t\t\t\tinBatch = true;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tinboundResult.type === \"nextBatchMessage\" &&\n\t\t\t\t\t\tinboundResult.batchEnd === true\n\t\t\t\t\t) {\n\t\t\t\t\t\tinBatch = false;\n\t\t\t\t\t}\n\t\t\t\t\t// Derive batch identity exactly as the live inbound path does, carrying the id across a\n\t\t\t\t\t// piecemeal batch's messages.\n\t\t\t\t\tconst update = inboundVersionMarkUpdate(inboundResult, carriedBatchId);\n\t\t\t\t\tcarriedBatchId = update.carriedBatchId;\n\t\t\t\t\tif (update.sequenced?.batchId === batchId) {\n\t\t\t\t\t\treturn { kind: \"resolved\", sequenceNumber: update.sequenced.sequenceNumber };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Not found: distinguish \"not sequenced yet\" from \"trimmed\" via the tip and where the scan landed.\n\t\t\treturn this.classifyMiss(from, firstScannedSequenceNumber);\n\t\t} finally {\n\t\t\t// Cancel any in-flight fetch once we stop reading (found or exhausted).\n\t\t\tabortController.abort();\n\t\t}\n\t}\n\n\t/**\n\t * Classifies a history-scan miss as `pending` or `unresolvable`. See {@link resolveFromHistory}.\n\t */\n\tprivate classifyMiss(\n\t\tfrom: number,\n\t\tfirstScannedSequenceNumber: number | undefined,\n\t): ResolveResult {\n\t\t// Invariant: a reader must never return an op before the requested range start. If it does, the\n\t\t// trim inference below is meaningless, so fail loudly rather than misclassify.\n\t\tassert(\n\t\t\tfirstScannedSequenceNumber === undefined || firstScannedSequenceNumber >= from,\n\t\t\t0xd1c /* historical op reader returned an op before the requested range start */,\n\t\t);\n\t\tconst tip = this.hooks.getCurrentSequenceNumber();\n\t\tif (from > tip) {\n\t\t\t// Nothing is sequenced at/after the mark's reference point yet, so the batch cannot have landed.\n\t\t\treturn { kind: \"pending\" };\n\t\t}\n\t\tif (firstScannedSequenceNumber === undefined) {\n\t\t\t// Empty read though ops should exist in `[from, tip]` → trimmed. ODSP-specific: a strict driver\n\t\t\t// empties a `from`-misaligned trimmed range (validateMessages); a return-from-earliest driver\n\t\t\t// would instead surface the trim via the `firstScannedSequenceNumber > from` branch below.\n\t\t\treturn { kind: \"unresolvable\" };\n\t\t}\n\t\tif (firstScannedSequenceNumber > from) {\n\t\t\t// A trim gap at the anchor: the mark's ops (just after the reference point) are gone.\n\t\t\treturn { kind: \"unresolvable\" };\n\t\t}\n\t\t// Ops are present from the reference point and the batch is not among them: not yet sequenced.\n\t\treturn { kind: \"pending\" };\n\t}\n\n\tpublic onBatchSequenced(\n\t\tlistener: (batchId: string, sequenceNumber: number) => void,\n\t): () => void {\n\t\t// A subscriber wants live promotions, so start tracking inbound batches from here on.\n\t\tthis.tracking = true;\n\t\tthis.batchListeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.batchListeners.delete(listener);\n\t\t};\n\t}\n\n\t/** The sequence number for a batch seen live this session, or undefined. */\n\tprivate sessionSequenceFor(batchId: string): number | undefined {\n\t\treturn this.sequenceNumberByBatchId.get(batchId);\n\t}\n\n\t/** Records an inbound batch and notifies listeners so any client can promote matching pending marks. */\n\tpublic processInboundBatch(batchId: string, sequenceNumber: number): void {\n\t\tconst existingSequenceNumber = this.sequenceNumberByBatchId.get(batchId);\n\t\tif (existingSequenceNumber === sequenceNumber) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.sequenceNumberByBatchId.set(batchId, sequenceNumber);\n\t\tthis.evictBelowMinimumSequenceNumber();\n\t\tfor (const listener of this.batchListeners) {\n\t\t\ttry {\n\t\t\t\tlistener(batchId, sequenceNumber);\n\t\t\t} catch (error) {\n\t\t\t\t// Isolate each app listener (like the container's EventEmitterWithErrorHandling): one throw\n\t\t\t\t// must not abort op processing or starve the rest. Log and continue rather than fault the\n\t\t\t\t// container — a missed promotion is recoverable via resolve()'s history scan.\n\t\t\t\tthis.hooks.logger.sendErrorEvent({ eventName: \"VersionMarkListenerException\" }, error);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Bounds the map to the collaboration window by dropping entries below the MSN (mirrors\n\t * `DuplicateBatchDetector`). Safe because below the MSN every client has processed the batch, so its\n\t * `onBatchSequenced` already fired; a dropped entry falls back to the history scan. Entries insert in\n\t * sequence order, so iteration stops at the first retained one.\n\t */\n\tprivate evictBelowMinimumSequenceNumber(): void {\n\t\tconst minimumSequenceNumber = this.hooks.getCurrentMinimumSequenceNumber();\n\t\tfor (const [id, sequenceNumber] of this.sequenceNumberByBatchId) {\n\t\t\tif (sequenceNumber >= minimumSequenceNumber) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.sequenceNumberByBatchId.delete(id);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import { AttachState } from "@fluidframework/container-definitions";
|
|
|
6
6
|
import type { FluidObject, IDisposable, IRequest, IResponse, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
7
|
import type { IFluidHandleInternal, ISignalEnvelope } from "@fluidframework/core-interfaces/internal";
|
|
8
8
|
import type { ISnapshot, ISnapshotTree } from "@fluidframework/driver-definitions/internal";
|
|
9
|
-
import type { AliasResult, ContainerExtensionProvider, FluidDataStoreMessage, IEnvelope, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreFactory, IFluidDataStoreRegistry, IFluidParentContext, IGarbageCollectionData, IInboundSignalMessage, IRuntimeMessageCollection, ISummaryTreeWithStats, ITelemetryContext,
|
|
9
|
+
import type { AliasResult, ContainerExtensionProvider, FluidDataStoreMessage, IEnvelope, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreFactory, IFluidDataStoreRegistry, IFluidParentContext, IGarbageCollectionData, IInboundSignalMessage, IRuntimeMessageCollection, ISummaryTreeWithStats, ITelemetryContext, OldestSupportedClientVersion, NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions/internal";
|
|
10
10
|
import { type MonitoringContext } from "@fluidframework/telemetry-utils/internal";
|
|
11
11
|
import { type RuntimeHeaderData } from "./containerRuntime.js";
|
|
12
12
|
import { type IFluidDataStoreContextPrivate, type ILocalDetachedFluidDataStoreContextProps, LocalFluidDataStoreContext } from "./dataStoreContext.js";
|
|
@@ -39,7 +39,7 @@ export type AddressedUnsequencedSignalEnvelope = IEnvelope<ISignalEnvelope["cont
|
|
|
39
39
|
*/
|
|
40
40
|
export interface IFluidParentContextPrivate extends IFluidParentContext, ContainerExtensionProvider {
|
|
41
41
|
readonly isReadOnly: () => boolean;
|
|
42
|
-
readonly minVersionForCollab:
|
|
42
|
+
readonly minVersionForCollab: OldestSupportedClientVersion;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Kin of {@link @fluidframework/runtime-definitions#IFluidParentContext} with alternate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,oBAAoB,EACpB,eAAe,EACf,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EACX,SAAS,EACT,aAAa,EAEb,MAAM,6CAA6C,CAAC;AAMrD,OAAO,KAAK,EACX,WAAW,EACX,0BAA0B,EAC1B,qBAAqB,EAErB,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EAErB,yBAAyB,EAGzB,qBAAqB,EACrB,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,C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,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,EACjD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,iBAAiB,EAAE,CAAC,OAAO,EAAE,2BAA2B,KAAK,OAAO,CAAC,WAAW,CAAC;IAiD3E,QAAQ,CACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,OAAO,EACxB,MAAM,EAAE,OAAO,GACb,IAAI;IAcA,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;CAI/E;AAED;;;;GAIG;AACH,qBAAa,wBAAyB,YAAW,sBAAsB;IAQrE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAPnC,SAAgB,IAAI,8BAA8B;IAE3C,uBAAuB,EAAE,uBAAuB,CAAC;gBAGvD,eAAe,EAAE,kCAAkC,EAElC,iBAAiB,EAAE,CACnC,OAAO,EAAE,sBAAsB,KAC3B,OAAO,CAAC,WAAW,CAAC;IAK1B,IAAW,sBAAsB,IAAI,wBAAwB,CAE5D;IAEY,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,OAAO,GAChB,OAAO,CAAC,sBAAsB,CAAC;CA6BlC"}
|
package/lib/channelCollection.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
6
|
-
import { assert, Lazy, LazyPromise } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { assert, fail, Lazy, LazyPromise } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { FluidObjectHandle } from "@fluidframework/datastore/internal";
|
|
8
8
|
import { buildSnapshotTree, getSnapshotTree, isInstanceOfISnapshot, } from "@fluidframework/driver-utils/internal";
|
|
9
9
|
import { CreateSummarizerNodeSource, channelsTreeName, gcDataBlobKey, } from "@fluidframework/runtime-definitions/internal";
|
|
@@ -160,7 +160,7 @@ export class ChannelCollection {
|
|
|
160
160
|
return this.resubmitDataStoreOp(message.contents, localOpMetadata, squash);
|
|
161
161
|
}
|
|
162
162
|
default: {
|
|
163
|
-
|
|
163
|
+
fail(0x907 /* unknown op type */);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
};
|
|
@@ -539,7 +539,7 @@ export class ChannelCollection {
|
|
|
539
539
|
return this.applyStashedChannelChannelOp(opContents.contents);
|
|
540
540
|
}
|
|
541
541
|
default: {
|
|
542
|
-
|
|
542
|
+
fail(0x908 /* unknon type of op */);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
}
|
|
@@ -610,7 +610,7 @@ export class ChannelCollection {
|
|
|
610
610
|
break;
|
|
611
611
|
}
|
|
612
612
|
default: {
|
|
613
|
-
|
|
613
|
+
fail(0x8e9 /* unreached */);
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
}
|