You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@fluidframework/telemetry-utils

Package Overview
Dependencies
Maintainers
1
Versions
661
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluidframework/telemetry-utils - npm Package Compare versions

Comparing version
2.74.0
to
2.80.0
+4
-0
CHANGELOG.md
# @fluidframework/telemetry-utils
## 2.80.0
Dependency updates only.
## 2.74.0

@@ -4,0 +8,0 @@

+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EACN,YAAY,EAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,wBAAwB,GAC9B,OAAO,CAAC,SAAS,CAInB;AAED;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,YAAa,YAAW,aAAa,EAAE,eAAe;aAatE,KAAK,CAAC;IAZvB,SAAgB,SAAS,iBAAgC;IAEzD;;;;;OAKG;gBAEF,OAAO,EAAE,MAAM,EAGC,KAAK,CAAC,KAAK,EAC3B,KAAK,CAAC,EAAE,wBAAwB;CAKjC;AAED;;;;GAIG;AACH,qBAAa,UAA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AAE,MAAM,GAAG,SAAS,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,2BAA2B,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,8BAA8B,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAQpC,CAAC"}

@@ -169,3 +169,3 @@ "use strict";

});
this.errorType = internal_1.FluidErrorTypesAlpha.layerIncompatibilityError;
this.errorType = internal_1.FluidErrorTypes.layerIncompatibilityError;
this.layer = incompatibilityProps.layer;

@@ -172,0 +172,0 @@ this.layerVersion = incompatibilityProps.layerVersion;

@@ -1,1 +0,1 @@

{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAMkD;AAGlD,uDAM2B;AAI3B;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AARD,oDAQC;AAED;;;;GAIG;AACH,MAAa,YAAa,SAAQ,8BAAY;IAG7C;;;;;OAKG;IACH,YACC,OAAe;IACf,mIAAmI;IACnI,iHAAiH;IACjG,KAAW,EAC3B,KAAgC;QAEhC,mCAAmC;QACnC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAJ1B,UAAK,GAAL,KAAK,CAAM;QAZZ,cAAS,GAAG,0BAAe,CAAC,YAAY,CAAC;IAiBzD,CAAC;CACD;AAnBD,oCAmBC;AAED;;;;GAIG;AACH,MAAa,UAAW,SAAQ,8BAAY;IAG3C,YAAmB,OAAe,EAAE,KAAgC;QACnE,KAA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AK,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,oBAAoB,CAAC,YAAY,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC;QAChE,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,iCAAiC;YACrC,oBAAoB,CAAC,iCAAiC,CAAC;QACxD,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAC7C,CAAC;CACD;AAxCD,8DAwCC;AAED;;;;;;GAMG;AACI,MAAM,gCAAgC,GAAG,CAC/C,WAUC,EAQA,EAAE,CAAC,CAAC;IACL,eAAe,EAAE,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;IAC9E,qBAAqB,EAAE,WAAW,CAAC,cAAc;IACjD,2BAA2B,EAAE,WAAW,CAAC,oBAAoB;IAC7D,8BAA8B,EAAE,WAAW,CAAC,uBAAuB;IACnE,4BAA4B,EAAE,WAAW,CAAC,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC;AA1BU,QAAA,gCAAgC,oCA0B1C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\tFluidErrorTypesAlpha,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: Partial<\n\t\t\tPick<\n\t\t\t\tISequencedDocumentMessage,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"sequenceNumber\"\n\t\t\t\t| \"clientSequenceNumber\"\n\t\t\t\t| \"referenceSequenceNumber\"\n\t\t\t\t| \"minimumSequenceNumber\"\n\t\t\t\t| \"timestamp\"\n\t\t\t>\n\t\t>,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\t\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\t\ttry {\n\t\t\tif (stackTraceLimit !== undefined) {\n\t\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t\t}\n\n\t\t\tconst dataProcessingError = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terrorMessage,\n\t\t\t\tdataProcessingCodepath,\n\t\t\t\tmessageLike,\n\t\t\t);\n\t\t\tdataProcessingError.addTelemetryProperties(props);\n\n\t\t\treturn dataProcessingError;\n\t\t} finally {\n\t\t\t// Reset the stack trace limit to the original value\n\t\t\tif (stackTraceLimit !== undefined) {\n\t\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks\n\t *\n\t * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n\t * one day we will move away from throwing these errors but rather we'll return them.\n\t * But an unrecognized error needs to be classified as `DataProcessingError`.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: Partial<\n\t\t\tPick<\n\t\t\t\tISequencedDocumentMessage,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"sequenceNumber\"\n\t\t\t\t| \"clientSequenceNumber\"\n\t\t\t\t| \"referenceSequenceNumber\"\n\t\t\t\t| \"minimumSequenceNumber\"\n\t\t\t\t| \"timestamp\"\n\t\t\t>\n\t\t>,\n\t): IFluidErrorBase {\n\t\tconst props = {\n\t\t\tdataProcessingError: 1,\n\t\t\tdataProcessingCodepath,\n\t\t\t...(messageLike === undefined\n\t\t\t\t? undefined\n\t\t\t\t: extractSafePropertiesFromMessage(messageLike)),\n\t\t};\n\n\t\tconst normalizedError = normalizeError(originalError, { props });\n\t\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\t\tif (\n\t\t\tisExternalError(normalizedError) ||\n\t\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t\t) {\n\t\t\t// Create a new DataProcessingError to wrap this external error\n\t\t\tconst dataProcessingError = wrapError(\n\t\t\t\tnormalizedError,\n\t\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\t);\n\n\t\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\t\tdataProcessingError.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\t\treturn dataProcessingError;\n\t\t}\n\t\treturn normalizedError;\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypesAlpha.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: Partial<\n\t\tPick<\n\t\t\tISequencedDocumentMessage,\n\t\t\t| \"clientId\"\n\t\t\t| \"sequenceNumber\"\n\t\t\t| \"clientSequenceNumber\"\n\t\t\t| \"referenceSequenceNumber\"\n\t\t\t| \"minimumSequenceNumber\"\n\t\t\t| \"timestamp\"\n\t\t>\n\t>,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAKkD;AAGlD,uDAM2B;AAI3B;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AARD,oDAQC;AAED;;;;GAIG;AACH,MAAa,YAAa,SAAQ,8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,gCAAgC,oCA0B1C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: Partial<\n\t\t\tPick<\n\t\t\t\tISequencedDocumentMessage,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"sequenceNumber\"\n\t\t\t\t| \"clientSequenceNumber\"\n\t\t\t\t| \"referenceSequenceNumber\"\n\t\t\t\t| \"minimumSequenceNumber\"\n\t\t\t\t| \"timestamp\"\n\t\t\t>\n\t\t>,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\t\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\t\ttry {\n\t\t\tif (stackTraceLimit !== undefined) {\n\t\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t\t}\n\n\t\t\tconst dataProcessingError = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terrorMessage,\n\t\t\t\tdataProcessingCodepath,\n\t\t\t\tmessageLike,\n\t\t\t);\n\t\t\tdataProcessingError.addTelemetryProperties(props);\n\n\t\t\treturn dataProcessingError;\n\t\t} finally {\n\t\t\t// Reset the stack trace limit to the original value\n\t\t\tif (stackTraceLimit !== undefined) {\n\t\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks\n\t *\n\t * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n\t * one day we will move away from throwing these errors but rather we'll return them.\n\t * But an unrecognized error needs to be classified as `DataProcessingError`.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: Partial<\n\t\t\tPick<\n\t\t\t\tISequencedDocumentMessage,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"sequenceNumber\"\n\t\t\t\t| \"clientSequenceNumber\"\n\t\t\t\t| \"referenceSequenceNumber\"\n\t\t\t\t| \"minimumSequenceNumber\"\n\t\t\t\t| \"timestamp\"\n\t\t\t>\n\t\t>,\n\t): IFluidErrorBase {\n\t\tconst props = {\n\t\t\tdataProcessingError: 1,\n\t\t\tdataProcessingCodepath,\n\t\t\t...(messageLike === undefined\n\t\t\t\t? undefined\n\t\t\t\t: extractSafePropertiesFromMessage(messageLike)),\n\t\t};\n\n\t\tconst normalizedError = normalizeError(originalError, { props });\n\t\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\t\tif (\n\t\t\tisExternalError(normalizedError) ||\n\t\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t\t) {\n\t\t\t// Create a new DataProcessingError to wrap this external error\n\t\t\tconst dataProcessingError = wrapError(\n\t\t\t\tnormalizedError,\n\t\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\t);\n\n\t\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\t\tdataProcessingError.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\t\treturn dataProcessingError;\n\t\t}\n\t\treturn normalizedError;\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: Partial<\n\t\tPick<\n\t\t\tISequencedDocumentMessage,\n\t\t\t| \"clientId\"\n\t\t\t| \"sequenceNumber\"\n\t\t\t| \"clientSequenceNumber\"\n\t\t\t| \"referenceSequenceNumber\"\n\t\t\t| \"minimumSequenceNumber\"\n\t\t\t| \"timestamp\"\n\t\t>\n\t>,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}

@@ -1,1 +0,1 @@

{"version":3,"file":"fluidErrorBase.d.ts","sourceRoot":"","sources":["../src/fluidErrorBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;IAEnD;;OAEG;IACH,sBAAsB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACjE;AAMD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAO,OAAO;qBAA2B,MAAM;CACG,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAOrE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,0BAA0B,CAIrC"}
{"version":3,"file":"fluidErrorBase.d.ts","sourceRoot":"","sources":["../src/fluidErrorBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;IAEnD;;OAEG;IACH,sBAAsB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACjE;AAMD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAO,OAAO;qBAA2B,MAAM;CACG,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAOrE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,0BAA0B,CAErC"}

@@ -36,5 +36,5 @@ "use strict";

function isLayerIncompatibilityError(error) {
return (isFluidError(error) && error.errorType === internal_1.FluidErrorTypesAlpha.layerIncompatibilityError);
return isFluidError(error) && error.errorType === internal_1.FluidErrorTypes.layerIncompatibilityError;
}
exports.isLayerIncompatibilityError = isLayerIncompatibilityError;
//# sourceMappingURL=fluidErrorBase.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"fluidErrorBase.js","sourceRoot":"","sources":["../src/fluidErrorBase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAGkD;AAkFlD,MAAM,yBAAyB,GAAG,CAAC,CAAU,EAAW,EAAE,CACzD,OAAQ,CAA8B,EAAE,sBAAsB,KAAK,UAAU;IAC7E,OAAQ,CAA8B,EAAE,sBAAsB,KAAK,UAAU,CAAC;AAE/E;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,CAAU,EAAoC,EAAE,CAClF,OAAQ,CAA0C,EAAE,eAAe,KAAK,QAAQ,CAAC;AADrE,QAAA,kBAAkB,sBACmD;AAElF;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAc;IAC1C,OAAO,CACN,OAAQ,KAAkC,EAAE,SAAS,KAAK,QAAQ;QAClE,OAAQ,KAAkC,EAAE,OAAO,KAAK,QAAQ;QAChE,IAAA,0BAAkB,EAAC,KAAK,CAAC;QACzB,yBAAyB,CAAC,KAAK,CAAC,CAChC,CAAC;AACH,CAAC;AAPD,oCAOC;AAED;;;;GAIG;AACH,SAAgB,2BAA2B,CAC1C,KAAc;IAEd,OAAO,CACN,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,SAAS,KAAK,+BAAoB,CAAC,yBAAyB,CACzF,CAAC;AACH,CAAC;AAND,kEAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypesAlpha,\n\ttype ILayerIncompatibilityError,\n} from \"@fluidframework/core-interfaces/internal\";\n\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * An error emitted by the Fluid Framework.\n *\n * @remarks\n *\n * All normalized errors flowing through the Fluid Framework adhere to this readonly interface.\n *\n * It features the members of {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}\n * made readonly, as well as {@link IFluidErrorBase.errorType} and {@link IFluidErrorBase.errorInstanceId}.\n * It also features getters and setters for telemetry props to be included when the error is logged.\n *\n * @internal\n */\nexport interface IFluidErrorBase extends Error {\n\t/**\n\t * Classification of what type of error this is.\n\t *\n\t * @remarks Used programmatically by consumers to interpret the error.\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * Error's message property, made readonly.\n\t *\n\t * @remarks\n\t *\n\t * Recommendations:\n\t *\n\t * Be specific, but also take care when including variable data to consider suitability for aggregation in telemetry.\n\t * Also avoid including any data that jeopardizes the user's privacy. Add a tagged telemetry property instead.\n\t */\n\treadonly message: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack}.\n\t */\n\treadonly stack?: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name}.\n\t */\n\treadonly name: string;\n\n\t/**\n\t * A Guid identifying this error instance.\n\t *\n\t * @remarks\n\t *\n\t * Useful in telemetry for deduplicating multiple logging events arising from the same error,\n\t * or correlating an error with an inner error that caused it, in case of error wrapping.\n\t */\n\treadonly errorInstanceId: string;\n\n\t/**\n\t * When present, inner error that caused this error.\n\t *\n\t * @remarks\n\t * This will often be an {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error|Error}, but could be any type.\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause\n\t *\n\t * @privateRemarks\n\t * The \"cause\" field is added in ES2022. Using it even without that built-in support, is still helpful.\n\t * TODO: remove this declaration (use `Error.cause` property) when targeting ES2022 lib or later.\n\t */\n\tcause?: unknown;\n\n\t/**\n\t * Get the telemetry properties stashed on this error for logging.\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n\n\t/**\n\t * Add telemetry properties to this error which will be logged with the error\n\t */\n\taddTelemetryProperties: (props: ITelemetryPropertiesExt) => void;\n}\n\nconst hasTelemetryPropFunctions = (x: unknown): boolean =>\n\ttypeof (x as Partial<IFluidErrorBase>)?.getTelemetryProperties === \"function\" &&\n\ttypeof (x as Partial<IFluidErrorBase>)?.addTelemetryProperties === \"function\";\n\n/**\n * Type guard for error data containing the {@link IFluidErrorBase.errorInstanceId} property.\n *\n * @internal\n */\nexport const hasErrorInstanceId = (x: unknown): x is { errorInstanceId: string } =>\n\ttypeof (x as Partial<{ errorInstanceId: string }>)?.errorInstanceId === \"string\";\n\n/**\n * Type guard for {@link IFluidErrorBase}.\n *\n * @internal\n */\nexport function isFluidError(error: unknown): error is IFluidErrorBase {\n\treturn (\n\t\ttypeof (error as Partial<IFluidErrorBase>)?.errorType === \"string\" &&\n\t\ttypeof (error as Partial<IFluidErrorBase>)?.message === \"string\" &&\n\t\thasErrorInstanceId(error) &&\n\t\thasTelemetryPropFunctions(error)\n\t);\n}\n\n/**\n * Helper that returns whether the provided error is a layer incompatibility error.\n *\n * @internal\n */\nexport function isLayerIncompatibilityError(\n\terror: unknown,\n): error is ILayerIncompatibilityError {\n\treturn (\n\t\tisFluidError(error) && error.errorType === FluidErrorTypesAlpha.layerIncompatibilityError\n\t);\n}\n"]}
{"version":3,"file":"fluidErrorBase.js","sourceRoot":"","sources":["../src/fluidErrorBase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAGkD;AAkFlD,MAAM,yBAAyB,GAAG,CAAC,CAAU,EAAW,EAAE,CACzD,OAAQ,CAA8B,EAAE,sBAAsB,KAAK,UAAU;IAC7E,OAAQ,CAA8B,EAAE,sBAAsB,KAAK,UAAU,CAAC;AAE/E;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,CAAU,EAAoC,EAAE,CAClF,OAAQ,CAA0C,EAAE,eAAe,KAAK,QAAQ,CAAC;AADrE,QAAA,kBAAkB,sBACmD;AAElF;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAc;IAC1C,OAAO,CACN,OAAQ,KAAkC,EAAE,SAAS,KAAK,QAAQ;QAClE,OAAQ,KAAkC,EAAE,OAAO,KAAK,QAAQ;QAChE,IAAA,0BAAkB,EAAC,KAAK,CAAC;QACzB,yBAAyB,CAAC,KAAK,CAAC,CAChC,CAAC;AACH,CAAC;AAPD,oCAOC;AAED;;;;GAIG;AACH,SAAgB,2BAA2B,CAC1C,KAAc;IAEd,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,SAAS,KAAK,0BAAe,CAAC,yBAAyB,CAAC;AAC7F,CAAC;AAJD,kEAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype ILayerIncompatibilityError,\n} from \"@fluidframework/core-interfaces/internal\";\n\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * An error emitted by the Fluid Framework.\n *\n * @remarks\n *\n * All normalized errors flowing through the Fluid Framework adhere to this readonly interface.\n *\n * It features the members of {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}\n * made readonly, as well as {@link IFluidErrorBase.errorType} and {@link IFluidErrorBase.errorInstanceId}.\n * It also features getters and setters for telemetry props to be included when the error is logged.\n *\n * @internal\n */\nexport interface IFluidErrorBase extends Error {\n\t/**\n\t * Classification of what type of error this is.\n\t *\n\t * @remarks Used programmatically by consumers to interpret the error.\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * Error's message property, made readonly.\n\t *\n\t * @remarks\n\t *\n\t * Recommendations:\n\t *\n\t * Be specific, but also take care when including variable data to consider suitability for aggregation in telemetry.\n\t * Also avoid including any data that jeopardizes the user's privacy. Add a tagged telemetry property instead.\n\t */\n\treadonly message: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack}.\n\t */\n\treadonly stack?: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name}.\n\t */\n\treadonly name: string;\n\n\t/**\n\t * A Guid identifying this error instance.\n\t *\n\t * @remarks\n\t *\n\t * Useful in telemetry for deduplicating multiple logging events arising from the same error,\n\t * or correlating an error with an inner error that caused it, in case of error wrapping.\n\t */\n\treadonly errorInstanceId: string;\n\n\t/**\n\t * When present, inner error that caused this error.\n\t *\n\t * @remarks\n\t * This will often be an {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error|Error}, but could be any type.\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause\n\t *\n\t * @privateRemarks\n\t * The \"cause\" field is added in ES2022. Using it even without that built-in support, is still helpful.\n\t * TODO: remove this declaration (use `Error.cause` property) when targeting ES2022 lib or later.\n\t */\n\tcause?: unknown;\n\n\t/**\n\t * Get the telemetry properties stashed on this error for logging.\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n\n\t/**\n\t * Add telemetry properties to this error which will be logged with the error\n\t */\n\taddTelemetryProperties: (props: ITelemetryPropertiesExt) => void;\n}\n\nconst hasTelemetryPropFunctions = (x: unknown): boolean =>\n\ttypeof (x as Partial<IFluidErrorBase>)?.getTelemetryProperties === \"function\" &&\n\ttypeof (x as Partial<IFluidErrorBase>)?.addTelemetryProperties === \"function\";\n\n/**\n * Type guard for error data containing the {@link IFluidErrorBase.errorInstanceId} property.\n *\n * @internal\n */\nexport const hasErrorInstanceId = (x: unknown): x is { errorInstanceId: string } =>\n\ttypeof (x as Partial<{ errorInstanceId: string }>)?.errorInstanceId === \"string\";\n\n/**\n * Type guard for {@link IFluidErrorBase}.\n *\n * @internal\n */\nexport function isFluidError(error: unknown): error is IFluidErrorBase {\n\treturn (\n\t\ttypeof (error as Partial<IFluidErrorBase>)?.errorType === \"string\" &&\n\t\ttypeof (error as Partial<IFluidErrorBase>)?.message === \"string\" &&\n\t\thasErrorInstanceId(error) &&\n\t\thasTelemetryPropFunctions(error)\n\t);\n}\n\n/**\n * Helper that returns whether the provided error is a layer incompatibility error.\n *\n * @internal\n */\nexport function isLayerIncompatibilityError(\n\terror: unknown,\n): error is ILayerIncompatibilityError {\n\treturn isFluidError(error) && error.errorType === FluidErrorTypes.layerIncompatibilityError;\n}\n"]}

@@ -18,3 +18,3 @@ /*!

export { TelemetryEventBatcher } from "./telemetryEventBatcher.js";
export { validateLayerCompatibility } from "./layerCompatError.js";
export { allowIncompatibleLayersKey, validateLayerCompatibility } from "./layerCompatError.js";
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,4BAA4B,EAC5B,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,KAAK,eAAe,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,KAAK,mBAAmB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,yBAAyB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,eAAe,EACf,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kBAAkB,EAClB,KAAK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yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC"}

@@ -8,3 +8,3 @@ "use strict";

exports.measure = exports.createSampledLogger = exports.SampledTelemetryHelper = exports.ThresholdCounter = exports.MockLogger = exports.createMockLoggerExt = exports.TelemetryDataTag = exports.tagCodeArtifacts = exports.tagData = exports.TaggedLoggerAdapter = exports.PerformanceEvent = exports.numberFromString = exports.formatTick = exports.createMultiSinkLogger = exports.createChildLogger = exports.eventNamespaceSeparator = exports.isLayerIncompatibilityError = exports.isFluidError = exports.hasErrorInstanceId = exports.safeRaiseEvent = exports.raiseConnectedEvent = exports.disconnectedEventName = exports.connectedEventName = exports.EventEmitterWithErrorHandling = exports.wrapErrorAndLog = exports.wrapError = exports.overwriteStack = exports.normalizeError = exports.NORMALIZED_ERROR_TYPE = exports.LoggingError = exports.isTaggedTelemetryPropertyValue = exports.isILoggingError = exports.isExternalError = exports.getCircularReplacer = exports.generateStack = exports.generateErrorWithStack = exports.extractLogSafeErrorProperties = exports.LayerIncompatibilityError = exports.validatePrecondition = exports.UsageError = exports.GenericError = exports.extractSafePropertiesFromMessage = exports.DataProcessingError = exports.DataCorruptionError = exports.createConfigBasedOptionsProxy = exports.wrapConfigProviderWithDefaults = exports.loggerToMonitoringContext = exports.mixinMonitoringContext = exports.sessionStorageConfigProvider = exports.createChildMonitoringContext = void 0;
exports.validateLayerCompatibility = exports.TelemetryEventBatcher = void 0;
exports.validateLayerCompatibility = exports.allowIncompatibleLayersKey = exports.TelemetryEventBatcher = void 0;
var config_js_1 = require("./config.js");

@@ -74,3 +74,4 @@ Object.defineProperty(exports, "createChildMonitoringContext", { enumerable: true, get: function () { return config_js_1.createChildMonitoringContext; } });

var layerCompatError_js_1 = require("./layerCompatError.js");
Object.defineProperty(exports, "allowIncompatibleLayersKey", { enumerable: true, get: function () { return layerCompatError_js_1.allowIncompatibleLayersKey; } });
Object.defineProperty(exports, "validateLayerCompatibility", { enumerable: true, get: function () { return layerCompatError_js_1.validateLayerCompatibility; } });
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,yCAUqB;AATpB,yHAAA,4BAA4B,OAAA;AAE5B,yHAAA,4BAA4B,OAAA;AAC5B,mHAAA,sBAAsB,OAAA;AAEtB,sHAAA,yBAAyB,OAAA;AACzB,2HAAA,8BAA8B,OAAA;AAC9B,0HAAA,6BAA6B,OAAA;AAG9B,uCAQoB;AAPnB,+GAAA,mBAAmB,OAAA;AACnB,+GAAA,mBAAmB,OAAA;AACnB,4HAAA,gCAAgC,OAAA;AAChC,wGAAA,YAAY,OAAA;AACZ,sGAAA,UAAU,OAAA;AACV,gHAAA,oBAAoB,OAAA;AACpB,qHAAA,yBAAyB,OAAA;AAE1B,qDAe2B;AAd1B,gIAAA,6BAA6B,OAAA;AAC7B,yHAAA,sBAAsB,OAAA;AACtB,gHAAA,aAAa,OAAA;AACb,sHAAA,mBAAmB,OAAA;AAEnB,kHAAA,eAAe,OAAA;AACf,kHAAA,eAAe,OAAA;AACf,iIAAA,8BAA8B,OAAA;AAC9B,+GAAA,YAAY,OAAA;AACZ,wHAAA,qBAAqB,OAAA;AACrB,iHAAA,cAAc,OAAA;AACd,iHAAA,cAAc,OAAA;AACd,4GAAA,SAAS,OAAA;AACT,kHAAA,eAAe,OAAA;AAEhB,uFAAmF;AAA1E,iJAAA,6BAA6B,OAAA;AACtC,yCAKqB;AAJpB,+GAAA,kBAAkB,OAAA;AAClB,kHAAA,qBAAqB,OAAA;AACrB,gHAAA,mBAAmB,OAAA;AACnB,2GAAA,cAAc,OAAA;AAEf,yDAK6B;AAJ5B,uHAAA,kBAAkB,OAAA;AAElB,iHAAA,YAAY,OAAA;AACZ,gIAAA,2BAA2B,OAAA;AAE5B,yCAgBqB;AAfpB,oHAAA,uBAAuB,OAAA;AACvB,8GAAA,iBAAiB,OAAA;AACjB,kHAAA,qBAAqB,OAAA;AACrB,uGAAA,UAAU,OAAA;AAKV,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,oGAAA,OAAO,OAAA;AACP,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAGjB,iDAIyB;AAHxB,oHAAA,mBAAmB,OAAA;AAEnB,2GAAA,UAAU,OAAA;AAEX,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,yEAKqC;AAJpC,mIAAA,sBAAsB,OAAA;AAKvB,uCAKoB;AAJnB,+GAAA,mBAAmB,OAAA;AAGnB,mGAAA,OAAO,OAAA;AAYR,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,6DAAmE;AAA1D,iIAAA,0BAA0B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateChildMonitoringContext,\n\ttype MonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\ttype IConfigProvider,\n\tloggerToMonitoringContext,\n\twrapConfigProviderWithDefaults,\n\tcreateConfigBasedOptionsProxy,\n\ttype OptionConfigReaders,\n} from \"./config.js\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n\tLayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\ttype IFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging.js\";\nexport { EventEmitterWithErrorHandling } from \"./eventEmitterWithErrorHandling.js\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events.js\";\nexport {\n\thasErrorInstanceId,\n\ttype IFluidErrorBase,\n\tisFluidError,\n\tisLayerIncompatibilityError,\n} from \"./fluidErrorBase.js\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\tformatTick,\n\ttype IPerformanceEventMarkers,\n\ttype ITelemetryLoggerPropertyBag,\n\ttype ITelemetryLoggerPropertyBags,\n\ttype MultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\ttype TelemetryEventPropertyTypes,\n} from \"./logger.js\";\nexport {\n\tcreateMockLoggerExt,\n\ttype IMockLoggerExt,\n\tMockLogger,\n} from \"./mockLogger.js\";\nexport { ThresholdCounter } from \"./thresholdCounter.js\";\nexport {\n\tSampledTelemetryHelper,\n\ttype CustomMetrics,\n\ttype ICustomData,\n\ttype MeasureReturnType,\n} from \"./sampledTelemetryHelper.js\";\nexport {\n\tcreateSampledLogger,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\tmeasure,\n} from \"./utils.js\";\nexport type {\n\tTelemetryEventPropertyTypeExt,\n\tITelemetryEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tITelemetryLoggerExt,\n\tITelemetryPropertiesExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypes.js\";\nexport { TelemetryEventBatcher } from \"./telemetryEventBatcher.js\";\nexport { validateLayerCompatibility } from \"./layerCompatError.js\";\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AAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,oGAAA,OAAO,OAAA;AACP,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAGjB,iDAIyB;AAHxB,oHAAA,mBAAmB,OAAA;AAEnB,2GAAA,UAAU,OAAA;AAEX,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,yEAKqC;AAJpC,mIAAA,sBAAsB,OAAA;AAKvB,uCAKoB;AAJnB,+GAAA,mBAAmB,OAAA;AAGnB,mGAAA,OAAO,OAAA;AAYR,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,6DAA+F;AAAtF,iIAAA,0BAA0B,OAAA;AAAE,iIAAA,0BAA0B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateChildMonitoringContext,\n\ttype MonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\ttype IConfigProvider,\n\tloggerToMonitoringContext,\n\twrapConfigProviderWithDefaults,\n\tcreateConfigBasedOptionsProxy,\n\ttype OptionConfigReaders,\n} from \"./config.js\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n\tLayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\ttype IFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging.js\";\nexport { EventEmitterWithErrorHandling } from \"./eventEmitterWithErrorHandling.js\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events.js\";\nexport {\n\thasErrorInstanceId,\n\ttype IFluidErrorBase,\n\tisFluidError,\n\tisLayerIncompatibilityError,\n} from \"./fluidErrorBase.js\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\tformatTick,\n\ttype IPerformanceEventMarkers,\n\ttype ITelemetryLoggerPropertyBag,\n\ttype ITelemetryLoggerPropertyBags,\n\ttype MultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\ttype TelemetryEventPropertyTypes,\n} from \"./logger.js\";\nexport {\n\tcreateMockLoggerExt,\n\ttype IMockLoggerExt,\n\tMockLogger,\n} from \"./mockLogger.js\";\nexport { ThresholdCounter } from \"./thresholdCounter.js\";\nexport {\n\tSampledTelemetryHelper,\n\ttype CustomMetrics,\n\ttype ICustomData,\n\ttype MeasureReturnType,\n} from \"./sampledTelemetryHelper.js\";\nexport {\n\tcreateSampledLogger,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\tmeasure,\n} from \"./utils.js\";\nexport type {\n\tTelemetryEventPropertyTypeExt,\n\tITelemetryEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tITelemetryLoggerExt,\n\tITelemetryPropertiesExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypes.js\";\nexport { TelemetryEventBatcher } from \"./telemetryEventBatcher.js\";\nexport { allowIncompatibleLayersKey, validateLayerCompatibility } from \"./layerCompatError.js\";\n"]}

@@ -7,11 +7,29 @@ /*!

import type { IErrorBase } from "@fluidframework/core-interfaces";
import type { ITelemetryLoggerExt } from "./telemetryTypes.js";
import type { MonitoringContext } from "./config.js";
/**
* The config key to disable layer compatibility validation.
* @internal
*/
export declare const allowIncompatibleLayersKey = "Fluid.AllowIncompatibleLayers";
/**
* Validates the compatibility between two layers using their compatibility details and support requirements.
* If the layers are incompatible, it logs an "LayerIncompatibilityError" error event. It will also call the dispose
* If the layers are incompatible, it logs a "LayerIncompatibilityError" error event. It will also call the dispose
* function with the error and throw the error.
* @param layer1 - The name of the first layer.
* @param layer2 - The name of the second layer.
* @param compatDetailsLayer1 - The compatibility details of the first layer.
* @param compatSupportRequirementsLayer1 - The support requirements that the second layer must meet to be compatible
* with the first layer.
* @param maybeCompatDetailsLayer2 - The compatibility details of the second layer. This can be undefined if the
* second layer does not provide compatibility details.
* @param disposeFn - A function that will be called with the error if the layers are incompatible.
* @param mc - The monitoring context for logging and reading configuration.
* @param strictCompatibilityCheck - If true, the function will use default compatibility details for the second layer if
* they are missing and use it for validation.
* If false, it will skip the compatibility check if the details are missing and just log an error.
* Defaults to false.
*
* @internal
*/
export declare function validateLayerCompatibility(layer1: FluidLayer, layer2: FluidLayer, compatDetailsLayer1: Pick<ILayerCompatDetails, "pkgVersion" | "generation">, compatSupportRequirementsLayer1: ILayerCompatSupportRequirements, maybeCompatDetailsLayer2: ILayerCompatDetails | undefined, disposeFn: (error?: IErrorBase) => void, logger: ITelemetryLoggerExt): void;
export declare function validateLayerCompatibility(layer1: FluidLayer, layer2: FluidLayer, compatDetailsLayer1: Pick<ILayerCompatDetails, "pkgVersion" | "generation">, compatSupportRequirementsLayer1: ILayerCompatSupportRequirements, maybeCompatDetailsLayer2: ILayerCompatDetails | undefined, disposeFn: (error?: IErrorBase) => void, mc: MonitoringContext, strictCompatibilityCheck?: boolean): void;
//# sourceMappingURL=layerCompatError.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"layerCompatError.d.ts","sourceRoot":"","sources":["../src/layerCompatError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,YAAY,CAAC,EAC3E,+BAA+B,EAAE,+BAA+B,EAChE,wBAAwB,EAAE,mBAAmB,GAAG,SAAS,EACzD,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,EACvC,MAAM,EAAE,mBAAmB,GACzB,IAAI,CAyCN"}
{"version":3,"file":"layerCompatError.d.ts","sourceRoot":"","sources":["../src/layerCompatError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,kCAAkC,CAAC;AAe1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,YAAY,CAAC,EAC3E,+BAA+B,EAAE,+BAA+B,EAChE,wBAAwB,EAAE,mBAAmB,GAAG,SAAS,EACzD,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,EACvC,EAAE,EAAE,iBAAiB,EACrB,wBAAwB,GAAE,OAAe,GACvC,IAAI,CAiFN"}

@@ -7,13 +7,42 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.validateLayerCompatibility = void 0;
exports.validateLayerCompatibility = exports.allowIncompatibleLayersKey = void 0;
const client_utils_1 = require("@fluid-internal/client-utils");
const error_js_1 = require("./error.js");
/**
* The config key to disable layer compatibility validation.
* @internal
*/
exports.allowIncompatibleLayersKey = "Fluid.AllowIncompatibleLayers";
/**
* Tracks whether the event is logged when failing on layer incompatibility is bypassed via global config.
* This is used to ensure that the bypass event is only logged once per session so it does not flood telemetry.
*/
let globalBypassLogged = false;
/**
* Tracks whether the event is logged when failing on layer incompatibility is bypassed due to missing
* compatibility details for each layer pair.
* This is used to ensure that the bypass event is only logged once per layer pair so it does not flood telemetry.
*/
const strictCheckBypassLoggedForPair = new Set();
/**
* Validates the compatibility between two layers using their compatibility details and support requirements.
* If the layers are incompatible, it logs an "LayerIncompatibilityError" error event. It will also call the dispose
* If the layers are incompatible, it logs a "LayerIncompatibilityError" error event. It will also call the dispose
* function with the error and throw the error.
* @param layer1 - The name of the first layer.
* @param layer2 - The name of the second layer.
* @param compatDetailsLayer1 - The compatibility details of the first layer.
* @param compatSupportRequirementsLayer1 - The support requirements that the second layer must meet to be compatible
* with the first layer.
* @param maybeCompatDetailsLayer2 - The compatibility details of the second layer. This can be undefined if the
* second layer does not provide compatibility details.
* @param disposeFn - A function that will be called with the error if the layers are incompatible.
* @param mc - The monitoring context for logging and reading configuration.
* @param strictCompatibilityCheck - If true, the function will use default compatibility details for the second layer if
* they are missing and use it for validation.
* If false, it will skip the compatibility check if the details are missing and just log an error.
* Defaults to false.
*
* @internal
*/
function validateLayerCompatibility(layer1, layer2, compatDetailsLayer1, compatSupportRequirementsLayer1, maybeCompatDetailsLayer2, disposeFn, logger) {
function validateLayerCompatibility(layer1, layer2, compatDetailsLayer1, compatSupportRequirementsLayer1, maybeCompatDetailsLayer2, disposeFn, mc, strictCompatibilityCheck = false) {
const layerCheckResult = (0, client_utils_1.checkLayerCompatibility)(compatSupportRequirementsLayer1, maybeCompatDetailsLayer2);

@@ -41,3 +70,34 @@ if (!layerCheckResult.isCompatible) {

});
logger.sendErrorEvent({
if (mc.config.getBoolean(exports.allowIncompatibleLayersKey) === true) {
// If the validation is explicitly disabled via config, do not fail. This config provides a way to bypass
// compatibility validation while this feature is being rolled out.
if (!globalBypassLogged) {
// This event is only logged once per session to avoid flooding telemetry.
globalBypassLogged = true;
mc.logger.sendTelemetryEvent({
eventName: "LayerIncompatibilityDetectedButBypassed",
reason: `${exports.allowIncompatibleLayersKey} config is set to true`,
}, error);
}
return;
}
if (maybeCompatDetailsLayer2 === undefined && !strictCompatibilityCheck) {
// If there is no compatibility details for layer2 and strictCompatibilityCheck is false, do not fail.
// There can be a couple of scenarios where this can happen:
// 1. layer2's version is older than the version where compatibility enforcement was introduced. In this
// case, the behavior is the same as before compatibility enforcement was introduced.
// 2. layer2 has a custom implementation which doesn't provide compatibility details. In this case,
// we don't know for sure that it is incompatible. It may fail at a later point when it tries to use
// some feature that the Runtime doesn't support.
if (!strictCheckBypassLoggedForPair.has(`${layer1}-${layer2}`)) {
// This event is only logged once per session per layer combination to avoid flooding telemetry.
strictCheckBypassLoggedForPair.add(`${layer1}-${layer2}`);
mc.logger.sendTelemetryEvent({
eventName: "LayerIncompatibilityDetectedButBypassed",
reason: `No compatibility details provided for ${layer2} and strictCompatibilityCheck is false`,
}, error);
}
return;
}
mc.logger.sendErrorEvent({
eventName: "LayerIncompatibilityError",

@@ -44,0 +104,0 @@ }, error);

@@ -1,1 +0,1 @@

{"version":3,"file":"layerCompatError.js","sourceRoot":"","sources":["../src/layerCompatError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAKsC;AAGtC,yCAAuD;AAGvD;;;;;;GAMG;AACH,SAAgB,0BAA0B,CACzC,MAAkB,EAClB,MAAkB,EAClB,mBAA2E,EAC3E,+BAAgE,EAChE,wBAAyD,EACzD,SAAuC,EACvC,MAA2B;IAE3B,MAAM,gBAAgB,GAAG,IAAA,sCAAuB,EAC/C,+BAA+B,EAC/B,wBAAwB,CACxB,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,cAAc,GAAG;YACtB,KAAK,EAAE,MAAM;YACb,iBAAiB,EAAE,MAAM;YACzB,YAAY,EAAE,mBAAmB,CAAC,UAAU;YAC5C,wBAAwB,EAAE,wBAAwB,EAAE,UAAU,IAAI,SAAS;YAC3E,iCAAiC,EAChC,mBAAmB,CAAC,UAAU;gBAC9B,+BAA+B,CAAC,sBAAsB;YACvD,wBAAwB,EACvB,mBAAmB,CAAC,UAAU,GAAG,CAAC,wBAAwB,EAAE,UAAU,IAAI,CAAC,CAAC;SAC7E,CAAC;QACF,MAAM,kBAAkB,GAAG;YAC1B,eAAe,EAAE,mBAAmB,CAAC,UAAU;YAC/C,2BAA2B,EAAE,wBAAwB,EAAE,UAAU;YACjE,sBAAsB,EAAE,+BAA+B,CAAC,sBAAsB;YAC9E,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB;YAC/D,mBAAmB,EAAE,gBAAgB,CAAC,mBAAmB;SACzD,CAAC;QAEF,MAAM,KAAK,GAAG,IAAI,oCAAyB,CAC1C,uBAAuB,MAAM,QAAQ,MAAM,qBAAqB,EAChE;YACC,GAAG,cAAc;YACjB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC;SAC3C,CACD,CAAC;QACF,MAAM,CAAC,cAAc,CACpB;YACC,SAAS,EAAE,2BAA2B;SACtC,EACD,KAAK,CACL,CAAC;QACF,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAjDD,gEAiDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype FluidLayer,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\n\nimport { LayerIncompatibilityError } from \"./error.js\";\nimport type { ITelemetryLoggerExt } from \"./telemetryTypes.js\";\n\n/**\n * Validates the compatibility between two layers using their compatibility details and support requirements.\n * If the layers are incompatible, it logs an \"LayerIncompatibilityError\" error event. It will also call the dispose\n * function with the error and throw the error.\n *\n * @internal\n */\nexport function validateLayerCompatibility(\n\tlayer1: FluidLayer,\n\tlayer2: FluidLayer,\n\tcompatDetailsLayer1: Pick<ILayerCompatDetails, \"pkgVersion\" | \"generation\">,\n\tcompatSupportRequirementsLayer1: ILayerCompatSupportRequirements,\n\tmaybeCompatDetailsLayer2: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: IErrorBase) => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tcompatSupportRequirementsLayer1,\n\t\tmaybeCompatDetailsLayer2,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst coreProperties = {\n\t\t\tlayer: layer1,\n\t\t\tincompatibleLayer: layer2,\n\t\t\tlayerVersion: compatDetailsLayer1.pkgVersion,\n\t\t\tincompatibleLayerVersion: maybeCompatDetailsLayer2?.pkgVersion ?? \"unknown\",\n\t\t\tcompatibilityRequirementsInMonths:\n\t\t\t\tcompatDetailsLayer1.generation -\n\t\t\t\tcompatSupportRequirementsLayer1.minSupportedGeneration,\n\t\t\tactualDifferenceInMonths:\n\t\t\t\tcompatDetailsLayer1.generation - (maybeCompatDetailsLayer2?.generation ?? 0),\n\t\t};\n\t\tconst detailedProperties = {\n\t\t\tlayerGeneration: compatDetailsLayer1.generation,\n\t\t\tincompatibleLayerGeneration: maybeCompatDetailsLayer2?.generation,\n\t\t\tminSupportedGeneration: compatSupportRequirementsLayer1.minSupportedGeneration,\n\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t};\n\n\t\tconst error = new LayerIncompatibilityError(\n\t\t\t`The versions of the ${layer1} and ${layer2} are not compatible`,\n\t\t\t{\n\t\t\t\t...coreProperties,\n\t\t\t\tdetails: JSON.stringify(detailedProperties),\n\t\t\t},\n\t\t);\n\t\tlogger.sendErrorEvent(\n\t\t\t{\n\t\t\t\teventName: \"LayerIncompatibilityError\",\n\t\t\t},\n\t\t\terror,\n\t\t);\n\t\tdisposeFn(error);\n\t\tthrow error;\n\t}\n}\n"]}
{"version":3,"file":"layerCompatError.js","sourceRoot":"","sources":["../src/layerCompatError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAKsC;AAItC,yCAAuD;AAEvD;;;GAGG;AACU,QAAA,0BAA0B,GAAG,+BAA+B,CAAC;AAE1E;;;GAGG;AACH,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAE/B;;;;GAIG;AACH,MAAM,8BAA8B,GAAgB,IAAI,GAAG,EAAU,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,0BAA0B,CACzC,MAAkB,EAClB,MAAkB,EAClB,mBAA2E,EAC3E,+BAAgE,EAChE,wBAAyD,EACzD,SAAuC,EACvC,EAAqB,EACrB,2BAAoC,KAAK;IAEzC,MAAM,gBAAgB,GAAG,IAAA,sCAAuB,EAC/C,+BAA+B,EAC/B,wBAAwB,CACxB,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,cAAc,GAAG;YACtB,KAAK,EAAE,MAAM;YACb,iBAAiB,EAAE,MAAM;YACzB,YAAY,EAAE,mBAAmB,CAAC,UAAU;YAC5C,wBAAwB,EAAE,wBAAwB,EAAE,UAAU,IAAI,SAAS;YAC3E,iCAAiC,EAChC,mBAAmB,CAAC,UAAU;gBAC9B,+BAA+B,CAAC,sBAAsB;YACvD,wBAAwB,EACvB,mBAAmB,CAAC,UAAU,GAAG,CAAC,wBAAwB,EAAE,UAAU,IAAI,CAAC,CAAC;SAC7E,CAAC;QACF,MAAM,kBAAkB,GAAG;YAC1B,eAAe,EAAE,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AAwC;iBAC/F,EACD,KAAK,CACL,CAAC;YACH,CAAC;YACD,OAAO;QACR,CAAC;QAED,EAAE,CAAC,MAAM,CAAC,cAAc,CACvB;YACC,SAAS,EAAE,2BAA2B;SACtC,EACD,KAAK,CACL,CAAC;QACF,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AA1FD,gEA0FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype FluidLayer,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\n\nimport type { MonitoringContext } from \"./config.js\";\nimport { LayerIncompatibilityError } from \"./error.js\";\n\n/**\n * The config key to disable layer compatibility validation.\n * @internal\n */\nexport const allowIncompatibleLayersKey = \"Fluid.AllowIncompatibleLayers\";\n\n/**\n * Tracks whether the event is logged when failing on layer incompatibility is bypassed via global config.\n * This is used to ensure that the bypass event is only logged once per session so it does not flood telemetry.\n */\nlet globalBypassLogged = false;\n\n/**\n * Tracks whether the event is logged when failing on layer incompatibility is bypassed due to missing\n * compatibility details for each layer pair.\n * This is used to ensure that the bypass event is only logged once per layer pair so it does not flood telemetry.\n */\nconst strictCheckBypassLoggedForPair: Set<string> = new Set<string>();\n\n/**\n * Validates the compatibility between two layers using their compatibility details and support requirements.\n * If the layers are incompatible, it logs a \"LayerIncompatibilityError\" error event. It will also call the dispose\n * function with the error and throw the error.\n * @param layer1 - The name of the first layer.\n * @param layer2 - The name of the second layer.\n * @param compatDetailsLayer1 - The compatibility details of the first layer.\n * @param compatSupportRequirementsLayer1 - The support requirements that the second layer must meet to be compatible\n * with the first layer.\n * @param maybeCompatDetailsLayer2 - The compatibility details of the second layer. This can be undefined if the\n * second layer does not provide compatibility details.\n * @param disposeFn - A function that will be called with the error if the layers are incompatible.\n * @param mc - The monitoring context for logging and reading configuration.\n * @param strictCompatibilityCheck - If true, the function will use default compatibility details for the second layer if\n * they are missing and use it for validation.\n * If false, it will skip the compatibility check if the details are missing and just log an error.\n * Defaults to false.\n *\n * @internal\n */\nexport function validateLayerCompatibility(\n\tlayer1: FluidLayer,\n\tlayer2: FluidLayer,\n\tcompatDetailsLayer1: Pick<ILayerCompatDetails, \"pkgVersion\" | \"generation\">,\n\tcompatSupportRequirementsLayer1: ILayerCompatSupportRequirements,\n\tmaybeCompatDetailsLayer2: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: IErrorBase) => void,\n\tmc: MonitoringContext,\n\tstrictCompatibilityCheck: boolean = false,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tcompatSupportRequirementsLayer1,\n\t\tmaybeCompatDetailsLayer2,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst coreProperties = {\n\t\t\tlayer: layer1,\n\t\t\tincompatibleLayer: layer2,\n\t\t\tlayerVersion: compatDetailsLayer1.pkgVersion,\n\t\t\tincompatibleLayerVersion: maybeCompatDetailsLayer2?.pkgVersion ?? \"unknown\",\n\t\t\tcompatibilityRequirementsInMonths:\n\t\t\t\tcompatDetailsLayer1.generation -\n\t\t\t\tcompatSupportRequirementsLayer1.minSupportedGeneration,\n\t\t\tactualDifferenceInMonths:\n\t\t\t\tcompatDetailsLayer1.generation - (maybeCompatDetailsLayer2?.generation ?? 0),\n\t\t};\n\t\tconst detailedProperties = {\n\t\t\tlayerGeneration: compatDetailsLayer1.generation,\n\t\t\tincompatibleLayerGeneration: maybeCompatDetailsLayer2?.generation,\n\t\t\tminSupportedGeneration: compatSupportRequirementsLayer1.minSupportedGeneration,\n\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t};\n\n\t\tconst error = new LayerIncompatibilityError(\n\t\t\t`The versions of the ${layer1} and ${layer2} are not compatible`,\n\t\t\t{\n\t\t\t\t...coreProperties,\n\t\t\t\tdetails: JSON.stringify(detailedProperties),\n\t\t\t},\n\t\t);\n\n\t\tif (mc.config.getBoolean(allowIncompatibleLayersKey) === true) {\n\t\t\t// If the validation is explicitly disabled via config, do not fail. This config provides a way to bypass\n\t\t\t// compatibility validation while this feature is being rolled out.\n\t\t\tif (!globalBypassLogged) {\n\t\t\t\t// This event is only logged once per session to avoid flooding telemetry.\n\t\t\t\tglobalBypassLogged = true;\n\t\t\t\tmc.logger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"LayerIncompatibilityDetectedButBypassed\",\n\t\t\t\t\t\treason: `${allowIncompatibleLayersKey} config is set to true`,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (maybeCompatDetailsLayer2 === undefined && !strictCompatibilityCheck) {\n\t\t\t// If there is no compatibility details for layer2 and strictCompatibilityCheck is false, do not fail.\n\t\t\t// There can be a couple of scenarios where this can happen:\n\t\t\t// 1. layer2's version is older than the version where compatibility enforcement was introduced. In this\n\t\t\t// case, the behavior is the same as before compatibility enforcement was introduced.\n\t\t\t// 2. layer2 has a custom implementation which doesn't provide compatibility details. In this case,\n\t\t\t// we don't know for sure that it is incompatible. It may fail at a later point when it tries to use\n\t\t\t// some feature that the Runtime doesn't support.\n\t\t\tif (!strictCheckBypassLoggedForPair.has(`${layer1}-${layer2}`)) {\n\t\t\t\t// This event is only logged once per session per layer combination to avoid flooding telemetry.\n\t\t\t\tstrictCheckBypassLoggedForPair.add(`${layer1}-${layer2}`);\n\t\t\t\tmc.logger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"LayerIncompatibilityDetectedButBypassed\",\n\t\t\t\t\t\treason: `No compatibility details provided for ${layer2} and strictCompatibilityCheck is false`,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tmc.logger.sendErrorEvent(\n\t\t\t{\n\t\t\t\teventName: \"LayerIncompatibilityError\",\n\t\t\t},\n\t\t\terror,\n\t\t);\n\t\tdisposeFn(error);\n\t\tthrow error;\n\t}\n}\n"]}

@@ -1,1 +0,1 @@

{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EACN,YAAY,EAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,wBAAwB,GAC9B,OAAO,CAAC,SAAS,CAInB;AAED;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,YAAa,YAAW,aAAa,EAAE,eAAe;aAatE,KAAK,CAAC;IAZvB,SAAgB,SAAS,iBAAgC;IAEzD;;;;;OAKG;gBAEF,OAAO,EAAE,MAAM,EAGC,KAAK,CAAC,KAAK,EAC3B,KAAK,CAAC,EAAE,wBAAwB;CAKjC;AAED;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,YAAa,YAAW,WAAW,EAAE,eAAe;IACnF,SAAgB,SAAS,eAA8B;gBAEpC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,wBAAwB;CAGpE;AAED;;;;;GAKG;AACH,qBA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,CAAC;IACnD,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAQpC,CAAC"}

@@ -5,3 +5,3 @@ /*!

*/
import { FluidErrorTypes, FluidErrorTypesAlpha, } from "@fluidframework/core-interfaces/internal";
import { FluidErrorTypes, } from "@fluidframework/core-interfaces/internal";
import { LoggingError, NORMALIZED_ERROR_TYPE, isExternalError, normalizeError, wrapError, } from "./errorLogging.js";

@@ -162,3 +162,3 @@ /**

});
this.errorType = FluidErrorTypesAlpha.layerIncompatibilityError;
this.errorType = FluidErrorTypes.layerIncompatibilityError;
this.layer = incompatibilityProps.layer;

@@ -165,0 +165,0 @@ this.layerVersion = incompatibilityProps.layerVersion;

@@ -1,1 +0,1 @@

{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,eAAe,EACf,oBAAoB,GAIpB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EACN,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,SAAS,GACT,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;IAG7C;;;;;OAKG;IACH,YACC,OAAe;IACf,mIAAmI;IACnI,iHAAiH;IACjG,KAAW,EAC3B,KAAgC;QAEhC,mCAAmC;QACnC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAJ1B,UAAK,GAAL,KAAK,CAAM;QAZZ,cAAS,GAAG,eAA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BAAoB,CAAC,yBAAyB,CAAC;QA2B1E,IAAI,CAAC,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,oBAAoB,CAAC,YAAY,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC;QAChE,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,iCAAiC;YACrC,oBAAoB,CAAC,iCAAiC,CAAC;QACxD,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAC7C,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC/C,WAUC,EAQA,EAAE,CAAC,CAAC;IACL,eAAe,EAAE,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;IAC9E,qBAAqB,EAAE,WAAW,CAAC,cAAc;IACjD,2BAA2B,EAAE,WAAW,CAAC,oBAAoB;IAC7D,8BAA8B,EAAE,WAAW,CAAC,uBAAuB;IACnE,4BAA4B,EAAE,WAAW,CAAC,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\tFluidErrorTypesAlpha,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: Partial<\n\t\t\tPick<\n\t\t\t\tISequencedDocumentMessage,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"sequenceNumber\"\n\t\t\t\t| \"clientSequenceNumber\"\n\t\t\t\t| \"referenceSequenceNumber\"\n\t\t\t\t| \"minimumSequenceNumber\"\n\t\t\t\t| \"timestamp\"\n\t\t\t>\n\t\t>,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\t\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\t\ttry {\n\t\t\tif (stackTraceLimit !== undefined) {\n\t\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t\t}\n\n\t\t\tconst dataProcessingError = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terrorMessage,\n\t\t\t\tdataProcessingCodepath,\n\t\t\t\tmessageLike,\n\t\t\t);\n\t\t\tdataProcessingError.addTelemetryProperties(props);\n\n\t\t\treturn dataProcessingError;\n\t\t} finally {\n\t\t\t// Reset the stack trace limit to the original value\n\t\t\tif (stackTraceLimit !== undefined) {\n\t\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks\n\t *\n\t * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n\t * one day we will move away from throwing these errors but rather we'll return them.\n\t * But an unrecognized error needs to be classified as `DataProcessingError`.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: Partial<\n\t\t\tPick<\n\t\t\t\tISequencedDocumentMessage,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"sequenceNumber\"\n\t\t\t\t| \"clientSequenceNumber\"\n\t\t\t\t| \"referenceSequenceNumber\"\n\t\t\t\t| \"minimumSequenceNumber\"\n\t\t\t\t| \"timestamp\"\n\t\t\t>\n\t\t>,\n\t): IFluidErrorBase {\n\t\tconst props = {\n\t\t\tdataProcessingError: 1,\n\t\t\tdataProcessingCodepath,\n\t\t\t...(messageLike === undefined\n\t\t\t\t? undefined\n\t\t\t\t: extractSafePropertiesFromMessage(messageLike)),\n\t\t};\n\n\t\tconst normalizedError = normalizeError(originalError, { props });\n\t\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\t\tif (\n\t\t\tisExternalError(normalizedError) ||\n\t\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t\t) {\n\t\t\t// Create a new DataProcessingError to wrap this external error\n\t\t\tconst dataProcessingError = wrapError(\n\t\t\t\tnormalizedError,\n\t\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\t);\n\n\t\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\t\tdataProcessingError.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\t\treturn dataProcessingError;\n\t\t}\n\t\treturn normalizedError;\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypesAlpha.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: Partial<\n\t\tPick<\n\t\t\tISequencedDocumentMessage,\n\t\t\t| \"clientId\"\n\t\t\t| \"sequenceNumber\"\n\t\t\t| \"clientSequenceNumber\"\n\t\t\t| \"referenceSequenceNumber\"\n\t\t\t| \"minimumSequenceNumber\"\n\t\t\t| \"timestamp\"\n\t\t>\n\t>,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,eAAe,GAIf,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EACN,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,SAAS,GACT,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAA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C,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: Partial<\n\t\t\tPick<\n\t\t\t\tISequencedDocumentMessage,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"sequenceNumber\"\n\t\t\t\t| \"clientSequenceNumber\"\n\t\t\t\t| \"referenceSequenceNumber\"\n\t\t\t\t| \"minimumSequenceNumber\"\n\t\t\t\t| \"timestamp\"\n\t\t\t>\n\t\t>,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\t\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\t\ttry {\n\t\t\tif (stackTraceLimit !== undefined) {\n\t\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t\t}\n\n\t\t\tconst dataProcessingError = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terrorMessage,\n\t\t\t\tdataProcessingCodepath,\n\t\t\t\tmessageLike,\n\t\t\t);\n\t\t\tdataProcessingError.addTelemetryProperties(props);\n\n\t\t\treturn dataProcessingError;\n\t\t} finally {\n\t\t\t// Reset the stack trace limit to the original value\n\t\t\tif (stackTraceLimit !== undefined) {\n\t\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks\n\t *\n\t * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n\t * one day we will move away from throwing these errors but rather we'll return them.\n\t * But an unrecognized error needs to be classified as `DataProcessingError`.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: Partial<\n\t\t\tPick<\n\t\t\t\tISequencedDocumentMessage,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"sequenceNumber\"\n\t\t\t\t| \"clientSequenceNumber\"\n\t\t\t\t| \"referenceSequenceNumber\"\n\t\t\t\t| \"minimumSequenceNumber\"\n\t\t\t\t| \"timestamp\"\n\t\t\t>\n\t\t>,\n\t): IFluidErrorBase {\n\t\tconst props = {\n\t\t\tdataProcessingError: 1,\n\t\t\tdataProcessingCodepath,\n\t\t\t...(messageLike === undefined\n\t\t\t\t? undefined\n\t\t\t\t: extractSafePropertiesFromMessage(messageLike)),\n\t\t};\n\n\t\tconst normalizedError = normalizeError(originalError, { props });\n\t\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\t\tif (\n\t\t\tisExternalError(normalizedError) ||\n\t\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t\t) {\n\t\t\t// Create a new DataProcessingError to wrap this external error\n\t\t\tconst dataProcessingError = wrapError(\n\t\t\t\tnormalizedError,\n\t\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\t);\n\n\t\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\t\tdataProcessingError.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\t\treturn dataProcessingError;\n\t\t}\n\t\treturn normalizedError;\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: Partial<\n\t\tPick<\n\t\t\tISequencedDocumentMessage,\n\t\t\t| \"clientId\"\n\t\t\t| \"sequenceNumber\"\n\t\t\t| \"clientSequenceNumber\"\n\t\t\t| \"referenceSequenceNumber\"\n\t\t\t| \"minimumSequenceNumber\"\n\t\t\t| \"timestamp\"\n\t\t>\n\t>,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}

@@ -1,1 +0,1 @@

{"version":3,"file":"fluidErrorBase.d.ts","sourceRoot":"","sources":["../src/fluidErrorBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;IAEnD;;OAEG;IACH,sBAAsB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACjE;AAMD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAO,OAAO;qBAA2B,MAAM;CACG,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAOrE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,0BAA0B,CAIrC"}
{"version":3,"file":"fluidErrorBase.d.ts","sourceRoot":"","sources":["../src/fluidErrorBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;IAEnD;;OAEG;IACH,sBAAsB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACjE;AAMD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAO,OAAO;qBAA2B,MAAM;CACG,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAOrE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,0BAA0B,CAErC"}

@@ -5,3 +5,3 @@ /*!

*/
import { FluidErrorTypesAlpha, } from "@fluidframework/core-interfaces/internal";
import { FluidErrorTypes, } from "@fluidframework/core-interfaces/internal";
const hasTelemetryPropFunctions = (x) => typeof x?.getTelemetryProperties === "function" &&

@@ -32,4 +32,4 @@ typeof x?.addTelemetryProperties === "function";

export function isLayerIncompatibilityError(error) {
return (isFluidError(error) && error.errorType === FluidErrorTypesAlpha.layerIncompatibilityError);
return isFluidError(error) && error.errorType === FluidErrorTypes.layerIncompatibilityError;
}
//# sourceMappingURL=fluidErrorBase.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"fluidErrorBase.js","sourceRoot":"","sources":["../src/fluidErrorBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,oBAAoB,GAEpB,MAAM,0CAA0C,CAAC;AAkFlD,MAAM,yBAAyB,GAAG,CAAC,CAAU,EAAW,EAAE,CACzD,OAAQ,CAA8B,EAAE,sBAAsB,KAAK,UAAU;IAC7E,OAAQ,CAA8B,EAAE,sBAAsB,KAAK,UAAU,CAAC;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAU,EAAoC,EAAE,CAClF,OAAQ,CAA0C,EAAE,eAAe,KAAK,QAAQ,CAAC;AAElF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,CACN,OAAQ,KAAkC,EAAE,SAAS,KAAK,QAAQ;QAClE,OAAQ,KAAkC,EAAE,OAAO,KAAK,QAAQ;QAChE,kBAAkB,CAAC,KAAK,CAAC;QACzB,yBAAyB,CAAC,KAAK,CAAC,CAChC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAC1C,KAAc;IAEd,OAAO,CACN,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,SAAS,KAAK,oBAAoB,CAAC,yBAAyB,CACzF,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypesAlpha,\n\ttype ILayerIncompatibilityError,\n} from \"@fluidframework/core-interfaces/internal\";\n\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * An error emitted by the Fluid Framework.\n *\n * @remarks\n *\n * All normalized errors flowing through the Fluid Framework adhere to this readonly interface.\n *\n * It features the members of {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}\n * made readonly, as well as {@link IFluidErrorBase.errorType} and {@link IFluidErrorBase.errorInstanceId}.\n * It also features getters and setters for telemetry props to be included when the error is logged.\n *\n * @internal\n */\nexport interface IFluidErrorBase extends Error {\n\t/**\n\t * Classification of what type of error this is.\n\t *\n\t * @remarks Used programmatically by consumers to interpret the error.\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * Error's message property, made readonly.\n\t *\n\t * @remarks\n\t *\n\t * Recommendations:\n\t *\n\t * Be specific, but also take care when including variable data to consider suitability for aggregation in telemetry.\n\t * Also avoid including any data that jeopardizes the user's privacy. Add a tagged telemetry property instead.\n\t */\n\treadonly message: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack}.\n\t */\n\treadonly stack?: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name}.\n\t */\n\treadonly name: string;\n\n\t/**\n\t * A Guid identifying this error instance.\n\t *\n\t * @remarks\n\t *\n\t * Useful in telemetry for deduplicating multiple logging events arising from the same error,\n\t * or correlating an error with an inner error that caused it, in case of error wrapping.\n\t */\n\treadonly errorInstanceId: string;\n\n\t/**\n\t * When present, inner error that caused this error.\n\t *\n\t * @remarks\n\t * This will often be an {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error|Error}, but could be any type.\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause\n\t *\n\t * @privateRemarks\n\t * The \"cause\" field is added in ES2022. Using it even without that built-in support, is still helpful.\n\t * TODO: remove this declaration (use `Error.cause` property) when targeting ES2022 lib or later.\n\t */\n\tcause?: unknown;\n\n\t/**\n\t * Get the telemetry properties stashed on this error for logging.\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n\n\t/**\n\t * Add telemetry properties to this error which will be logged with the error\n\t */\n\taddTelemetryProperties: (props: ITelemetryPropertiesExt) => void;\n}\n\nconst hasTelemetryPropFunctions = (x: unknown): boolean =>\n\ttypeof (x as Partial<IFluidErrorBase>)?.getTelemetryProperties === \"function\" &&\n\ttypeof (x as Partial<IFluidErrorBase>)?.addTelemetryProperties === \"function\";\n\n/**\n * Type guard for error data containing the {@link IFluidErrorBase.errorInstanceId} property.\n *\n * @internal\n */\nexport const hasErrorInstanceId = (x: unknown): x is { errorInstanceId: string } =>\n\ttypeof (x as Partial<{ errorInstanceId: string }>)?.errorInstanceId === \"string\";\n\n/**\n * Type guard for {@link IFluidErrorBase}.\n *\n * @internal\n */\nexport function isFluidError(error: unknown): error is IFluidErrorBase {\n\treturn (\n\t\ttypeof (error as Partial<IFluidErrorBase>)?.errorType === \"string\" &&\n\t\ttypeof (error as Partial<IFluidErrorBase>)?.message === \"string\" &&\n\t\thasErrorInstanceId(error) &&\n\t\thasTelemetryPropFunctions(error)\n\t);\n}\n\n/**\n * Helper that returns whether the provided error is a layer incompatibility error.\n *\n * @internal\n */\nexport function isLayerIncompatibilityError(\n\terror: unknown,\n): error is ILayerIncompatibilityError {\n\treturn (\n\t\tisFluidError(error) && error.errorType === FluidErrorTypesAlpha.layerIncompatibilityError\n\t);\n}\n"]}
{"version":3,"file":"fluidErrorBase.js","sourceRoot":"","sources":["../src/fluidErrorBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,eAAe,GAEf,MAAM,0CAA0C,CAAC;AAkFlD,MAAM,yBAAyB,GAAG,CAAC,CAAU,EAAW,EAAE,CACzD,OAAQ,CAA8B,EAAE,sBAAsB,KAAK,UAAU;IAC7E,OAAQ,CAA8B,EAAE,sBAAsB,KAAK,UAAU,CAAC;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAU,EAAoC,EAAE,CAClF,OAAQ,CAA0C,EAAE,eAAe,KAAK,QAAQ,CAAC;AAElF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,CACN,OAAQ,KAAkC,EAAE,SAAS,KAAK,QAAQ;QAClE,OAAQ,KAAkC,EAAE,OAAO,KAAK,QAAQ;QAChE,kBAAkB,CAAC,KAAK,CAAC;QACzB,yBAAyB,CAAC,KAAK,CAAC,CAChC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAC1C,KAAc;IAEd,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,SAAS,KAAK,eAAe,CAAC,yBAAyB,CAAC;AAC7F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype ILayerIncompatibilityError,\n} from \"@fluidframework/core-interfaces/internal\";\n\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * An error emitted by the Fluid Framework.\n *\n * @remarks\n *\n * All normalized errors flowing through the Fluid Framework adhere to this readonly interface.\n *\n * It features the members of {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}\n * made readonly, as well as {@link IFluidErrorBase.errorType} and {@link IFluidErrorBase.errorInstanceId}.\n * It also features getters and setters for telemetry props to be included when the error is logged.\n *\n * @internal\n */\nexport interface IFluidErrorBase extends Error {\n\t/**\n\t * Classification of what type of error this is.\n\t *\n\t * @remarks Used programmatically by consumers to interpret the error.\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * Error's message property, made readonly.\n\t *\n\t * @remarks\n\t *\n\t * Recommendations:\n\t *\n\t * Be specific, but also take care when including variable data to consider suitability for aggregation in telemetry.\n\t * Also avoid including any data that jeopardizes the user's privacy. Add a tagged telemetry property instead.\n\t */\n\treadonly message: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack}.\n\t */\n\treadonly stack?: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name}.\n\t */\n\treadonly name: string;\n\n\t/**\n\t * A Guid identifying this error instance.\n\t *\n\t * @remarks\n\t *\n\t * Useful in telemetry for deduplicating multiple logging events arising from the same error,\n\t * or correlating an error with an inner error that caused it, in case of error wrapping.\n\t */\n\treadonly errorInstanceId: string;\n\n\t/**\n\t * When present, inner error that caused this error.\n\t *\n\t * @remarks\n\t * This will often be an {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error|Error}, but could be any type.\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause\n\t *\n\t * @privateRemarks\n\t * The \"cause\" field is added in ES2022. Using it even without that built-in support, is still helpful.\n\t * TODO: remove this declaration (use `Error.cause` property) when targeting ES2022 lib or later.\n\t */\n\tcause?: unknown;\n\n\t/**\n\t * Get the telemetry properties stashed on this error for logging.\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n\n\t/**\n\t * Add telemetry properties to this error which will be logged with the error\n\t */\n\taddTelemetryProperties: (props: ITelemetryPropertiesExt) => void;\n}\n\nconst hasTelemetryPropFunctions = (x: unknown): boolean =>\n\ttypeof (x as Partial<IFluidErrorBase>)?.getTelemetryProperties === \"function\" &&\n\ttypeof (x as Partial<IFluidErrorBase>)?.addTelemetryProperties === \"function\";\n\n/**\n * Type guard for error data containing the {@link IFluidErrorBase.errorInstanceId} property.\n *\n * @internal\n */\nexport const hasErrorInstanceId = (x: unknown): x is { errorInstanceId: string } =>\n\ttypeof (x as Partial<{ errorInstanceId: string }>)?.errorInstanceId === \"string\";\n\n/**\n * Type guard for {@link IFluidErrorBase}.\n *\n * @internal\n */\nexport function isFluidError(error: unknown): error is IFluidErrorBase {\n\treturn (\n\t\ttypeof (error as Partial<IFluidErrorBase>)?.errorType === \"string\" &&\n\t\ttypeof (error as Partial<IFluidErrorBase>)?.message === \"string\" &&\n\t\thasErrorInstanceId(error) &&\n\t\thasTelemetryPropFunctions(error)\n\t);\n}\n\n/**\n * Helper that returns whether the provided error is a layer incompatibility error.\n *\n * @internal\n */\nexport function isLayerIncompatibilityError(\n\terror: unknown,\n): error is ILayerIncompatibilityError {\n\treturn isFluidError(error) && error.errorType === FluidErrorTypes.layerIncompatibilityError;\n}\n"]}

@@ -18,3 +18,3 @@ /*!

export { TelemetryEventBatcher } from "./telemetryEventBatcher.js";
export { validateLayerCompatibility } from "./layerCompatError.js";
export { allowIncompatibleLayersKey, validateLayerCompatibility } from "./layerCompatError.js";
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,4BAA4B,EAC5B,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,KAAK,eAAe,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,KAAK,mBAAmB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,yBAAyB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,eAAe,EACf,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kBAAkB,EAClB,KAAK,eAAe,EACpB,YAAY,EACZ,2BAA2B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,2BAA2B,GAChC,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,KAAK,cAAc,EACnB,UAAU,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,sBAAsB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,OAAO,GACP,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,6BAA6B,EAC7B,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,4BAA4B,EAC5B,KAAK,i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ACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,OAAO,GACP,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,6BAA6B,EAC7B,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC"}

@@ -17,3 +17,3 @@ /*!

export { TelemetryEventBatcher } from "./telemetryEventBatcher.js";
export { validateLayerCompatibility } from "./layerCompatError.js";
export { allowIncompatibleLayersKey, validateLayerCompatibility } from "./layerCompatError.js";
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,4BAA4B,EAE5B,4BAA4B,EAC5B,sBAAsB,EAEtB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,GAE7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,yBAAyB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EAEnB,eAAe,EACf,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kBAAkB,EAElB,YAAY,EACZ,2BAA2B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EAKV,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,gBAAgB,EAChB,gBAAgB,GAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EAEnB,UAAU,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,sBAAsB,GAItB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,mBAAmB,EAGnB,OAAO,GACP,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateChildMonitoringContext,\n\ttype MonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\ttype IConfigProvider,\n\tloggerToMonitoringContext,\n\twrapConfigProviderWithDefaults,\n\tcreateConfigBasedOptionsProxy,\n\ttype OptionConfigReaders,\n} from \"./config.js\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n\tLayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\ttype IFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging.js\";\nexport { EventEmitterWithErrorHandling } from \"./eventEmitterWithErrorHandling.js\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events.js\";\nexport {\n\thasErrorInstanceId,\n\ttype IFluidErrorBase,\n\tisFluidError,\n\tisLayerIncompatibilityError,\n} from \"./fluidErrorBase.js\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\tformatTick,\n\ttype IPerformanceEventMarkers,\n\ttype ITelemetryLoggerPropertyBag,\n\ttype ITelemetryLoggerPropertyBags,\n\ttype MultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\ttype TelemetryEventPropertyTypes,\n} from \"./logger.js\";\nexport {\n\tcreateMockLoggerExt,\n\ttype IMockLoggerExt,\n\tMockLogger,\n} from \"./mockLogger.js\";\nexport { ThresholdCounter } from \"./thresholdCounter.js\";\nexport {\n\tSampledTelemetryHelper,\n\ttype CustomMetrics,\n\ttype ICustomData,\n\ttype MeasureReturnType,\n} from \"./sampledTelemetryHelper.js\";\nexport {\n\tcreateSampledLogger,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\tmeasure,\n} from \"./utils.js\";\nexport type {\n\tTelemetryEventPropertyTypeExt,\n\tITelemetryEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tITelemetryLoggerExt,\n\tITelemetryPropertiesExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypes.js\";\nexport { TelemetryEventBatcher } from \"./telemetryEventBatcher.js\";\nexport { validateLayerCompatibility } from \"./layerCompatError.js\";\n"]}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;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Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateChildMonitoringContext,\n\ttype MonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\ttype IConfigProvider,\n\tloggerToMonitoringContext,\n\twrapConfigProviderWithDefaults,\n\tcreateConfigBasedOptionsProxy,\n\ttype OptionConfigReaders,\n} from \"./config.js\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n\tLayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\ttype IFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging.js\";\nexport { EventEmitterWithErrorHandling } from \"./eventEmitterWithErrorHandling.js\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events.js\";\nexport {\n\thasErrorInstanceId,\n\ttype IFluidErrorBase,\n\tisFluidError,\n\tisLayerIncompatibilityError,\n} from \"./fluidErrorBase.js\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\tformatTick,\n\ttype IPerformanceEventMarkers,\n\ttype ITelemetryLoggerPropertyBag,\n\ttype ITelemetryLoggerPropertyBags,\n\ttype MultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\ttype TelemetryEventPropertyTypes,\n} from \"./logger.js\";\nexport {\n\tcreateMockLoggerExt,\n\ttype IMockLoggerExt,\n\tMockLogger,\n} from \"./mockLogger.js\";\nexport { ThresholdCounter } from \"./thresholdCounter.js\";\nexport {\n\tSampledTelemetryHelper,\n\ttype CustomMetrics,\n\ttype ICustomData,\n\ttype MeasureReturnType,\n} from \"./sampledTelemetryHelper.js\";\nexport {\n\tcreateSampledLogger,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\tmeasure,\n} from \"./utils.js\";\nexport type {\n\tTelemetryEventPropertyTypeExt,\n\tITelemetryEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tITelemetryLoggerExt,\n\tITelemetryPropertiesExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypes.js\";\nexport { TelemetryEventBatcher } from \"./telemetryEventBatcher.js\";\nexport { allowIncompatibleLayersKey, validateLayerCompatibility } from \"./layerCompatError.js\";\n"]}

@@ -7,11 +7,29 @@ /*!

import type { IErrorBase } from "@fluidframework/core-interfaces";
import type { ITelemetryLoggerExt } from "./telemetryTypes.js";
import type { MonitoringContext } from "./config.js";
/**
* The config key to disable layer compatibility validation.
* @internal
*/
export declare const allowIncompatibleLayersKey = "Fluid.AllowIncompatibleLayers";
/**
* Validates the compatibility between two layers using their compatibility details and support requirements.
* If the layers are incompatible, it logs an "LayerIncompatibilityError" error event. It will also call the dispose
* If the layers are incompatible, it logs a "LayerIncompatibilityError" error event. It will also call the dispose
* function with the error and throw the error.
* @param layer1 - The name of the first layer.
* @param layer2 - The name of the second layer.
* @param compatDetailsLayer1 - The compatibility details of the first layer.
* @param compatSupportRequirementsLayer1 - The support requirements that the second layer must meet to be compatible
* with the first layer.
* @param maybeCompatDetailsLayer2 - The compatibility details of the second layer. This can be undefined if the
* second layer does not provide compatibility details.
* @param disposeFn - A function that will be called with the error if the layers are incompatible.
* @param mc - The monitoring context for logging and reading configuration.
* @param strictCompatibilityCheck - If true, the function will use default compatibility details for the second layer if
* they are missing and use it for validation.
* If false, it will skip the compatibility check if the details are missing and just log an error.
* Defaults to false.
*
* @internal
*/
export declare function validateLayerCompatibility(layer1: FluidLayer, layer2: FluidLayer, compatDetailsLayer1: Pick<ILayerCompatDetails, "pkgVersion" | "generation">, compatSupportRequirementsLayer1: ILayerCompatSupportRequirements, maybeCompatDetailsLayer2: ILayerCompatDetails | undefined, disposeFn: (error?: IErrorBase) => void, logger: ITelemetryLoggerExt): void;
export declare function validateLayerCompatibility(layer1: FluidLayer, layer2: FluidLayer, compatDetailsLayer1: Pick<ILayerCompatDetails, "pkgVersion" | "generation">, compatSupportRequirementsLayer1: ILayerCompatSupportRequirements, maybeCompatDetailsLayer2: ILayerCompatDetails | undefined, disposeFn: (error?: IErrorBase) => void, mc: MonitoringContext, strictCompatibilityCheck?: boolean): void;
//# sourceMappingURL=layerCompatError.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"layerCompatError.d.ts","sourceRoot":"","sources":["../src/layerCompatError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,YAAY,CAAC,EAC3E,+BAA+B,EAAE,+BAA+B,EAChE,wBAAwB,EAAE,mBAAmB,GAAG,SAAS,EACzD,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,EACvC,MAAM,EAAE,mBAAmB,GACzB,IAAI,CAyCN"}
{"version":3,"file":"layerCompatError.d.ts","sourceRoot":"","sources":["../src/layerCompatError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,kCAAkC,CAAC;AAe1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,YAAY,CAAC,EAC3E,+BAA+B,EAAE,+BAA+B,EAChE,wBAAwB,EAAE,mBAAmB,GAAG,SAAS,EACzD,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,EACvC,EAAE,EAAE,iBAAiB,EACrB,wBAAwB,GAAE,OAAe,GACvC,IAAI,CAiFN"}

@@ -8,9 +8,38 @@ /*!

/**
* The config key to disable layer compatibility validation.
* @internal
*/
export const allowIncompatibleLayersKey = "Fluid.AllowIncompatibleLayers";
/**
* Tracks whether the event is logged when failing on layer incompatibility is bypassed via global config.
* This is used to ensure that the bypass event is only logged once per session so it does not flood telemetry.
*/
let globalBypassLogged = false;
/**
* Tracks whether the event is logged when failing on layer incompatibility is bypassed due to missing
* compatibility details for each layer pair.
* This is used to ensure that the bypass event is only logged once per layer pair so it does not flood telemetry.
*/
const strictCheckBypassLoggedForPair = new Set();
/**
* Validates the compatibility between two layers using their compatibility details and support requirements.
* If the layers are incompatible, it logs an "LayerIncompatibilityError" error event. It will also call the dispose
* If the layers are incompatible, it logs a "LayerIncompatibilityError" error event. It will also call the dispose
* function with the error and throw the error.
* @param layer1 - The name of the first layer.
* @param layer2 - The name of the second layer.
* @param compatDetailsLayer1 - The compatibility details of the first layer.
* @param compatSupportRequirementsLayer1 - The support requirements that the second layer must meet to be compatible
* with the first layer.
* @param maybeCompatDetailsLayer2 - The compatibility details of the second layer. This can be undefined if the
* second layer does not provide compatibility details.
* @param disposeFn - A function that will be called with the error if the layers are incompatible.
* @param mc - The monitoring context for logging and reading configuration.
* @param strictCompatibilityCheck - If true, the function will use default compatibility details for the second layer if
* they are missing and use it for validation.
* If false, it will skip the compatibility check if the details are missing and just log an error.
* Defaults to false.
*
* @internal
*/
export function validateLayerCompatibility(layer1, layer2, compatDetailsLayer1, compatSupportRequirementsLayer1, maybeCompatDetailsLayer2, disposeFn, logger) {
export function validateLayerCompatibility(layer1, layer2, compatDetailsLayer1, compatSupportRequirementsLayer1, maybeCompatDetailsLayer2, disposeFn, mc, strictCompatibilityCheck = false) {
const layerCheckResult = checkLayerCompatibility(compatSupportRequirementsLayer1, maybeCompatDetailsLayer2);

@@ -38,3 +67,34 @@ if (!layerCheckResult.isCompatible) {

});
logger.sendErrorEvent({
if (mc.config.getBoolean(allowIncompatibleLayersKey) === true) {
// If the validation is explicitly disabled via config, do not fail. This config provides a way to bypass
// compatibility validation while this feature is being rolled out.
if (!globalBypassLogged) {
// This event is only logged once per session to avoid flooding telemetry.
globalBypassLogged = true;
mc.logger.sendTelemetryEvent({
eventName: "LayerIncompatibilityDetectedButBypassed",
reason: `${allowIncompatibleLayersKey} config is set to true`,
}, error);
}
return;
}
if (maybeCompatDetailsLayer2 === undefined && !strictCompatibilityCheck) {
// If there is no compatibility details for layer2 and strictCompatibilityCheck is false, do not fail.
// There can be a couple of scenarios where this can happen:
// 1. layer2's version is older than the version where compatibility enforcement was introduced. In this
// case, the behavior is the same as before compatibility enforcement was introduced.
// 2. layer2 has a custom implementation which doesn't provide compatibility details. In this case,
// we don't know for sure that it is incompatible. It may fail at a later point when it tries to use
// some feature that the Runtime doesn't support.
if (!strictCheckBypassLoggedForPair.has(`${layer1}-${layer2}`)) {
// This event is only logged once per session per layer combination to avoid flooding telemetry.
strictCheckBypassLoggedForPair.add(`${layer1}-${layer2}`);
mc.logger.sendTelemetryEvent({
eventName: "LayerIncompatibilityDetectedButBypassed",
reason: `No compatibility details provided for ${layer2} and strictCompatibilityCheck is false`,
}, error);
}
return;
}
mc.logger.sendErrorEvent({
eventName: "LayerIncompatibilityError",

@@ -41,0 +101,0 @@ }, error);

@@ -1,1 +0,1 @@

{"version":3,"file":"layerCompatError.js","sourceRoot":"","sources":["../src/layerCompatError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,uBAAuB,GAIvB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAGvD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACzC,MAAkB,EAClB,MAAkB,EAClB,mBAA2E,EAC3E,+BAAgE,EAChE,wBAAyD,EACzD,SAAuC,EACvC,MAA2B;IAE3B,MAAM,gBAAgB,GAAG,uBAAuB,CAC/C,+BAA+B,EAC/B,wBAAwB,CACxB,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,cAAc,GAAG;YACtB,KAAK,EAAE,MAAM;YACb,iBAAiB,EAAE,MAAM;YACzB,YAAY,EAAE,mBAAmB,CAAC,UAAU;YAC5C,wBAAwB,EAAE,wBAAwB,EAAE,UAAU,IAAI,SAAS;YAC3E,iCAAiC,EAChC,mBAAmB,CAAC,UAAU;gBAC9B,+BAA+B,CAAC,sBAAsB;YACvD,wBAAwB,EACvB,mBAAmB,CAAC,UAAU,GAAG,CAAC,wBAAwB,EAAE,UAAU,IAAI,CAAC,CAAC;SAC7E,CAAC;QACF,MAAM,kBAAkB,GAAG;YAC1B,eAAe,EAAE,mBAAmB,CAAC,UAAU;YAC/C,2BAA2B,EAAE,wBAAwB,EAAE,UAAU;YACjE,sBAAsB,EAAE,+BAA+B,CAAC,sBAAsB;YAC9E,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB;YAC/D,mBAAmB,EAAE,gBAAgB,CAAC,mBAAmB;SACzD,CAAC;QAEF,MAAM,KAAK,GAAG,IAAI,yBAAyB,CAC1C,uBAAuB,MAAM,QAAQ,MAAM,qBAAqB,EAChE;YACC,GAAG,cAAc;YACjB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC;SAC3C,CACD,CAAC;QACF,MAAM,CAAC,cAAc,CACpB;YACC,SAAS,EAAE,2BAA2B;SACtC,EACD,KAAK,CACL,CAAC;QACF,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype FluidLayer,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\n\nimport { LayerIncompatibilityError } from \"./error.js\";\nimport type { ITelemetryLoggerExt } from \"./telemetryTypes.js\";\n\n/**\n * Validates the compatibility between two layers using their compatibility details and support requirements.\n * If the layers are incompatible, it logs an \"LayerIncompatibilityError\" error event. It will also call the dispose\n * function with the error and throw the error.\n *\n * @internal\n */\nexport function validateLayerCompatibility(\n\tlayer1: FluidLayer,\n\tlayer2: FluidLayer,\n\tcompatDetailsLayer1: Pick<ILayerCompatDetails, \"pkgVersion\" | \"generation\">,\n\tcompatSupportRequirementsLayer1: ILayerCompatSupportRequirements,\n\tmaybeCompatDetailsLayer2: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: IErrorBase) => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tcompatSupportRequirementsLayer1,\n\t\tmaybeCompatDetailsLayer2,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst coreProperties = {\n\t\t\tlayer: layer1,\n\t\t\tincompatibleLayer: layer2,\n\t\t\tlayerVersion: compatDetailsLayer1.pkgVersion,\n\t\t\tincompatibleLayerVersion: maybeCompatDetailsLayer2?.pkgVersion ?? \"unknown\",\n\t\t\tcompatibilityRequirementsInMonths:\n\t\t\t\tcompatDetailsLayer1.generation -\n\t\t\t\tcompatSupportRequirementsLayer1.minSupportedGeneration,\n\t\t\tactualDifferenceInMonths:\n\t\t\t\tcompatDetailsLayer1.generation - (maybeCompatDetailsLayer2?.generation ?? 0),\n\t\t};\n\t\tconst detailedProperties = {\n\t\t\tlayerGeneration: compatDetailsLayer1.generation,\n\t\t\tincompatibleLayerGeneration: maybeCompatDetailsLayer2?.generation,\n\t\t\tminSupportedGeneration: compatSupportRequirementsLayer1.minSupportedGeneration,\n\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t};\n\n\t\tconst error = new LayerIncompatibilityError(\n\t\t\t`The versions of the ${layer1} and ${layer2} are not compatible`,\n\t\t\t{\n\t\t\t\t...coreProperties,\n\t\t\t\tdetails: JSON.stringify(detailedProperties),\n\t\t\t},\n\t\t);\n\t\tlogger.sendErrorEvent(\n\t\t\t{\n\t\t\t\teventName: \"LayerIncompatibilityError\",\n\t\t\t},\n\t\t\terror,\n\t\t);\n\t\tdisposeFn(error);\n\t\tthrow error;\n\t}\n}\n"]}
{"version":3,"file":"layerCompatError.js","sourceRoot":"","sources":["../src/layerCompatError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,uBAAuB,GAIvB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,+BAA+B,CAAC;AAE1E;;;GAGG;AACH,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAE/B;;;;GAIG;AACH,MAAM,8BAA8B,GAAgB,IAAI,GAAG,EAAU,CAAC;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CAAC;gBACzB,0EAA0E;gBAC1E,kBAAkB,GAAG,IAAI,CAAC;gBAC1B,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAC3B;oBACC,SAAS,EAAE,yCAAyC;oBACpD,MAAM,EAAE,GAAG,0BAA0B,wBAAwB;iBAC7D,EACD,KAAK,CACL,CAAC;YACH,CAAC;YACD,OAAO;QACR,CAAC;QAED,IAAI,wBAAwB,KAAK,SAAS,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACzE,sGAAsG;YACtG,4DAA4D;YAC5D,wGAAwG;YACxG,wFAAwF;YACxF,mGAAmG;YACnG,uGAAuG;YACvG,oDAAoD;YACpD,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC,EAAE,CAAC;gBAChE,gGAAgG;gBAChG,8BAA8B,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC,CAAC;gBAC1D,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAC3B;oBACC,SAAS,EAAE,yCAAyC;oBACpD,MAAM,EAAE,yCAAyC,MAAM,wCAAwC;iBAC/F,EACD,KAAK,CACL,CAAC;YACH,CAAC;YACD,OAAO;QACR,CAAC;QAED,EAAE,CAAC,MAAM,CAAC,cAAc,CACvB;YACC,SAAS,EAAE,2BAA2B;SACtC,EACD,KAAK,CACL,CAAC;QACF,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype FluidLayer,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\n\nimport type { MonitoringContext } from \"./config.js\";\nimport { LayerIncompatibilityError } from \"./error.js\";\n\n/**\n * The config key to disable layer compatibility validation.\n * @internal\n */\nexport const allowIncompatibleLayersKey = \"Fluid.AllowIncompatibleLayers\";\n\n/**\n * Tracks whether the event is logged when failing on layer incompatibility is bypassed via global config.\n * This is used to ensure that the bypass event is only logged once per session so it does not flood telemetry.\n */\nlet globalBypassLogged = false;\n\n/**\n * Tracks whether the event is logged when failing on layer incompatibility is bypassed due to missing\n * compatibility details for each layer pair.\n * This is used to ensure that the bypass event is only logged once per layer pair so it does not flood telemetry.\n */\nconst strictCheckBypassLoggedForPair: Set<string> = new Set<string>();\n\n/**\n * Validates the compatibility between two layers using their compatibility details and support requirements.\n * If the layers are incompatible, it logs a \"LayerIncompatibilityError\" error event. It will also call the dispose\n * function with the error and throw the error.\n * @param layer1 - The name of the first layer.\n * @param layer2 - The name of the second layer.\n * @param compatDetailsLayer1 - The compatibility details of the first layer.\n * @param compatSupportRequirementsLayer1 - The support requirements that the second layer must meet to be compatible\n * with the first layer.\n * @param maybeCompatDetailsLayer2 - The compatibility details of the second layer. This can be undefined if the\n * second layer does not provide compatibility details.\n * @param disposeFn - A function that will be called with the error if the layers are incompatible.\n * @param mc - The monitoring context for logging and reading configuration.\n * @param strictCompatibilityCheck - If true, the function will use default compatibility details for the second layer if\n * they are missing and use it for validation.\n * If false, it will skip the compatibility check if the details are missing and just log an error.\n * Defaults to false.\n *\n * @internal\n */\nexport function validateLayerCompatibility(\n\tlayer1: FluidLayer,\n\tlayer2: FluidLayer,\n\tcompatDetailsLayer1: Pick<ILayerCompatDetails, \"pkgVersion\" | \"generation\">,\n\tcompatSupportRequirementsLayer1: ILayerCompatSupportRequirements,\n\tmaybeCompatDetailsLayer2: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: IErrorBase) => void,\n\tmc: MonitoringContext,\n\tstrictCompatibilityCheck: boolean = false,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tcompatSupportRequirementsLayer1,\n\t\tmaybeCompatDetailsLayer2,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst coreProperties = {\n\t\t\tlayer: layer1,\n\t\t\tincompatibleLayer: layer2,\n\t\t\tlayerVersion: compatDetailsLayer1.pkgVersion,\n\t\t\tincompatibleLayerVersion: maybeCompatDetailsLayer2?.pkgVersion ?? \"unknown\",\n\t\t\tcompatibilityRequirementsInMonths:\n\t\t\t\tcompatDetailsLayer1.generation -\n\t\t\t\tcompatSupportRequirementsLayer1.minSupportedGeneration,\n\t\t\tactualDifferenceInMonths:\n\t\t\t\tcompatDetailsLayer1.generation - (maybeCompatDetailsLayer2?.generation ?? 0),\n\t\t};\n\t\tconst detailedProperties = {\n\t\t\tlayerGeneration: compatDetailsLayer1.generation,\n\t\t\tincompatibleLayerGeneration: maybeCompatDetailsLayer2?.generation,\n\t\t\tminSupportedGeneration: compatSupportRequirementsLayer1.minSupportedGeneration,\n\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t};\n\n\t\tconst error = new LayerIncompatibilityError(\n\t\t\t`The versions of the ${layer1} and ${layer2} are not compatible`,\n\t\t\t{\n\t\t\t\t...coreProperties,\n\t\t\t\tdetails: JSON.stringify(detailedProperties),\n\t\t\t},\n\t\t);\n\n\t\tif (mc.config.getBoolean(allowIncompatibleLayersKey) === true) {\n\t\t\t// If the validation is explicitly disabled via config, do not fail. This config provides a way to bypass\n\t\t\t// compatibility validation while this feature is being rolled out.\n\t\t\tif (!globalBypassLogged) {\n\t\t\t\t// This event is only logged once per session to avoid flooding telemetry.\n\t\t\t\tglobalBypassLogged = true;\n\t\t\t\tmc.logger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"LayerIncompatibilityDetectedButBypassed\",\n\t\t\t\t\t\treason: `${allowIncompatibleLayersKey} config is set to true`,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (maybeCompatDetailsLayer2 === undefined && !strictCompatibilityCheck) {\n\t\t\t// If there is no compatibility details for layer2 and strictCompatibilityCheck is false, do not fail.\n\t\t\t// There can be a couple of scenarios where this can happen:\n\t\t\t// 1. layer2's version is older than the version where compatibility enforcement was introduced. In this\n\t\t\t// case, the behavior is the same as before compatibility enforcement was introduced.\n\t\t\t// 2. layer2 has a custom implementation which doesn't provide compatibility details. In this case,\n\t\t\t// we don't know for sure that it is incompatible. It may fail at a later point when it tries to use\n\t\t\t// some feature that the Runtime doesn't support.\n\t\t\tif (!strictCheckBypassLoggedForPair.has(`${layer1}-${layer2}`)) {\n\t\t\t\t// This event is only logged once per session per layer combination to avoid flooding telemetry.\n\t\t\t\tstrictCheckBypassLoggedForPair.add(`${layer1}-${layer2}`);\n\t\t\t\tmc.logger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"LayerIncompatibilityDetectedButBypassed\",\n\t\t\t\t\t\treason: `No compatibility details provided for ${layer2} and strictCompatibilityCheck is false`,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tmc.logger.sendErrorEvent(\n\t\t\t{\n\t\t\t\teventName: \"LayerIncompatibilityError\",\n\t\t\t},\n\t\t\terror,\n\t\t);\n\t\tdisposeFn(error);\n\t\tthrow error;\n\t}\n}\n"]}
{
"name": "@fluidframework/telemetry-utils",
"version": "2.74.0",
"version": "2.80.0",
"description": "Collection of telemetry relates utilities for Fluid",

@@ -72,6 +72,6 @@ "homepage": "https://fluidframework.com",

"dependencies": {
"@fluid-internal/client-utils": "~2.74.0",
"@fluidframework/core-interfaces": "~2.74.0",
"@fluidframework/core-utils": "~2.74.0",
"@fluidframework/driver-definitions": "~2.74.0",
"@fluid-internal/client-utils": "~2.80.0",
"@fluidframework/core-interfaces": "~2.80.0",
"@fluidframework/core-utils": "~2.80.0",
"@fluidframework/driver-definitions": "~2.80.0",
"debug": "^4.3.4",

@@ -81,10 +81,10 @@ "uuid": "^11.1.0"

"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@arethetypeswrong/cli": "^0.18.2",
"@biomejs/biome": "~1.9.3",
"@fluid-internal/mocha-test-setup": "~2.74.0",
"@fluid-tools/build-cli": "^0.61.0",
"@fluid-internal/mocha-test-setup": "~2.80.0",
"@fluid-tools/build-cli": "^0.62.0",
"@fluidframework/build-common": "^2.0.3",
"@fluidframework/build-tools": "^0.61.0",
"@fluidframework/eslint-config-fluid": "~2.74.0",
"@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.73.0",
"@fluidframework/build-tools": "^0.62.0",
"@fluidframework/eslint-config-fluid": "~2.80.0",
"@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.74.0",
"@microsoft/api-extractor": "7.52.11",

@@ -96,10 +96,10 @@ "@types/debug": "^4.1.5",

"c8": "^10.1.3",
"concurrently": "^8.2.1",
"concurrently": "^9.2.1",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
"eslint": "~8.57.1",
"cross-env": "^10.1.0",
"eslint": "~9.39.1",
"jiti": "^2.6.1",
"mocha": "^10.8.2",
"mocha-multi-reporters": "^1.5.1",
"rimraf": "^4.4.0",
"rimraf": "^6.1.2",
"sinon": "^18.0.1",

@@ -106,0 +106,0 @@ "typescript": "~5.4.5"

@@ -9,3 +9,2 @@ /*!

FluidErrorTypes,
FluidErrorTypesAlpha,
type IGenericError,

@@ -239,3 +238,3 @@ type ILayerIncompatibilityError,

{
public readonly errorType = FluidErrorTypesAlpha.layerIncompatibilityError;
public readonly errorType = FluidErrorTypes.layerIncompatibilityError;
public readonly layer: string;

@@ -242,0 +241,0 @@ public readonly layerVersion: string;

@@ -8,3 +8,3 @@ /*!

import {
FluidErrorTypesAlpha,
FluidErrorTypes,
type ILayerIncompatibilityError,

@@ -127,5 +127,3 @@ } from "@fluidframework/core-interfaces/internal";

): error is ILayerIncompatibilityError {
return (
isFluidError(error) && error.errorType === FluidErrorTypesAlpha.layerIncompatibilityError
);
return isFluidError(error) && error.errorType === FluidErrorTypes.layerIncompatibilityError;
}

@@ -101,2 +101,2 @@ /*!

export { TelemetryEventBatcher } from "./telemetryEventBatcher.js";
export { validateLayerCompatibility } from "./layerCompatError.js";
export { allowIncompatibleLayersKey, validateLayerCompatibility } from "./layerCompatError.js";

@@ -14,9 +14,41 @@ /*!

import type { MonitoringContext } from "./config.js";
import { LayerIncompatibilityError } from "./error.js";
import type { ITelemetryLoggerExt } from "./telemetryTypes.js";
/**
* The config key to disable layer compatibility validation.
* @internal
*/
export const allowIncompatibleLayersKey = "Fluid.AllowIncompatibleLayers";
/**
* Tracks whether the event is logged when failing on layer incompatibility is bypassed via global config.
* This is used to ensure that the bypass event is only logged once per session so it does not flood telemetry.
*/
let globalBypassLogged = false;
/**
* Tracks whether the event is logged when failing on layer incompatibility is bypassed due to missing
* compatibility details for each layer pair.
* This is used to ensure that the bypass event is only logged once per layer pair so it does not flood telemetry.
*/
const strictCheckBypassLoggedForPair: Set<string> = new Set<string>();
/**
* Validates the compatibility between two layers using their compatibility details and support requirements.
* If the layers are incompatible, it logs an "LayerIncompatibilityError" error event. It will also call the dispose
* If the layers are incompatible, it logs a "LayerIncompatibilityError" error event. It will also call the dispose
* function with the error and throw the error.
* @param layer1 - The name of the first layer.
* @param layer2 - The name of the second layer.
* @param compatDetailsLayer1 - The compatibility details of the first layer.
* @param compatSupportRequirementsLayer1 - The support requirements that the second layer must meet to be compatible
* with the first layer.
* @param maybeCompatDetailsLayer2 - The compatibility details of the second layer. This can be undefined if the
* second layer does not provide compatibility details.
* @param disposeFn - A function that will be called with the error if the layers are incompatible.
* @param mc - The monitoring context for logging and reading configuration.
* @param strictCompatibilityCheck - If true, the function will use default compatibility details for the second layer if
* they are missing and use it for validation.
* If false, it will skip the compatibility check if the details are missing and just log an error.
* Defaults to false.
*

@@ -32,3 +64,4 @@ * @internal

disposeFn: (error?: IErrorBase) => void,
logger: ITelemetryLoggerExt,
mc: MonitoringContext,
strictCompatibilityCheck: boolean = false,
): void {

@@ -66,3 +99,43 @@ const layerCheckResult = checkLayerCompatibility(

);
logger.sendErrorEvent(
if (mc.config.getBoolean(allowIncompatibleLayersKey) === true) {
// If the validation is explicitly disabled via config, do not fail. This config provides a way to bypass
// compatibility validation while this feature is being rolled out.
if (!globalBypassLogged) {
// This event is only logged once per session to avoid flooding telemetry.
globalBypassLogged = true;
mc.logger.sendTelemetryEvent(
{
eventName: "LayerIncompatibilityDetectedButBypassed",
reason: `${allowIncompatibleLayersKey} config is set to true`,
},
error,
);
}
return;
}
if (maybeCompatDetailsLayer2 === undefined && !strictCompatibilityCheck) {
// If there is no compatibility details for layer2 and strictCompatibilityCheck is false, do not fail.
// There can be a couple of scenarios where this can happen:
// 1. layer2's version is older than the version where compatibility enforcement was introduced. In this
// case, the behavior is the same as before compatibility enforcement was introduced.
// 2. layer2 has a custom implementation which doesn't provide compatibility details. In this case,
// we don't know for sure that it is incompatible. It may fail at a later point when it tries to use
// some feature that the Runtime doesn't support.
if (!strictCheckBypassLoggedForPair.has(`${layer1}-${layer2}`)) {
// This event is only logged once per session per layer combination to avoid flooding telemetry.
strictCheckBypassLoggedForPair.add(`${layer1}-${layer2}`);
mc.logger.sendTelemetryEvent(
{
eventName: "LayerIncompatibilityDetectedButBypassed",
reason: `No compatibility details provided for ${layer2} and strictCompatibilityCheck is false`,
},
error,
);
}
return;
}
mc.logger.sendErrorEvent(
{

@@ -69,0 +142,0 @@ eventName: "LayerIncompatibilityError",