@fluidframework/datastore 2.71.0 → 2.73.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 +8 -21
- package/api-report/datastore.legacy.beta.api.md +2 -0
- package/dist/dataStoreLayerCompatState.js +1 -1
- package/dist/dataStoreLayerCompatState.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts +2 -0
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +62 -44
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/dataStoreLayerCompatState.js +1 -1
- package/lib/dataStoreLayerCompatState.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +2 -0
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +62 -44
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +23 -19
- package/src/dataStoreLayerCompatState.ts +1 -1
- package/src/dataStoreRuntime.ts +71 -49
- package/src/packageVersion.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @fluidframework/datastore
|
|
2
2
|
|
|
3
|
+
## 2.73.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.72.0
|
|
8
|
+
|
|
9
|
+
Dependency updates only.
|
|
10
|
+
|
|
3
11
|
## 2.71.0
|
|
4
12
|
|
|
5
13
|
Dependency updates only.
|
|
@@ -31,7 +39,6 @@ Dependency updates only.
|
|
|
31
39
|
DDSes may optionally consume this value and use it to determine which sets of feature flags should be enabled.
|
|
32
40
|
|
|
33
41
|
#### Public type changes
|
|
34
|
-
|
|
35
42
|
- **@fluidframework/datastore: `FluidDataStoreRuntime`** - Exposes `minVersionForCollab`.
|
|
36
43
|
- **@fluidframework/runtime-definitions: `IFluidDataStoreContext`** - Exposes optional member `minVersionForCollab`.
|
|
37
44
|
See `FluidDataStoreContext` for an example implementation.
|
|
@@ -128,7 +135,6 @@ Dependency updates only.
|
|
|
128
135
|
- The process and processDocumentSchemaOp functions have been removed ([#24018](https://github.com/microsoft/FluidFramework/pull/24018)) [bc35d543d5](https://github.com/microsoft/FluidFramework/commit/bc35d543d58c7e4bf28944b09d645cc26bf28a29)
|
|
129
136
|
|
|
130
137
|
`process` has been replaced by `processMessages` from the following:
|
|
131
|
-
|
|
132
138
|
- `FluidDataStoreRuntime`
|
|
133
139
|
- `IDeltaHandler`
|
|
134
140
|
- `IFluidDataStoreChannel`
|
|
@@ -170,7 +176,6 @@ Dependency updates only.
|
|
|
170
176
|
parameter.
|
|
171
177
|
|
|
172
178
|
These changes were originally announced in version 0.25.0. See the following issues for more details:
|
|
173
|
-
|
|
174
179
|
- [#1537](https://github.com/microsoft/FluidFramework/issues/1537)
|
|
175
180
|
- [#2931](https://github.com/microsoft/FluidFramework/pull/2931)
|
|
176
181
|
|
|
@@ -199,7 +204,6 @@ Dependency updates only.
|
|
|
199
204
|
Similarly, `IDeltaManager.outbound` contained functionality that could break core runtime features such as generation of batches and chunking. Data loss or corruption could occur when `IDeltaManger.inbound.pause()` or `IDeltaManager.inbound.resume()` were called.
|
|
200
205
|
|
|
201
206
|
#### Alternatives
|
|
202
|
-
|
|
203
207
|
- Alternatives to `IDeltaManager.inbound.on("op", ...)` are `IDeltaManager.on("op", ...)`
|
|
204
208
|
- Alternatives to calling `IDeltaManager.inbound.pause`, `IDeltaManager.outbound.pause` for `IContainer` disconnect use `IContainer.disconnect`.
|
|
205
209
|
- Alternatives to calling `IDeltaManager.inbound.resume`, `IDeltaManager.outbound.resume` for `IContainer` reconnect use `IContainer.connect`.
|
|
@@ -240,7 +244,6 @@ Dependency updates only.
|
|
|
240
244
|
|
|
241
245
|
Make IFluidDataStoreRuntime.deltaManager have an opaque type.
|
|
242
246
|
Marks the following types which were reachable from it as alpha:
|
|
243
|
-
|
|
244
247
|
- IConnectionDetails
|
|
245
248
|
- IDeltaSender
|
|
246
249
|
- IDeltaManagerEvents
|
|
@@ -264,7 +267,6 @@ Dependency updates only.
|
|
|
264
267
|
TypeScript types and implementation code.
|
|
265
268
|
|
|
266
269
|
This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
|
|
267
|
-
|
|
268
270
|
- `"moduleResolution": "Node16"` with `"module": "Node16"`
|
|
269
271
|
- `"moduleResolution": "Bundler"` with `"module": "ESNext"`
|
|
270
272
|
|
|
@@ -283,26 +285,21 @@ Dependency updates only.
|
|
|
283
285
|
- container-runtime: New feature: ID compression for DataStores & DDSs ([#19859](https://github.com/microsoft/FluidFramework/issues/19859)) [51f0d3db73](https://github.com/microsoft/FluidFramework/commits/51f0d3db737800e1c30ea5e3952d38ff30ffc7da)
|
|
284
286
|
|
|
285
287
|
### Key changes
|
|
286
|
-
|
|
287
288
|
1. A new API IContainerRuntimeBase.generateDocumentUniqueId() is exposed. This API will opportunistically generate IDs in short format (non-negative numbers). If it can't achieve that, it will return UUID strings. UUIDs generated will have low entropy in groups and will compress well. It can be leveraged anywhere in container where container unique IDs are required. I.e. any place that uses uuid() and stores data in container is likely candidate to start leveraging this API.
|
|
288
289
|
2. Data store internal IDs (IDs that are auto generated by FF system) will opportunistically be generated in shorter form. Data stores created in detached container will always have short IDs, data stores created in attached container will opportunistically be short (by using newly added IContainerRuntimeBase.generateDocumentUniqueId() capability)
|
|
289
290
|
3. Similar DDS names will be opportunistically short (same considerations for detached DDS vs. attached DDS)
|
|
290
291
|
|
|
291
292
|
### Implementation details
|
|
292
|
-
|
|
293
293
|
1. Container level ID Compressor can now be enabled with delay. With such setting, only new IContainerRuntimeBase.generateDocumentUniqueId() is exposed (ID Compressor is not exposed in such case, as leveraging any of its other capabilities requires future container sessions to load ID Compressor on container load, for correctness reasons). Once Container establishes connection and any changes are made in container, newly added API will start generating more compact IDs (in most cases).
|
|
294
294
|
|
|
295
295
|
### Breaking changes
|
|
296
|
-
|
|
297
296
|
1. DDS names can no longer start with "\_" symbol - this is reserved for FF needs. I've validated that's not an issue for AzureClient (it only creates root object by name, everything else is referred by handle). Our main internal partners almost never use named DDSs (I can find only 4 instances in Loop).
|
|
298
297
|
|
|
299
298
|
### Backward compatibility considerations
|
|
300
|
-
|
|
301
299
|
1. Data store internal IDs could collide with earlier used names data stores. Earlier versions of FF framework (before DataStore aliasing feature was added) allowed customers to supply IDs for data stores. And thus, files created with earlier versions of framework could have data store IDs that will be similar to names FF will use for newly created data stores ("A", ... "Z", "a"..."z", "AA", etc.). While such collision is possible, it's very unlikely (almost impossible) if user-provided names were at least 4-5 characters long.
|
|
302
300
|
2. If application runs to these problems, or wants to reduce risks, consider disabling ID compressor via IContainerRuntimeOptions.enableRuntimeIdCompressor = "off".
|
|
303
301
|
|
|
304
302
|
### Minor changes
|
|
305
|
-
|
|
306
303
|
1. IContainerRuntime.createDetachedRootDataStore() is removed. Please use IContainerRuntime.createDetachedDataStore and IDataStore.trySetAlias() instead
|
|
307
304
|
2. IContainerRuntimeOptions.enableRuntimeIdCompressor has been changes from boolean to tri-state.
|
|
308
305
|
|
|
@@ -325,7 +322,6 @@ Dependency updates only.
|
|
|
325
322
|
- Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
|
|
326
323
|
|
|
327
324
|
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)
|
|
328
|
-
|
|
329
325
|
- @fluidframework/gitresources
|
|
330
326
|
- @fluidframework/server-kafka-orderer
|
|
331
327
|
- @fluidframework/server-lambdas
|
|
@@ -399,7 +395,6 @@ Dependency updates only.
|
|
|
399
395
|
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
400
396
|
|
|
401
397
|
This included the following changes from the protocol-definitions release:
|
|
402
|
-
|
|
403
398
|
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
404
399
|
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
405
400
|
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
@@ -415,7 +410,6 @@ Dependency updates only.
|
|
|
415
410
|
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
416
411
|
|
|
417
412
|
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
418
|
-
|
|
419
413
|
- @fluidframework/gitresources: 2.0.1
|
|
420
414
|
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
421
415
|
- @fluidframework/server-lambdas: 2.0.1
|
|
@@ -440,7 +434,6 @@ Dependency updates only.
|
|
|
440
434
|
- test-utils: provideEntryPoint is required [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
441
435
|
|
|
442
436
|
The optional `provideEntryPoint` method has become required on a number of constructors. A value will need to be provided to the following classes:
|
|
443
|
-
|
|
444
437
|
- `BaseContainerRuntimeFactory`
|
|
445
438
|
- `RuntimeFactory`
|
|
446
439
|
- `ContainerRuntime` (constructor and `loadRuntime`)
|
|
@@ -477,7 +470,6 @@ Dependency updates only.
|
|
|
477
470
|
|
|
478
471
|
The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
|
|
479
472
|
imported from the **@fluidframework/core-interfaces** package:
|
|
480
|
-
|
|
481
473
|
- interface IDisposable
|
|
482
474
|
- interface IErrorEvent
|
|
483
475
|
- interface IErrorEvent
|
|
@@ -511,7 +503,6 @@ Dependency updates only.
|
|
|
511
503
|
- Request APIs deprecated from many places [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
|
|
512
504
|
|
|
513
505
|
The `request` API (associated with the `IFluidRouter` interface) has been deprecated on a number of classes and interfaces. The following are impacted:
|
|
514
|
-
|
|
515
506
|
- `IRuntime` and `ContainerRuntime`
|
|
516
507
|
- `IFluidDataStoreRuntime` and `FluidDataStoreRuntime`
|
|
517
508
|
- `IFluidDataStoreChannel`
|
|
@@ -527,7 +518,6 @@ Dependency updates only.
|
|
|
527
518
|
- `initializeEntryPoint` will become required [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
|
|
528
519
|
|
|
529
520
|
The optional `initializeEntryPoint` method has been added to a number of constructors. **This method argument will become required in an upcoming release** and a value will need to be provided to the following classes:
|
|
530
|
-
|
|
531
521
|
- `BaseContainerRuntimeFactory`
|
|
532
522
|
- `ContainerRuntimeFactoryWithDefaultDataStore`
|
|
533
523
|
- `RuntimeFactory`
|
|
@@ -572,7 +562,6 @@ Dependency updates only.
|
|
|
572
562
|
|
|
573
563
|
- The `@fluidframework/garbage-collector` package was deprecated in version 2.0.0-internal.4.1.0. [8b242fdc79](https://github.com/microsoft/FluidFramework/commits/8b242fdc796714cf1da9ad3f90d02efb122af0c2)
|
|
574
564
|
It has now been removed with the following functions, interfaces, and types in it.
|
|
575
|
-
|
|
576
565
|
- `cloneGCData`
|
|
577
566
|
- `concatGarbageCollectionData`
|
|
578
567
|
- `concatGarbageCollectionStates`
|
|
@@ -598,7 +587,6 @@ Dependency updates only.
|
|
|
598
587
|
- GC interfaces removed from runtime-definitions ([#14750](https://github.com/microsoft/FluidFramework/pull-requests/14750)) [60274eacab](https://github.com/microsoft/FluidFramework/commits/60274eacabf14d42f52f6ad1c2f64356e64ba1a2)
|
|
599
588
|
|
|
600
589
|
The following interfaces available in `@fluidframework/runtime-definitions` are internal implementation details and have been deprecated for public use. They will be removed in an upcoming release.
|
|
601
|
-
|
|
602
590
|
- `IGarbageCollectionNodeData`
|
|
603
591
|
- `IGarbageCollectionState`
|
|
604
592
|
- `IGarbageCollectionSnapshotData`
|
|
@@ -609,7 +597,6 @@ Dependency updates only.
|
|
|
609
597
|
The `@fluidframework/garbage-collector` package is deprecated with the following functions, interfaces, and types in it.
|
|
610
598
|
These are internal implementation details and have been deprecated for public use. They will be removed in an upcoming
|
|
611
599
|
release.
|
|
612
|
-
|
|
613
600
|
- `cloneGCData`
|
|
614
601
|
- `concatGarbageCollectionData`
|
|
615
602
|
- `concatGarbageCollectionStates`
|
|
@@ -17,6 +17,8 @@ export class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRunt
|
|
|
17
17
|
constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>, policies?: Partial<IFluidDataStorePolicies>);
|
|
18
18
|
// (undocumented)
|
|
19
19
|
get absolutePath(): string;
|
|
20
|
+
// (undocumented)
|
|
21
|
+
get activeLocalOperationActivity(): "applyStashed" | "rollback" | undefined;
|
|
20
22
|
addChannel(channel: IChannel): void;
|
|
21
23
|
// (undocumented)
|
|
22
24
|
applyStashedOp(content: any): Promise<unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreLayerCompatState.js","sourceRoot":"","sources":["../src/dataStoreLayerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,uEAGkD;AAElD,2DAAiD;AAEjD;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACzC;;OAEG;IACH,UAAU,EAAV,8BAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACb,CAAC;AAEF;;;GAGG;AACU,QAAA,gCAAgC,GAAwB;IACpE,GAAG,kCAA0B;IAC7B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACU,QAAA,sCAAsC,GAAoC;IACtF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,SAAgB,4BAA4B,CAC3C,yBAA0D,EAC1D,SAAqB,EACrB,MAA2B;IAE3B,IAAA,qCAA0B,EACzB,WAAW,EACX,SAAS,EACT,wCAAgC,EAChC,8CAAsC,EACtC,yBAAyB,EACzB,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC;AAdD,oEAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the DataStore layer that is the same across all layer boundaries.\n * @internal\n */\nexport const dataStoreCoreCompatDetails = {\n\t/**\n\t * The package version of the Runtime layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Runtime layer.\n\t */\n\tgeneration:
|
|
1
|
+
{"version":3,"file":"dataStoreLayerCompatState.js","sourceRoot":"","sources":["../src/dataStoreLayerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,uEAGkD;AAElD,2DAAiD;AAEjD;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACzC;;OAEG;IACH,UAAU,EAAV,8BAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACb,CAAC;AAEF;;;GAGG;AACU,QAAA,gCAAgC,GAAwB;IACpE,GAAG,kCAA0B;IAC7B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACU,QAAA,sCAAsC,GAAoC;IACtF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,SAAgB,4BAA4B,CAC3C,yBAA0D,EAC1D,SAAqB,EACrB,MAA2B;IAE3B,IAAA,qCAA0B,EACzB,WAAW,EACX,SAAS,EACT,wCAAgC,EAChC,8CAAsC,EACtC,yBAAyB,EACzB,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC;AAdD,oEAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the DataStore layer that is the same across all layer boundaries.\n * @internal\n */\nexport const dataStoreCoreCompatDetails = {\n\t/**\n\t * The package version of the Runtime layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Runtime layer.\n\t */\n\tgeneration: 2,\n};\n\n/**\n * DataStore's compatibility details that is exposed to the Runtime layer.\n * @internal\n */\nexport const dataStoreCompatDetailsForRuntime: ILayerCompatDetails = {\n\t...dataStoreCoreCompatDetails,\n\t/**\n\t * The features supported by the DataStore layer across the DataStore / Runtime boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Runtime layer must meet to be compatible with this DataStore.\n * @internal\n */\nexport const runtimeSupportRequirementsForDataStore: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Runtime must be at to be compatible with DataStore. Note that 0 is used here so\n\t * that Runtime layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Runtime must support to be compatible with DataStore.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Runtime layer is compatible with this DataStore.\n * @internal\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"dataStore\",\n\t\t\"runtime\",\n\t\tdataStoreCompatDetailsForRuntime,\n\t\truntimeSupportRequirementsForDataStore,\n\t\tmaybeRuntimeCompatDetails,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n"]}
|
|
@@ -68,6 +68,8 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
68
68
|
get rootRoutingContext(): this;
|
|
69
69
|
get channelsRoutingContext(): this;
|
|
70
70
|
get objectsRoutingContext(): this;
|
|
71
|
+
private localOpActivity;
|
|
72
|
+
get activeLocalOperationActivity(): "applyStashed" | "rollback" | undefined;
|
|
71
73
|
private _disposed;
|
|
72
74
|
get disposed(): boolean;
|
|
73
75
|
private readonly contexts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAA4B,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACX,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,0CAA0C,CAAC;AAQlD,OAAO,KAAK,EACX,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EAEnB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,KAAK,cAAc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O,EAAE,GAAG,EACZ,eAAe,EAAE,OAAO,GACtB,IAAI;IAgCM,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAqD3D;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,eAAe;IAMvB;;;;OAIG;IACH,OAAO,CAAC,+BAA+B;IAyBhC,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,QAAQ,GAAG,IAAI;CA+CtF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,mBACf,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,QAAQ,SAAS,CAAC,SACnF,4BAA4B,KAChC,4BAS+B,CAAC;AAEnC;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,YACtB,CACR,OAAO,EAAE,qBAAqB,KAC1B,QAAQ;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,SACvD,4BAA4B,KAChC,4BAyC+B,CAAC"}
|
package/dist/dataStoreRuntime.js
CHANGED
|
@@ -94,6 +94,9 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
94
94
|
get objectsRoutingContext() {
|
|
95
95
|
return this;
|
|
96
96
|
}
|
|
97
|
+
get activeLocalOperationActivity() {
|
|
98
|
+
return this.localOpActivity;
|
|
99
|
+
}
|
|
97
100
|
get disposed() {
|
|
98
101
|
return this._disposed;
|
|
99
102
|
}
|
|
@@ -119,6 +122,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
119
122
|
* {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.isReadOnly}
|
|
120
123
|
*/
|
|
121
124
|
this.isReadOnly = () => this._readonly;
|
|
125
|
+
this.localOpActivity = undefined;
|
|
122
126
|
this._disposed = false;
|
|
123
127
|
this.contexts = new Map();
|
|
124
128
|
this.pendingAttach = new Set();
|
|
@@ -884,60 +888,74 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
884
888
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
885
889
|
content, localOpMetadata) {
|
|
886
890
|
this.verifyNotClosed();
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
891
|
+
(0, internal_1.assert)(!this.localOpActivity, 0xca2 /* localOpActivity must be undefined when entering rollback */);
|
|
892
|
+
this.localOpActivity = "rollback";
|
|
893
|
+
try {
|
|
894
|
+
// The op being rolled back was not/will not be submitted, so decrement the count.
|
|
895
|
+
--this.pendingOpCount.value;
|
|
896
|
+
switch (type) {
|
|
897
|
+
case DataStoreMessageType.ChannelOp: {
|
|
898
|
+
// For Operations, find the right channel and trigger resubmission on it.
|
|
899
|
+
const envelope = content;
|
|
900
|
+
const channelContext = this.contexts.get(envelope.address);
|
|
901
|
+
(0, internal_1.assert)(!!channelContext, 0x2ed /* "There should be a channel context for the op" */);
|
|
902
|
+
channelContext.rollback(envelope.contents, localOpMetadata);
|
|
903
|
+
break;
|
|
904
|
+
}
|
|
905
|
+
default: {
|
|
906
|
+
throw new internal_5.LoggingError(`Can't rollback ${type} message`);
|
|
907
|
+
}
|
|
900
908
|
}
|
|
901
909
|
}
|
|
910
|
+
finally {
|
|
911
|
+
this.localOpActivity = undefined;
|
|
912
|
+
}
|
|
902
913
|
}
|
|
903
914
|
// TODO: use something other than `any` here
|
|
904
915
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
905
916
|
async applyStashedOp(content) {
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
917
|
+
(0, internal_1.assert)(!this.localOpActivity, 0xca3 /* localOpActivity must be undefined when entering applyStashedOp */);
|
|
918
|
+
this.localOpActivity = "applyStashed";
|
|
919
|
+
try {
|
|
920
|
+
// The op being applied may have been submitted in a previous session, so we increment the count here.
|
|
921
|
+
// Either the ack will arrive and be processed, or that previous session's connection will end, at which point the op will be resubmitted.
|
|
922
|
+
++this.pendingOpCount.value;
|
|
923
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
924
|
+
const type = content?.type;
|
|
925
|
+
switch (type) {
|
|
926
|
+
case DataStoreMessageType.Attach: {
|
|
927
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
928
|
+
const attachMessage = content.content;
|
|
929
|
+
const flatBlobs = new Map();
|
|
930
|
+
const snapshotTree = (0, internal_2.buildSnapshotTree)(attachMessage.snapshot.entries, flatBlobs);
|
|
931
|
+
const channelContext = this.createRehydratedLocalChannelContext(attachMessage.id, snapshotTree, flatBlobs);
|
|
932
|
+
await channelContext.getChannel();
|
|
933
|
+
this.contexts.set(attachMessage.id, channelContext);
|
|
934
|
+
if (this.attachState === container_definitions_1.AttachState.Detached) {
|
|
935
|
+
this.localChannelContextQueue.set(attachMessage.id, channelContext);
|
|
936
|
+
}
|
|
937
|
+
else {
|
|
938
|
+
channelContext.makeVisible();
|
|
939
|
+
this.pendingAttach.add(attachMessage.id);
|
|
940
|
+
}
|
|
941
|
+
return;
|
|
922
942
|
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
943
|
+
case DataStoreMessageType.ChannelOp: {
|
|
944
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
945
|
+
const envelope = content.content;
|
|
946
|
+
const channelContext = this.contexts.get(envelope.address);
|
|
947
|
+
(0, internal_1.assert)(!!channelContext, 0x184 /* "There should be a channel context for the op" */);
|
|
948
|
+
await channelContext.getChannel();
|
|
949
|
+
return channelContext.applyStashedOp(envelope.contents);
|
|
950
|
+
}
|
|
951
|
+
default: {
|
|
952
|
+
(0, internal_1.unreachableCase)(type);
|
|
926
953
|
}
|
|
927
|
-
return;
|
|
928
|
-
}
|
|
929
|
-
case DataStoreMessageType.ChannelOp: {
|
|
930
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
931
|
-
const envelope = content.content;
|
|
932
|
-
const channelContext = this.contexts.get(envelope.address);
|
|
933
|
-
(0, internal_1.assert)(!!channelContext, 0x184 /* "There should be a channel context for the op" */);
|
|
934
|
-
await channelContext.getChannel();
|
|
935
|
-
return channelContext.applyStashedOp(envelope.contents);
|
|
936
|
-
}
|
|
937
|
-
default: {
|
|
938
|
-
(0, internal_1.unreachableCase)(type);
|
|
939
954
|
}
|
|
940
955
|
}
|
|
956
|
+
finally {
|
|
957
|
+
this.localOpActivity = undefined;
|
|
958
|
+
}
|
|
941
959
|
}
|
|
942
960
|
/**
|
|
943
961
|
* Indicates the given channel is dirty from Summarizer's point of view,
|