@fluidframework/telemetry-utils 2.30.0 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/telemetry-utils
2
2
 
3
+ ## 2.31.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.30.0
4
8
 
5
9
  Dependency updates only.
@@ -20,12 +24,12 @@ Dependency updates only.
20
24
 
21
25
  ### Minor Changes
22
26
 
23
- - The MockLogger class has been removed ([#23473](https://github.com/microsoft/FluidFramework/pull/23473)) [237f04204d](https://github.com/microsoft/FluidFramework/commit/237f04204d2ebd1cf7d80a5ec97fffcd5d8a55a4)
27
+ - The MockLogger class has been removed ([#23473](https://github.com/microsoft/FluidFramework/pull/23473)) [237f04204d](https://github.com/microsoft/FluidFramework/commit/237f04204d2ebd1cf7d80a5ec97fffcd5d8a55a4)
24
28
 
25
- The `MockLogger` class, which was previously part of the alpha+legacy API in `@fluidframework/telemetry-utils`, has
26
- been removed.
27
- No replacement is provided. This class was only intended for use in testing scenarios and should be trivial to
28
- re-implement in any codebase that still needs it.
29
+ The `MockLogger` class, which was previously part of the alpha+legacy API in `@fluidframework/telemetry-utils`, has
30
+ been removed.
31
+ No replacement is provided. This class was only intended for use in testing scenarios and should be trivial to
32
+ re-implement in any codebase that still needs it.
29
33
 
30
34
  ## 2.13.0
31
35
 
@@ -67,120 +71,120 @@ Dependency updates only.
67
71
 
68
72
  ### Major Changes
69
73
 
70
- - telemetry-utils: BREAKING CHANGE: Update MockLogger's events property is no longer externally mutable ([#21470](https://github.com/microsoft/FluidFramework/pull/21470)) [a9cc448107](https://github.com/microsoft/FluidFramework/commit/a9cc44810707d58f64350d468a922ed0a307ede9)
74
+ - telemetry-utils: BREAKING CHANGE: Update MockLogger's events property is no longer externally mutable ([#21470](https://github.com/microsoft/FluidFramework/pull/21470)) [a9cc448107](https://github.com/microsoft/FluidFramework/commit/a9cc44810707d58f64350d468a922ed0a307ede9)
71
75
 
72
- If you depended on this mutability to implement some behavior, you should create your own mock logger implementation.
76
+ If you depended on this mutability to implement some behavior, you should create your own mock logger implementation.
73
77
 
74
- If you depended on this mutability to work around the logger's self-clearing behavior after running a match check, you
75
- can now override this behavior via the `clearEventsAfterCheck` parameter.
78
+ If you depended on this mutability to work around the logger's self-clearing behavior after running a match check, you
79
+ can now override this behavior via the `clearEventsAfterCheck` parameter.
76
80
 
77
81
  ### Minor Changes
78
82
 
79
- - Update to TypeScript 5.4 ([#21214](https://github.com/microsoft/FluidFramework/pull/21214)) [0e6256c722](https://github.com/microsoft/FluidFramework/commit/0e6256c722d8bf024f4325bf02547daeeb18bfa6)
83
+ - Update to TypeScript 5.4 ([#21214](https://github.com/microsoft/FluidFramework/pull/21214)) [0e6256c722](https://github.com/microsoft/FluidFramework/commit/0e6256c722d8bf024f4325bf02547daeeb18bfa6)
80
84
 
81
- Update package implementations to use TypeScript 5.4.5.
85
+ Update package implementations to use TypeScript 5.4.5.
82
86
 
83
- - Update to ES 2022 ([#21292](https://github.com/microsoft/FluidFramework/pull/21292)) [68921502f7](https://github.com/microsoft/FluidFramework/commit/68921502f79b1833c4cd6d0fe339bfb126a712c7)
87
+ - Update to ES 2022 ([#21292](https://github.com/microsoft/FluidFramework/pull/21292)) [68921502f7](https://github.com/microsoft/FluidFramework/commit/68921502f79b1833c4cd6d0fe339bfb126a712c7)
84
88
 
85
- Update tsconfig to target ES 2022.
89
+ Update tsconfig to target ES 2022.
86
90
 
87
- - telemetry-utils: Deprecate `MockLogger` for external use. ([#21497](https://github.com/microsoft/FluidFramework/pull/21497)) [ed09fac561](https://github.com/microsoft/FluidFramework/commit/ed09fac5617ef832b2febfd3427a2949f8777bfe)
91
+ - telemetry-utils: Deprecate `MockLogger` for external use. ([#21497](https://github.com/microsoft/FluidFramework/pull/21497)) [ed09fac561](https://github.com/microsoft/FluidFramework/commit/ed09fac5617ef832b2febfd3427a2949f8777bfe)
88
92
 
89
- No replacement API is given. This type was never intended for use outside of the `fluid-framework` repository.
90
- If you were depending on this class for testing purposes, we recommend creating your own mock logger implementation,
91
- or copy and adapt the code from `fluid-framework` as needed.
93
+ No replacement API is given. This type was never intended for use outside of the `fluid-framework` repository.
94
+ If you were depending on this class for testing purposes, we recommend creating your own mock logger implementation,
95
+ or copy and adapt the code from `fluid-framework` as needed.
92
96
 
93
97
  ## 2.0.0-rc.4.0.0
94
98
 
95
99
  ### Major Changes
96
100
 
97
- - telemetry-utils: Internal telemetry types removed from public API surface [96872186d0](https://github.com/microsoft/FluidFramework/commit/96872186d0d0f245c1fece7d19b3743e501679b6)
101
+ - telemetry-utils: Internal telemetry types removed from public API surface [96872186d0](https://github.com/microsoft/FluidFramework/commit/96872186d0d0f245c1fece7d19b3743e501679b6)
98
102
 
99
- We have updated the tags for the following telemetry-related types in the FluidFramework: TelemetryEventCategory, TelemetryEventPropertyTypeExt, ITelemetryPropertiesExt, ITelemetryGenericEventExt, ITelemetryErrorEventExt, ITelemetryPerformanceEventExt, ITelemetryLoggerExt. For developers using any of these types, the primary action required is to transition to using the corresponding "base" type. For example, replace ITelemetryPerformanceEventExt with ITelemetryBaseEvent from @core-interfaces.
103
+ We have updated the tags for the following telemetry-related types in the FluidFramework: TelemetryEventCategory, TelemetryEventPropertyTypeExt, ITelemetryPropertiesExt, ITelemetryGenericEventExt, ITelemetryErrorEventExt, ITelemetryPerformanceEventExt, ITelemetryLoggerExt. For developers using any of these types, the primary action required is to transition to using the corresponding "base" type. For example, replace ITelemetryPerformanceEventExt with ITelemetryBaseEvent from @core-interfaces.
100
104
 
101
105
  ## 2.0.0-rc.3.0.0
102
106
 
103
107
  ### Major Changes
104
108
 
105
- - Packages now use package.json "exports" and require modern module resolution [97d68aa06b](https://github.com/microsoft/FluidFramework/commit/97d68aa06bd5c022ecb026655814aea222a062ae)
109
+ - Packages now use package.json "exports" and require modern module resolution [97d68aa06b](https://github.com/microsoft/FluidFramework/commit/97d68aa06bd5c022ecb026655814aea222a062ae)
106
110
 
107
- Fluid Framework packages have been updated to use the [package.json "exports"
108
- field](https://nodejs.org/docs/latest-v18.x/api/packages.html#exports) to define explicit entry points for both
109
- TypeScript types and implementation code.
111
+ Fluid Framework packages have been updated to use the [package.json "exports"
112
+ field](https://nodejs.org/docs/latest-v18.x/api/packages.html#exports) to define explicit entry points for both
113
+ TypeScript types and implementation code.
110
114
 
111
- This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
115
+ This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
112
116
 
113
- - `"moduleResolution": "Node16"` with `"module": "Node16"`
114
- - `"moduleResolution": "Bundler"` with `"module": "ESNext"`
117
+ - `"moduleResolution": "Node16"` with `"module": "Node16"`
118
+ - `"moduleResolution": "Bundler"` with `"module": "ESNext"`
115
119
 
116
- We recommend using Node16/Node16 unless absolutely necessary. That will produce transpiled JavaScript that is suitable
117
- for use with modern versions of Node.js _and_ Bundlers.
118
- [See the TypeScript documentation](https://www.typescriptlang.org/tsconfig#moduleResolution) for more information
119
- regarding the module and moduleResolution options.
120
+ We recommend using Node16/Node16 unless absolutely necessary. That will produce transpiled JavaScript that is suitable
121
+ for use with modern versions of Node.js _and_ Bundlers.
122
+ [See the TypeScript documentation](https://www.typescriptlang.org/tsconfig#moduleResolution) for more information
123
+ regarding the module and moduleResolution options.
120
124
 
121
- **Node10 moduleResolution is not supported; it does not support Fluid Framework's API structuring pattern that is used
122
- to distinguish stable APIs from those that are in development.**
125
+ **Node10 moduleResolution is not supported; it does not support Fluid Framework's API structuring pattern that is used
126
+ to distinguish stable APIs from those that are in development.**
123
127
 
124
128
  ## 2.0.0-rc.2.0.0
125
129
 
126
130
  ### Minor Changes
127
131
 
128
- - fluid-framework: EventEmitterWithErrorHandling is no longer publicly exported ([#19717](https://github.com/microsoft/FluidFramework/issues/19717)) [ae1d0be26d](https://github.com/microsoft/FluidFramework/commits/ae1d0be26d61453cff316b3f622a9f3647149167)
132
+ - fluid-framework: EventEmitterWithErrorHandling is no longer publicly exported ([#19717](https://github.com/microsoft/FluidFramework/issues/19717)) [ae1d0be26d](https://github.com/microsoft/FluidFramework/commits/ae1d0be26d61453cff316b3f622a9f3647149167)
129
133
 
130
- EventEmitterWithErrorHandling is intended for authoring DDSes, and thus is only intended for use within the Fluid Framework client packages.
131
- It is no longer publicly exported: any users should fine their own solution or be upstreamed.
132
- EventEmitterWithErrorHandling is available for now as `@alpha` to make this migration less disrupting for any existing users.
134
+ EventEmitterWithErrorHandling is intended for authoring DDSes, and thus is only intended for use within the Fluid Framework client packages.
135
+ It is no longer publicly exported: any users should fine their own solution or be upstreamed.
136
+ EventEmitterWithErrorHandling is available for now as `@alpha` to make this migration less disrupting for any existing users.
133
137
 
134
- - telemetry-utils: logIfFalse() is removed ([#19597](https://github.com/microsoft/FluidFramework/issues/19597)) [213b5ab761](https://github.com/microsoft/FluidFramework/commits/213b5ab7611c214fda7fa005f89ac37c2f1695c1)
138
+ - telemetry-utils: logIfFalse() is removed ([#19597](https://github.com/microsoft/FluidFramework/issues/19597)) [213b5ab761](https://github.com/microsoft/FluidFramework/commits/213b5ab7611c214fda7fa005f89ac37c2f1695c1)
135
139
 
136
- The deprecated `logIfFalse()` function has been removed. Consumers who want to keep using it can reimplement in in their
137
- codebase by copying it from a previous version of the `@fluidframework/telemetry-utils` package.
140
+ The deprecated `logIfFalse()` function has been removed. Consumers who want to keep using it can reimplement in in their
141
+ codebase by copying it from a previous version of the `@fluidframework/telemetry-utils` package.
138
142
 
139
- - Deprecated error-related enums have been removed ([#19067](https://github.com/microsoft/FluidFramework/issues/19067)) [59793302e5](https://github.com/microsoft/FluidFramework/commits/59793302e56784cfb6ace0e6469345f3565b3312)
143
+ - Deprecated error-related enums have been removed ([#19067](https://github.com/microsoft/FluidFramework/issues/19067)) [59793302e5](https://github.com/microsoft/FluidFramework/commits/59793302e56784cfb6ace0e6469345f3565b3312)
140
144
 
141
- Error-related enums `ContainerErrorType`, `DriverErrorType`, `OdspErrorType` and `RouterliciousErrorType` were previously
142
- deprecated and are now removed. There are replacement object-based enumerations of `ContainerErrorTypes`,
143
- `DriverErrorTypes`, `OdspErrorTypes` and `RouterliciousErrorTypes`. Refer to the release notes of [Fluid Framework version
144
- 2.0.0-internal.7.0.0](https://github.com/microsoft/FluidFramework/releases/tag/client_v2.0.0-internal.7.0.0) for details
145
- on the replacements.
145
+ Error-related enums `ContainerErrorType`, `DriverErrorType`, `OdspErrorType` and `RouterliciousErrorType` were previously
146
+ deprecated and are now removed. There are replacement object-based enumerations of `ContainerErrorTypes`,
147
+ `DriverErrorTypes`, `OdspErrorTypes` and `RouterliciousErrorTypes`. Refer to the release notes of [Fluid Framework version
148
+ 2.0.0-internal.7.0.0](https://github.com/microsoft/FluidFramework/releases/tag/client_v2.0.0-internal.7.0.0) for details
149
+ on the replacements.
146
150
 
147
151
  ## 2.0.0-rc.1.0.0
148
152
 
149
153
  ### Minor Changes
150
154
 
151
- - Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
155
+ - Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
152
156
 
153
- The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
157
+ The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
154
158
 
155
- - @fluidframework/gitresources
156
- - @fluidframework/server-kafka-orderer
157
- - @fluidframework/server-lambdas
158
- - @fluidframework/server-lambdas-driver
159
- - @fluidframework/server-local-server
160
- - @fluidframework/server-memory-orderer
161
- - @fluidframework/protocol-base
162
- - @fluidframework/server-routerlicious
163
- - @fluidframework/server-routerlicious-base
164
- - @fluidframework/server-services
165
- - @fluidframework/server-services-client
166
- - @fluidframework/server-services-core
167
- - @fluidframework/server-services-ordering-kafkanode
168
- - @fluidframework/server-services-ordering-rdkafka
169
- - @fluidframework/server-services-ordering-zookeeper
170
- - @fluidframework/server-services-shared
171
- - @fluidframework/server-services-telemetry
172
- - @fluidframework/server-services-utils
173
- - @fluidframework/server-test-utils
174
- - tinylicious
159
+ - @fluidframework/gitresources
160
+ - @fluidframework/server-kafka-orderer
161
+ - @fluidframework/server-lambdas
162
+ - @fluidframework/server-lambdas-driver
163
+ - @fluidframework/server-local-server
164
+ - @fluidframework/server-memory-orderer
165
+ - @fluidframework/protocol-base
166
+ - @fluidframework/server-routerlicious
167
+ - @fluidframework/server-routerlicious-base
168
+ - @fluidframework/server-services
169
+ - @fluidframework/server-services-client
170
+ - @fluidframework/server-services-core
171
+ - @fluidframework/server-services-ordering-kafkanode
172
+ - @fluidframework/server-services-ordering-rdkafka
173
+ - @fluidframework/server-services-ordering-zookeeper
174
+ - @fluidframework/server-services-shared
175
+ - @fluidframework/server-services-telemetry
176
+ - @fluidframework/server-services-utils
177
+ - @fluidframework/server-test-utils
178
+ - tinylicious
175
179
 
176
- - Updated @fluidframework/protocol-definitions ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
180
+ - Updated @fluidframework/protocol-definitions ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
177
181
 
178
- The @fluidframework/protocol-definitions dependency has been upgraded to v3.1.0. [See the full
179
- changelog.](https://github.com/microsoft/FluidFramework/blob/main/common/lib/protocol-definitions/CHANGELOG.md#310)
182
+ The @fluidframework/protocol-definitions dependency has been upgraded to v3.1.0. [See the full
183
+ changelog.](https://github.com/microsoft/FluidFramework/blob/main/common/lib/protocol-definitions/CHANGELOG.md#310)
180
184
 
181
- - Remove deprecated config types from telemetry-utils ([#18839](https://github.com/microsoft/FluidFramework/issues/18839)) [42f17a267c](https://github.com/microsoft/FluidFramework/commits/42f17a267cf796e262da08395cf9fc3cede4bce5)
185
+ - Remove deprecated config types from telemetry-utils ([#18839](https://github.com/microsoft/FluidFramework/issues/18839)) [42f17a267c](https://github.com/microsoft/FluidFramework/commits/42f17a267cf796e262da08395cf9fc3cede4bce5)
182
186
 
183
- The types `ConfigTypes` and `IConfigProviderBase` were deprecated and are now removed from @fluidframework/telemetry-utils. They continue to exist in @fluidframework/core-interfaces. Please update your reference to use these types from @fluidframework/core-interfaces.
187
+ The types `ConfigTypes` and `IConfigProviderBase` were deprecated and are now removed from @fluidframework/telemetry-utils. They continue to exist in @fluidframework/core-interfaces. Please update your reference to use these types from @fluidframework/core-interfaces.
184
188
 
185
189
  ## 2.0.0-internal.8.0.0
186
190
 
@@ -190,16 +194,16 @@ Dependency updates only.
190
194
 
191
195
  ### Minor Changes
192
196
 
193
- - telemetry-utils: Deprecate ConfigTypes and IConfigProviderBase ([#18597](https://github.com/microsoft/FluidFramework/issues/18597)) [39b9ff57c0](https://github.com/microsoft/FluidFramework/commits/39b9ff57c0184b72f0e3f9425922dda944995265)
197
+ - telemetry-utils: Deprecate ConfigTypes and IConfigProviderBase ([#18597](https://github.com/microsoft/FluidFramework/issues/18597)) [39b9ff57c0](https://github.com/microsoft/FluidFramework/commits/39b9ff57c0184b72f0e3f9425922dda944995265)
194
198
 
195
- The types `ConfigTypes` and `IConfigProviderBase` have been deprecated in the @fluidframework/telemetry-utils package.
196
- The types can now be found in the @fluidframework/core-interfaces package. Please replace any uses with the types from
197
- @fluidframework/core-interfaces.
199
+ The types `ConfigTypes` and `IConfigProviderBase` have been deprecated in the @fluidframework/telemetry-utils package.
200
+ The types can now be found in the @fluidframework/core-interfaces package. Please replace any uses with the types from
201
+ @fluidframework/core-interfaces.
198
202
 
199
- - telemetry-utils: Deprecated logIfFalse ([#18047](https://github.com/microsoft/FluidFramework/issues/18047)) [57614ffdc6](https://github.com/microsoft/FluidFramework/commits/57614ffdc6e3fbd22ddbe5ed589c75d3d195aa48)
203
+ - telemetry-utils: Deprecated logIfFalse ([#18047](https://github.com/microsoft/FluidFramework/issues/18047)) [57614ffdc6](https://github.com/microsoft/FluidFramework/commits/57614ffdc6e3fbd22ddbe5ed589c75d3d195aa48)
200
204
 
201
- This functionality was not intended for export and will be removed in a future release.
202
- No replacement API is offered because the logic is trivial to reproduce as needed.
205
+ This functionality was not intended for export and will be removed in a future release.
206
+ No replacement API is offered because the logic is trivial to reproduce as needed.
203
207
 
204
208
  ## 2.0.0-internal.7.3.0
205
209
 
@@ -217,182 +221,182 @@ Dependency updates only.
217
221
 
218
222
  ### Major Changes
219
223
 
220
- - Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
221
-
222
- This included the following changes from the protocol-definitions release:
223
-
224
- - Updating signal interfaces for some planned improvements. The intention is split the interface between signals
225
- submitted by clients to the server and the resulting signals sent from the server to clients.
226
- - A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
227
- been added, which will be the typing for signals sent from the client to the server. Both extend a new
228
- ISignalMessageBase interface that contains common members.
229
- - The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
230
-
231
- - Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
232
-
233
- Dependencies on the following Fluid server package have been updated to version 2.0.1:
234
-
235
- - @fluidframework/gitresources: 2.0.1
236
- - @fluidframework/server-kafka-orderer: 2.0.1
237
- - @fluidframework/server-lambdas: 2.0.1
238
- - @fluidframework/server-lambdas-driver: 2.0.1
239
- - @fluidframework/server-local-server: 2.0.1
240
- - @fluidframework/server-memory-orderer: 2.0.1
241
- - @fluidframework/protocol-base: 2.0.1
242
- - @fluidframework/server-routerlicious: 2.0.1
243
- - @fluidframework/server-routerlicious-base: 2.0.1
244
- - @fluidframework/server-services: 2.0.1
245
- - @fluidframework/server-services-client: 2.0.1
246
- - @fluidframework/server-services-core: 2.0.1
247
- - @fluidframework/server-services-ordering-kafkanode: 2.0.1
248
- - @fluidframework/server-services-ordering-rdkafka: 2.0.1
249
- - @fluidframework/server-services-ordering-zookeeper: 2.0.1
250
- - @fluidframework/server-services-shared: 2.0.1
251
- - @fluidframework/server-services-telemetry: 2.0.1
252
- - @fluidframework/server-services-utils: 2.0.1
253
- - @fluidframework/server-test-utils: 2.0.1
254
- - tinylicious: 2.0.1
255
-
256
- - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
257
-
258
- The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
259
-
260
- - @fluidframework/container-utils package removed [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
261
-
262
- All members of the **@fluidframework/container-utils** package have been deprecated and the package is now removed.
263
-
264
- Migration by API member:
265
-
266
- - `ClientSessionExpiredError` (deprecated in `2.0.0-internal.6.2.0`): No replacement API offered.
267
- - `DataCorruptionError` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
268
- - `DataProcessingError` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
269
- - `DeltaManagerProxyBase` (deprecated in `2.0.0-internal.6.1.0`): No replacement API offered.
270
- - `extractSafePropertiesFromMessage` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
271
- - `GenericError` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
272
- - `ThrottlingWarning` (deprecated in `2.0.0-internal.6.2.0`): No replacement API offered.
273
- - `UsageError` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
224
+ - Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
225
+
226
+ This included the following changes from the protocol-definitions release:
227
+
228
+ - Updating signal interfaces for some planned improvements. The intention is split the interface between signals
229
+ submitted by clients to the server and the resulting signals sent from the server to clients.
230
+ - A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
231
+ been added, which will be the typing for signals sent from the client to the server. Both extend a new
232
+ ISignalMessageBase interface that contains common members.
233
+ - The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
234
+
235
+ - Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
236
+
237
+ Dependencies on the following Fluid server package have been updated to version 2.0.1:
238
+
239
+ - @fluidframework/gitresources: 2.0.1
240
+ - @fluidframework/server-kafka-orderer: 2.0.1
241
+ - @fluidframework/server-lambdas: 2.0.1
242
+ - @fluidframework/server-lambdas-driver: 2.0.1
243
+ - @fluidframework/server-local-server: 2.0.1
244
+ - @fluidframework/server-memory-orderer: 2.0.1
245
+ - @fluidframework/protocol-base: 2.0.1
246
+ - @fluidframework/server-routerlicious: 2.0.1
247
+ - @fluidframework/server-routerlicious-base: 2.0.1
248
+ - @fluidframework/server-services: 2.0.1
249
+ - @fluidframework/server-services-client: 2.0.1
250
+ - @fluidframework/server-services-core: 2.0.1
251
+ - @fluidframework/server-services-ordering-kafkanode: 2.0.1
252
+ - @fluidframework/server-services-ordering-rdkafka: 2.0.1
253
+ - @fluidframework/server-services-ordering-zookeeper: 2.0.1
254
+ - @fluidframework/server-services-shared: 2.0.1
255
+ - @fluidframework/server-services-telemetry: 2.0.1
256
+ - @fluidframework/server-services-utils: 2.0.1
257
+ - @fluidframework/server-test-utils: 2.0.1
258
+ - tinylicious: 2.0.1
259
+
260
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
261
+
262
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
263
+
264
+ - @fluidframework/container-utils package removed [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
265
+
266
+ All members of the **@fluidframework/container-utils** package have been deprecated and the package is now removed.
267
+
268
+ Migration by API member:
269
+
270
+ - `ClientSessionExpiredError` (deprecated in `2.0.0-internal.6.2.0`): No replacement API offered.
271
+ - `DataCorruptionError` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
272
+ - `DataProcessingError` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
273
+ - `DeltaManagerProxyBase` (deprecated in `2.0.0-internal.6.1.0`): No replacement API offered.
274
+ - `extractSafePropertiesFromMessage` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
275
+ - `GenericError` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
276
+ - `ThrottlingWarning` (deprecated in `2.0.0-internal.6.2.0`): No replacement API offered.
277
+ - `UsageError` (deprecated in `2.0.0-internal.6.2.0`): Import from [@fluidframework/telemetry-utils](https://www.npmjs.com/package/@fluidframework/telemetry-utils) instead.
274
278
 
275
279
  ## 2.0.0-internal.6.4.0
276
280
 
277
281
  ### Minor Changes
278
282
 
279
- - Upcoming: The type of the logger property/param in various APIs will be changing ([#17350](https://github.com/microsoft/FluidFramework/issues/17350)) [27284bcda3](https://github.com/microsoft/FluidFramework/commits/27284bcda3d63cc4306cf76806f8a075db0db60f)
283
+ - Upcoming: The type of the logger property/param in various APIs will be changing ([#17350](https://github.com/microsoft/FluidFramework/issues/17350)) [27284bcda3](https://github.com/microsoft/FluidFramework/commits/27284bcda3d63cc4306cf76806f8a075db0db60f)
280
284
 
281
- - @fluidframework/runtime-definitions
282
- - `IFluidDataStoreRuntime.logger` will be re-typed as `ITelemetryBaseLogger`
283
- - @fluidframework/odsp-driver
284
- - `protected OdspDocumentServiceFactoryCore.createDocumentServiceCore`'s parameter `odspLogger` will be re-typed as `ITelemetryLoggerExt`
285
- - `protected LocalOdspDocumentServiceFactory.createDocumentServiceCore`'s parameter `odspLogger` will be re-typed as `ITelemetryLoggerExt`
285
+ - @fluidframework/runtime-definitions
286
+ - `IFluidDataStoreRuntime.logger` will be re-typed as `ITelemetryBaseLogger`
287
+ - @fluidframework/odsp-driver
288
+ - `protected OdspDocumentServiceFactoryCore.createDocumentServiceCore`'s parameter `odspLogger` will be re-typed as `ITelemetryLoggerExt`
289
+ - `protected LocalOdspDocumentServiceFactory.createDocumentServiceCore`'s parameter `odspLogger` will be re-typed as `ITelemetryLoggerExt`
286
290
 
287
- Additionally, several of @fluidframework/telemetry-utils's exports are being marked as internal and should not be consumed outside of other FF packages.
291
+ Additionally, several of @fluidframework/telemetry-utils's exports are being marked as internal and should not be consumed outside of other FF packages.
288
292
 
289
293
  ## 2.0.0-internal.6.3.0
290
294
 
291
295
  ### Minor Changes
292
296
 
293
- - Cleaning up duplicate or misnamed telemetry types ([#17149](https://github.com/microsoft/FluidFramework/issues/17149)) [f9236942fa](https://github.com/microsoft/FluidFramework/commits/f9236942faf03cde860bfcbc7c28f8fbd81d3868)
297
+ - Cleaning up duplicate or misnamed telemetry types ([#17149](https://github.com/microsoft/FluidFramework/issues/17149)) [f9236942fa](https://github.com/microsoft/FluidFramework/commits/f9236942faf03cde860bfcbc7c28f8fbd81d3868)
294
298
 
295
- We have two sets of telemetry-related interfaces:
299
+ We have two sets of telemetry-related interfaces:
296
300
 
297
- - The "Base" ones
298
- - These have a very bare API surface
299
- - They are used on public API surfaces to transmit logs across layers
300
- - The internal ones
301
- - These have a richer API surface (multiple log functions with different categories,
302
- support for logging flat arrays and objects)
303
- - They are used for instrumenting our code, and then normalize and pass off the logs via the Base interface
301
+ - The "Base" ones
302
+ - These have a very bare API surface
303
+ - They are used on public API surfaces to transmit logs across layers
304
+ - The internal ones
305
+ - These have a richer API surface (multiple log functions with different categories,
306
+ support for logging flat arrays and objects)
307
+ - They are used for instrumenting our code, and then normalize and pass off the logs via the Base interface
304
308
 
305
- There are two problems with the given state of the world:
309
+ There are two problems with the given state of the world:
306
310
 
307
- 1. The "Base" ones were not named consistently, so the distinction was not as apparent as it could be
308
- 2. The internal ones were copied to `@fluidframework/telemetry-utils` and futher extended, but the original duplicates remain.
311
+ 1. The "Base" ones were not named consistently, so the distinction was not as apparent as it could be
312
+ 2. The internal ones were copied to `@fluidframework/telemetry-utils` and futher extended, but the original duplicates remain.
309
313
 
310
- This change addresses these by adding "Base" to the name of each base type, and deprecating the old duplicate internal types.
314
+ This change addresses these by adding "Base" to the name of each base type, and deprecating the old duplicate internal types.
311
315
 
312
- Additionally, the following types were adjusted:
316
+ Additionally, the following types were adjusted:
313
317
 
314
- - `TelemetryEventCategory` is moving from `@fluidframework/core-interfaces` to `@fluidframework/telemetry-utils`
315
- - Several types modeling "tagged" telemetry properties are deprecated in favor of a generic type `Tagged<V>`
318
+ - `TelemetryEventCategory` is moving from `@fluidframework/core-interfaces` to `@fluidframework/telemetry-utils`
319
+ - Several types modeling "tagged" telemetry properties are deprecated in favor of a generic type `Tagged<V>`
316
320
 
317
321
  ## 2.0.0-internal.6.2.0
318
322
 
319
323
  ### Minor Changes
320
324
 
321
- - Remove use of @fluidframework/common-definitions ([#16638](https://github.com/microsoft/FluidFramework/issues/16638)) [a8c81509c9](https://github.com/microsoft/FluidFramework/commits/a8c81509c9bf09cfb2092ebcf7265205f9eb6dbf)
322
-
323
- The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
324
- imported from the **@fluidframework/core-interfaces** package:
325
-
326
- - interface IDisposable
327
- - interface IErrorEvent
328
- - interface IErrorEvent
329
- - interface IEvent
330
- - interface IEventProvider
331
- - interface ILoggingError
332
- - interface ITaggedTelemetryPropertyType
333
- - interface ITelemetryBaseEvent
334
- - interface ITelemetryBaseLogger
335
- - interface ITelemetryErrorEvent
336
- - interface ITelemetryGenericEvent
337
- - interface ITelemetryLogger
338
- - interface ITelemetryPerformanceEvent
339
- - interface ITelemetryProperties
340
- - type ExtendEventProvider
341
- - type IEventThisPlaceHolder
342
- - type IEventTransformer
343
- - type ReplaceIEventThisPlaceHolder
344
- - type ReplaceIEventThisPlaceHolder
345
- - type TelemetryEventCategory
346
- - type TelemetryEventPropertyType
325
+ - Remove use of @fluidframework/common-definitions ([#16638](https://github.com/microsoft/FluidFramework/issues/16638)) [a8c81509c9](https://github.com/microsoft/FluidFramework/commits/a8c81509c9bf09cfb2092ebcf7265205f9eb6dbf)
326
+
327
+ The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
328
+ imported from the **@fluidframework/core-interfaces** package:
329
+
330
+ - interface IDisposable
331
+ - interface IErrorEvent
332
+ - interface IErrorEvent
333
+ - interface IEvent
334
+ - interface IEventProvider
335
+ - interface ILoggingError
336
+ - interface ITaggedTelemetryPropertyType
337
+ - interface ITelemetryBaseEvent
338
+ - interface ITelemetryBaseLogger
339
+ - interface ITelemetryErrorEvent
340
+ - interface ITelemetryGenericEvent
341
+ - interface ITelemetryLogger
342
+ - interface ITelemetryPerformanceEvent
343
+ - interface ITelemetryProperties
344
+ - type ExtendEventProvider
345
+ - type IEventThisPlaceHolder
346
+ - type IEventTransformer
347
+ - type ReplaceIEventThisPlaceHolder
348
+ - type ReplaceIEventThisPlaceHolder
349
+ - type TelemetryEventCategory
350
+ - type TelemetryEventPropertyType
347
351
 
348
352
  ## 2.0.0-internal.6.1.0
349
353
 
350
354
  ### Minor Changes
351
355
 
352
- - Removed `TelemetryNullLogger` class is again exported from @fluidframework/telemetry-utils ([#16841](https://github.com/microsoft/FluidFramework/issues/16841)) [697f46a838](https://github.com/microsoft/FluidFramework/commits/697f46a838706a046c402ba96624b8f07ebc3b07)
356
+ - Removed `TelemetryNullLogger` class is again exported from @fluidframework/telemetry-utils ([#16841](https://github.com/microsoft/FluidFramework/issues/16841)) [697f46a838](https://github.com/microsoft/FluidFramework/commits/697f46a838706a046c402ba96624b8f07ebc3b07)
353
357
 
354
- The `TelemetryNullLogger` class has been brought back to ease the transition to `2.0.0-internal.6.x`
355
- _but is still deprecated_ and will be removed in `2.0.0-internal.7.0.0`.
358
+ The `TelemetryNullLogger` class has been brought back to ease the transition to `2.0.0-internal.6.x`
359
+ _but is still deprecated_ and will be removed in `2.0.0-internal.7.0.0`.
356
360
 
357
- For internal use within the FluidFramework codebase, use `createChildLogger()` with no arguments instead.
358
- For external consumers we recommend writing a trivial implementation of `ITelemetryBaseLogger`
359
- (from the `@fluidframework/core-interfaces` package) where the `send()` method does nothing and using that.
361
+ For internal use within the FluidFramework codebase, use `createChildLogger()` with no arguments instead.
362
+ For external consumers we recommend writing a trivial implementation of `ITelemetryBaseLogger`
363
+ (from the `@fluidframework/core-interfaces` package) where the `send()` method does nothing and using that.
360
364
 
361
365
  ## 2.0.0-internal.6.0.0
362
366
 
363
367
  ### Major Changes
364
368
 
365
- - Remove Deprecated Loggers [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
369
+ - Remove Deprecated Loggers [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
366
370
 
367
- This change removes the previously deprecated logger implementations. The following replacements are available:
371
+ This change removes the previously deprecated logger implementations. The following replacements are available:
368
372
 
369
- - replace ChildLogger.create, new TelemetryNullLogger, and new BaseTelemetryNullLogger with createChildLogger
370
- - replace new MultiSinkLogger with createMultiSinkLogger
371
- - replace TelemetryUTLogger with MockLogger
372
- - DebugLogger has no intended replacement
373
+ - replace ChildLogger.create, new TelemetryNullLogger, and new BaseTelemetryNullLogger with createChildLogger
374
+ - replace new MultiSinkLogger with createMultiSinkLogger
375
+ - replace TelemetryUTLogger with MockLogger
376
+ - DebugLogger has no intended replacement
373
377
 
374
- - MockLogger is no longer a TelemetryLogger [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
378
+ - MockLogger is no longer a TelemetryLogger [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
375
379
 
376
- TelemetryLogger was deprecated and has now been removed, so MockLogger can no longer inherit from it. MockLogger is now a ITelemetryBaseLogger, to get an ITelemetryLogger, or ITelemetryLoggerExt there is a new convenience method, `MockLogger.toTelemetryLogger()`
380
+ TelemetryLogger was deprecated and has now been removed, so MockLogger can no longer inherit from it. MockLogger is now a ITelemetryBaseLogger, to get an ITelemetryLogger, or ITelemetryLoggerExt there is a new convenience method, `MockLogger.toTelemetryLogger()`
377
381
 
378
- - Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
382
+ - Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
379
383
 
380
- Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
384
+ Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
381
385
 
382
386
  ## 2.0.0-internal.5.4.0
383
387
 
384
388
  ### Minor Changes
385
389
 
386
- - Deprecate Internal TelemetryLogger Implementations ([#16385](https://github.com/microsoft/FluidFramework/issues/16385)) [64023cacb1](https://github.com/microsoft/FluidFramework/commits/64023cacb13767c46c0472ecc22559aaad67adad)
390
+ - Deprecate Internal TelemetryLogger Implementations ([#16385](https://github.com/microsoft/FluidFramework/issues/16385)) [64023cacb1](https://github.com/microsoft/FluidFramework/commits/64023cacb13767c46c0472ecc22559aaad67adad)
387
391
 
388
- This change deprecates our internal TelemetryLogger implementations and unifies our exported and consumed surface area on our telemetry interfaces.
392
+ This change deprecates our internal TelemetryLogger implementations and unifies our exported and consumed surface area on our telemetry interfaces.
389
393
 
390
- For the deprecated implementations the following replacement function should be used:
394
+ For the deprecated implementations the following replacement function should be used:
391
395
 
392
- - replace ChildLogger.create, new TelemetryNullLogger, and new BaseTelemetryNullLogger with createChildLogger
393
- - replace new MultiSinkLogger with createMultiSinkLogger
394
- - replace TelemetryUTLogger with MockLogger
395
- - DebugLogger.create will be made internal with no intended replacement
396
+ - replace ChildLogger.create, new TelemetryNullLogger, and new BaseTelemetryNullLogger with createChildLogger
397
+ - replace new MultiSinkLogger with createMultiSinkLogger
398
+ - replace TelemetryUTLogger with MockLogger
399
+ - DebugLogger.create will be made internal with no intended replacement
396
400
 
397
401
  ## 2.0.0-internal.5.3.0
398
402
 
@@ -406,21 +410,21 @@ Dependency updates only.
406
410
 
407
411
  ### Minor Changes
408
412
 
409
- - Logger interface now supports logging a flat object ([#15759](https://github.com/microsoft/FluidFramework/issues/15759)) [8ae4fe32b1](https://github.com/microsoft/FluidFramework/commits/8ae4fe32b11d9bdfe6d2d43950970c95bdc660a6)
413
+ - Logger interface now supports logging a flat object ([#15759](https://github.com/microsoft/FluidFramework/issues/15759)) [8ae4fe32b1](https://github.com/microsoft/FluidFramework/commits/8ae4fe32b11d9bdfe6d2d43950970c95bdc660a6)
410
414
 
411
- The internal logger interface used when instrumenting the code now supports logging a flat object,
412
- which will be JSON.stringified before being sent to the host's base logger.
413
- This is technically a breaking change but based on typical logger configuration, should not require any changes to accommodate.
415
+ The internal logger interface used when instrumenting the code now supports logging a flat object,
416
+ which will be JSON.stringified before being sent to the host's base logger.
417
+ This is technically a breaking change but based on typical logger configuration, should not require any changes to accommodate.
414
418
 
415
419
  ## 2.0.0-internal.5.0.0
416
420
 
417
421
  ### Major Changes
418
422
 
419
- - `ITelemetryLoggerExt` is a replacement for `ITelemetryLogger`, which adds additional types that can be logged as property values. ([#15667](https://github.com/microsoft/FluidFramework/pull-requests/15667)) [8c851e4c4b](https://github.com/microsoft/FluidFramework/commits/8c851e4c4b9a18a5189ace0608a1d8c3190a606b)
420
- This interface is not expected to be used outside the codebase, and all Logger implementations already use the new interface.
421
- In this release, the new type is used throughout the codebase to allow richer instrumentation.
423
+ - `ITelemetryLoggerExt` is a replacement for `ITelemetryLogger`, which adds additional types that can be logged as property values. ([#15667](https://github.com/microsoft/FluidFramework/pull-requests/15667)) [8c851e4c4b](https://github.com/microsoft/FluidFramework/commits/8c851e4c4b9a18a5189ace0608a1d8c3190a606b)
424
+ This interface is not expected to be used outside the codebase, and all Logger implementations already use the new interface.
425
+ In this release, the new type is used throughout the codebase to allow richer instrumentation.
422
426
 
423
- It's unlikely this will manifest as a break to consumers of the package, but it's not impossible.
427
+ It's unlikely this will manifest as a break to consumers of the package, but it's not impossible.
424
428
 
425
429
  ## 2.0.0-internal.4.4.0
426
430
 
package/dist/error.d.ts CHANGED
@@ -75,7 +75,7 @@ export declare class DataProcessingError extends LoggingError implements IErrorB
75
75
  /**
76
76
  * Create a new `DataProcessingError` detected and raised within the Fluid Framework.
77
77
  */
78
- static create(errorMessage: string, dataProcessingCodepath: string, sequencedMessage?: ISequencedDocumentMessage, props?: ITelemetryPropertiesExt): IFluidErrorBase;
78
+ static create(errorMessage: string, dataProcessingCodepath: string, sequencedMessage?: ISequencedDocumentMessage, props?: ITelemetryPropertiesExt, stackTraceLimit?: number): IFluidErrorBase;
79
79
  /**
80
80
  * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type
81
81
  * with the exception of a normalized {@link LoggingError}, which will still be wrapped.
@@ -1 +1 @@
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,EAEN,KAAK,aAAa,EAClB,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,E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;AACH,qBAAa,mBAAoB,SAAQ,YAAa,YAAW,UAAU,EAAE,eAAe;IAC3F;;OAEG;IACH,SAAgB,SAAS,wBAAuC;IAEhE,SAAgB,QAAQ,SAAS;IAEjC,OAAO;IAIP;;OAEG;WACW,MAAM,CACnB,YAAY,EAAE,MAAM,EACpB,sBAAsB,EAAE,MAAM,EAC9B,gBAAgB,CAAC,EAAE,yBAAyB,EAC5C,KAAK,GAAE,uBAA4B,EACnC,eAAe,CAAC,EAAE,MAAM,GACtB,eAAe;IAwBlB;;;;;;;;;;;;;;;;;OAiBG;WACW,kBAAkB,CAC/B,aAAa,EAAE,OAAO,EACtB,sBAAsB,EAAE,MAAM,EAC9B,WAAW,CAAC,EAAE,OAAO,CACpB,IAAI,CACH,yBAAyB,EACvB,UAAU,GACV,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,WAAW,CACb,CACD,GACC,eAAe;CA6BlB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,gBAC/B,QACZ,KACC,yBAAyB,EACvB,UAAU,GACV,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,WAAW,CACb,CACD,KACC;IACF,eAAe,EAAE,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"}
package/dist/error.js CHANGED
@@ -94,10 +94,23 @@ class DataProcessingError extends errorLogging_js_1.LoggingError {
94
94
  /**
95
95
  * Create a new `DataProcessingError` detected and raised within the Fluid Framework.
96
96
  */
97
- static create(errorMessage, dataProcessingCodepath, sequencedMessage, props = {}) {
98
- const dataProcessingError = DataProcessingError.wrapIfUnrecognized(errorMessage, dataProcessingCodepath, sequencedMessage);
99
- dataProcessingError.addTelemetryProperties(props);
100
- return dataProcessingError;
97
+ static create(errorMessage, dataProcessingCodepath, sequencedMessage, props = {}, stackTraceLimit) {
98
+ const ErrorConfig = Error;
99
+ const originalStackTraceLimit = ErrorConfig.stackTraceLimit;
100
+ try {
101
+ if (stackTraceLimit !== undefined) {
102
+ ErrorConfig.stackTraceLimit = stackTraceLimit;
103
+ }
104
+ const dataProcessingError = DataProcessingError.wrapIfUnrecognized(errorMessage, dataProcessingCodepath, sequencedMessage);
105
+ dataProcessingError.addTelemetryProperties(props);
106
+ return dataProcessingError;
107
+ }
108
+ finally {
109
+ // Reset the stack trace limit to the original value
110
+ if (stackTraceLimit !== undefined) {
111
+ ErrorConfig.stackTraceLimit = originalStackTraceLimit;
112
+ }
113
+ }
101
114
  }
102
115
  /**
103
116
  * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type
package/dist/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAIkD;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,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the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\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\tsequencedMessage?: ISequencedDocumentMessage,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t): IFluidErrorBase {\n\t\tconst dataProcessingError = DataProcessingError.wrapIfUnrecognized(\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tsequencedMessage,\n\t\t);\n\t\tdataProcessingError.addTelemetryProperties(props);\n\n\t\treturn dataProcessingError;\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 * 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
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAIkD;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,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e,CAAC;IACxB,CAAC;CACD;AA1GD,kDA0GC;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\ttype IGenericError,\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\tsequencedMessage?: ISequencedDocumentMessage,\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\tsequencedMessage,\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 * 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"]}
package/lib/error.d.ts CHANGED
@@ -75,7 +75,7 @@ export declare class DataProcessingError extends LoggingError implements IErrorB
75
75
  /**
76
76
  * Create a new `DataProcessingError` detected and raised within the Fluid Framework.
77
77
  */
78
- static create(errorMessage: string, dataProcessingCodepath: string, sequencedMessage?: ISequencedDocumentMessage, props?: ITelemetryPropertiesExt): IFluidErrorBase;
78
+ static create(errorMessage: string, dataProcessingCodepath: string, sequencedMessage?: ISequencedDocumentMessage, props?: ITelemetryPropertiesExt, stackTraceLimit?: number): IFluidErrorBase;
79
79
  /**
80
80
  * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type
81
81
  * with the exception of a normalized {@link LoggingError}, which will still be wrapped.
@@ -1 +1 @@
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,EAEN,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EACN,YAAY,EAKZ,MAAM,mBAAm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MAAM,gCAAgC,gBAC/B,QACZ,KACC,yBAAyB,EACvB,UAAU,GACV,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,WAAW,CACb,CACD,KACC;IACF,eAAe,EAAE,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"}
package/lib/error.js CHANGED
@@ -87,10 +87,23 @@ export class DataProcessingError extends LoggingError {
87
87
  /**
88
88
  * Create a new `DataProcessingError` detected and raised within the Fluid Framework.
89
89
  */
90
- static create(errorMessage, dataProcessingCodepath, sequencedMessage, props = {}) {
91
- const dataProcessingError = DataProcessingError.wrapIfUnrecognized(errorMessage, dataProcessingCodepath, sequencedMessage);
92
- dataProcessingError.addTelemetryProperties(props);
93
- return dataProcessingError;
90
+ static create(errorMessage, dataProcessingCodepath, sequencedMessage, props = {}, stackTraceLimit) {
91
+ const ErrorConfig = Error;
92
+ const originalStackTraceLimit = ErrorConfig.stackTraceLimit;
93
+ try {
94
+ if (stackTraceLimit !== undefined) {
95
+ ErrorConfig.stackTraceLimit = stackTraceLimit;
96
+ }
97
+ const dataProcessingError = DataProcessingError.wrapIfUnrecognized(errorMessage, dataProcessingCodepath, sequencedMessage);
98
+ dataProcessingError.addTelemetryProperties(props);
99
+ return dataProcessingError;
100
+ }
101
+ finally {
102
+ // Reset the stack trace limit to the original value
103
+ if (stackTraceLimit !== undefined) {
104
+ ErrorConfig.stackTraceLimit = originalStackTraceLimit;
105
+ }
106
+ }
94
107
  }
95
108
  /**
96
109
  * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type
package/lib/error.js.map CHANGED
@@ -1 +1 @@
1
-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mB,CAAC,sBAAsB,CAAC,eAAe,CAAC,sBAAsB,EAAE,CAAC,CAAC;YAErF,OAAO,mBAAmB,CAAC;QAC5B,CAAC;QACD,OAAO,eAAe,CAAC;IACxB,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\ttype IGenericError,\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\tsequencedMessage?: ISequencedDocumentMessage,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t): IFluidErrorBase {\n\t\tconst dataProcessingError = DataProcessingError.wrapIfUnrecognized(\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tsequencedMessage,\n\t\t);\n\t\tdataProcessingError.addTelemetryProperties(props);\n\n\t\treturn dataProcessingError;\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 * 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
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,eAAe,GAGf,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,eAAe,CAAC,YAAY,CAAC;IAiBzD,CAAC;CACD;AAED;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAG3C,YAAmB,OAAe,EAAE,KAAgC;QACnE,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAHhC,cAAS,GAAG,eAAe,CAAC,UAAU,CAAC;IAIvD,CAAC;CACD;AAED;;;;;GAKG;AACH,MAAM,OAAO,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,EAC9B,WAUC;QAED,MAAM,KAAK,GAAG;YACb,mBAAmB,EAAE,CAAC;YACtB,sBAAsB;YACtB,GAAG,CAAC,WAAW,KAAK,SAAS;gBAC5B,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,gCAAgC,CAAC,WAAW,CAAC,CAAC;SACjD,CAAC;QAEF,MAAM,eAAe,GAAG,cAAc,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACjE,uEAAuE;QACvE,0EAA0E;QAC1E,IACC,eAAe,CAAC,eAAe,CAAC;YAChC,eAAe,CAAC,SAAS,KAAK,qBAAqB,EAClD,CAAC;YACF,+DAA+D;YAC/D,MAAM,mBAAmB,GAAG,SAAS,CACpC,eAAe,EACf,CAAC,OAAe,EAAE,EAAE,CAAC,IAAI,mBAAmB,CAAC,OAAO,CAAC,CACrD,CAAC;YAEF,4FAA4F;YAC5F,mBAAmB,CAAC,sBAAsB,CAAC,eAAe,CAAC,sBAAsB,EAAE,CAAC,CAAC;YAErF,OAAO,mBAAmB,CAAC;QAC5B,CAAC;QACD,OAAO,eAAe,CAAC;IACxB,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\ttype IGenericError,\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\tsequencedMessage?: ISequencedDocumentMessage,\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\tsequencedMessage,\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 * 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"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.8"
8
+ "packageVersion": "7.50.1"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/telemetry-utils",
3
- "version": "2.30.0",
3
+ "version": "2.31.0",
4
4
  "description": "Collection of telemetry relates utilities for Fluid",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,23 +69,23 @@
69
69
  "temp-directory": "nyc/.nyc_output"
70
70
  },
71
71
  "dependencies": {
72
- "@fluid-internal/client-utils": "~2.30.0",
73
- "@fluidframework/core-interfaces": "~2.30.0",
74
- "@fluidframework/core-utils": "~2.30.0",
75
- "@fluidframework/driver-definitions": "~2.30.0",
72
+ "@fluid-internal/client-utils": "~2.31.0",
73
+ "@fluidframework/core-interfaces": "~2.31.0",
74
+ "@fluidframework/core-utils": "~2.31.0",
75
+ "@fluidframework/driver-definitions": "~2.31.0",
76
76
  "debug": "^4.3.4",
77
77
  "uuid": "^9.0.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@arethetypeswrong/cli": "^0.17.1",
81
81
  "@biomejs/biome": "~1.9.3",
82
- "@fluid-internal/mocha-test-setup": "~2.30.0",
82
+ "@fluid-internal/mocha-test-setup": "~2.31.0",
83
83
  "@fluid-tools/build-cli": "^0.54.0",
84
84
  "@fluidframework/build-common": "^2.0.3",
85
85
  "@fluidframework/build-tools": "^0.54.0",
86
86
  "@fluidframework/eslint-config-fluid": "^5.7.3",
87
- "@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.23.0",
88
- "@microsoft/api-extractor": "7.47.8",
87
+ "@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.30.0",
88
+ "@microsoft/api-extractor": "7.50.1",
89
89
  "@types/debug": "^4.1.5",
90
90
  "@types/mocha": "^10.0.10",
91
91
  "@types/node": "^18.19.0",
@@ -99,7 +99,6 @@
99
99
  "mocha": "^10.8.2",
100
100
  "mocha-multi-reporters": "^1.5.1",
101
101
  "moment": "^2.21.0",
102
- "prettier": "~3.0.3",
103
102
  "rimraf": "^4.4.0",
104
103
  "sinon": "^18.0.1",
105
104
  "typescript": "~5.4.5"
@@ -133,7 +132,6 @@
133
132
  "check:exports:esm:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.esm.json",
134
133
  "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
135
134
  "check:format": "npm run check:biome",
136
- "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
137
135
  "ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
138
136
  "ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
139
137
  "ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
@@ -143,7 +141,6 @@
143
141
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
144
142
  "format": "npm run format:biome",
145
143
  "format:biome": "biome check . --write",
146
- "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
147
144
  "lint": "fluid-build . --task lint",
148
145
  "lint:fix": "fluid-build . --task eslint:fix --task format",
149
146
  "test": "npm run test:mocha",
package/src/error.ts CHANGED
@@ -125,15 +125,29 @@ export class DataProcessingError extends LoggingError implements IErrorBase, IFl
125
125
  dataProcessingCodepath: string,
126
126
  sequencedMessage?: ISequencedDocumentMessage,
127
127
  props: ITelemetryPropertiesExt = {},
128
+ stackTraceLimit?: number,
128
129
  ): IFluidErrorBase {
129
- const dataProcessingError = DataProcessingError.wrapIfUnrecognized(
130
- errorMessage,
131
- dataProcessingCodepath,
132
- sequencedMessage,
133
- );
134
- dataProcessingError.addTelemetryProperties(props);
130
+ const ErrorConfig = Error as unknown as { stackTraceLimit: number };
131
+ const originalStackTraceLimit = ErrorConfig.stackTraceLimit;
132
+ try {
133
+ if (stackTraceLimit !== undefined) {
134
+ ErrorConfig.stackTraceLimit = stackTraceLimit;
135
+ }
136
+
137
+ const dataProcessingError = DataProcessingError.wrapIfUnrecognized(
138
+ errorMessage,
139
+ dataProcessingCodepath,
140
+ sequencedMessage,
141
+ );
142
+ dataProcessingError.addTelemetryProperties(props);
135
143
 
136
- return dataProcessingError;
144
+ return dataProcessingError;
145
+ } finally {
146
+ // Reset the stack trace limit to the original value
147
+ if (stackTraceLimit !== undefined) {
148
+ ErrorConfig.stackTraceLimit = originalStackTraceLimit;
149
+ }
150
+ }
137
151
  }
138
152
 
139
153
  /**
@@ -1,8 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- module.exports = {
7
- ...require("@fluidframework/build-common/prettier.config.cjs"),
8
- };