@fluidframework/container-runtime 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.203917
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 +119 -0
- package/api-extractor.json +1 -1
- package/api-report/container-runtime.api.md +864 -0
- package/dist/blobManager.d.ts +4 -4
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +55 -71
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +75 -42
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +1742 -0
- package/dist/container-runtime-beta.d.ts +1742 -0
- package/dist/container-runtime-public.d.ts +1742 -0
- package/dist/container-runtime-untrimmed.d.ts +1803 -0
- package/dist/containerHandleContext.js +3 -3
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +88 -98
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +466 -453
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +11 -11
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -4
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +60 -59
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +3 -0
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +6 -3
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.js +1 -1
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.js +4 -4
- package/dist/deltaManagerProxyBase.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +6 -6
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +23 -24
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.js +1 -1
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +34 -24
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +10 -7
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
- package/dist/gc/gcSummaryDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +2 -2
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +5 -5
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +3 -3
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -3
- package/dist/gc/index.js.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +3 -3
- package/dist/id-compressor/identifiers.d.ts.map +1 -1
- package/dist/id-compressor/utilities.d.ts +3 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -1
- package/dist/id-compressor/utilities.js +3 -0
- package/dist/id-compressor/utilities.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +137 -0
- package/dist/messageTypes.d.ts.map +1 -0
- package/dist/messageTypes.js +32 -0
- package/dist/messageTypes.js.map +1 -0
- package/dist/opLifecycle/batchManager.js +6 -6
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +7 -3
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +0 -4
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js +3 -3
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +7 -2
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +17 -3
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +38 -25
- package/dist/opLifecycle/remoteMessageProcessor.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/dist/pendingStateManager.d.ts +4 -20
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +36 -46
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.js +6 -2
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +7 -4
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +54 -54
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +7 -6
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +40 -38
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +2 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +18 -8
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.js +6 -6
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +9 -9
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +8 -8
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +107 -22
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +18 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +23 -21
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +15 -6
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +3 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +2 -2
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +10 -10
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.js +16 -16
- package/dist/throttler.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/blobManager.d.ts +4 -4
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +56 -72
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +76 -43
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.js +3 -3
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +88 -98
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +424 -416
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +11 -11
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -4
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +60 -59
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +3 -0
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +6 -3
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.js +1 -1
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.js +4 -4
- package/lib/deltaManagerProxyBase.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js +6 -6
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +23 -24
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.js +2 -2
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +34 -24
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +9 -6
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +2 -2
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +5 -5
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +3 -3
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/identifiers.d.ts +3 -3
- package/lib/id-compressor/identifiers.d.ts.map +1 -1
- package/lib/id-compressor/utilities.d.ts +3 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -1
- package/lib/id-compressor/utilities.js +3 -0
- package/lib/id-compressor/utilities.js.map +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +137 -0
- package/lib/messageTypes.d.ts.map +1 -0
- package/lib/messageTypes.js +29 -0
- package/lib/messageTypes.js.map +1 -0
- package/lib/opLifecycle/batchManager.js +6 -6
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +7 -3
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +0 -4
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -2
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +17 -3
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +37 -24
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +4 -20
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +35 -45
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.js +6 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +7 -4
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +54 -54
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +7 -6
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +40 -38
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +2 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +19 -9
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.js +6 -6
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +9 -9
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +8 -8
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +107 -22
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +18 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +23 -21
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +15 -6
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +3 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +2 -2
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +9 -9
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.js +16 -16
- package/lib/throttler.js.map +1 -1
- package/package.json +27 -28
- package/src/blobManager.ts +64 -77
- package/src/connectionTelemetry.ts +97 -52
- package/src/containerRuntime.ts +337 -341
- package/src/dataStore.ts +3 -3
- package/src/dataStoreContext.ts +7 -7
- package/src/dataStoreRegistry.ts +3 -0
- package/src/dataStores.ts +1 -1
- package/src/error.ts +4 -1
- package/src/gc/garbageCollection.ts +12 -11
- package/src/gc/gcConfigs.ts +3 -3
- package/src/gc/gcDefinitions.ts +35 -25
- package/src/gc/gcSummaryDefinitions.ts +1 -1
- package/src/gc/gcTelemetry.ts +6 -5
- package/src/gc/index.ts +2 -2
- package/src/id-compressor/utilities.ts +3 -0
- package/src/index.ts +21 -5
- package/src/messageTypes.ts +228 -0
- package/src/opLifecycle/README.md +93 -68
- package/src/opLifecycle/definitions.ts +5 -1
- package/src/opLifecycle/opDecompressor.ts +0 -8
- package/src/opLifecycle/opGroupingManager.ts +2 -4
- package/src/opLifecycle/opSplitter.ts +2 -2
- package/src/opLifecycle/outbox.ts +3 -0
- package/src/opLifecycle/remoteMessageProcessor.ts +54 -33
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +31 -52
- package/src/scheduleManager.ts +2 -0
- package/src/summary/orderedClientElection.ts +4 -1
- package/src/summary/runWhileConnectedCoordinator.ts +5 -1
- package/src/summary/runningSummarizer.ts +3 -1
- package/src/summary/summarizer.ts +21 -7
- package/src/summary/summarizerNode/summarizerNode.ts +1 -1
- package/src/summary/summarizerTypes.ts +96 -11
- package/src/summary/summaryCollection.ts +19 -1
- package/src/summary/summaryFormat.ts +11 -1
- package/src/summary/summaryGenerator.ts +3 -3
- package/src/summary/summaryManager.ts +2 -2
- package/src/gc/gcEarlyAdoption.md +0 -145
package/src/dataStore.ts
CHANGED
|
@@ -161,7 +161,7 @@ class DataStore implements IDataStore {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
|
-
* @deprecated
|
|
164
|
+
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
165
165
|
*/
|
|
166
166
|
public async request(request: IRequest): Promise<IResponse> {
|
|
167
167
|
return this.fluidDataStoreChannel.request(request);
|
|
@@ -170,7 +170,7 @@ class DataStore implements IDataStore {
|
|
|
170
170
|
/**
|
|
171
171
|
* {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}
|
|
172
172
|
*/
|
|
173
|
-
get entryPoint(): IFluidHandle<FluidObject>
|
|
173
|
+
get entryPoint(): IFluidHandle<FluidObject> {
|
|
174
174
|
return this.fluidDataStoreChannel.entryPoint;
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -185,7 +185,7 @@ class DataStore implements IDataStore {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
|
-
* @deprecated
|
|
188
|
+
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
189
189
|
*/
|
|
190
190
|
public get IFluidRouter() {
|
|
191
191
|
return this.fluidDataStoreChannel;
|
package/src/dataStoreContext.ts
CHANGED
|
@@ -458,6 +458,11 @@ export abstract class FluidDataStoreContext
|
|
|
458
458
|
const channel = await factory.instantiateDataStore(this, existing);
|
|
459
459
|
assert(channel !== undefined, 0x140 /* "undefined channel on datastore context" */);
|
|
460
460
|
this.bindRuntime(channel);
|
|
461
|
+
// This data store may have been disposed before the channel is created during realization. If so,
|
|
462
|
+
// dispose the channel now.
|
|
463
|
+
if (this.disposed) {
|
|
464
|
+
channel.dispose();
|
|
465
|
+
}
|
|
461
466
|
}
|
|
462
467
|
|
|
463
468
|
/**
|
|
@@ -740,11 +745,6 @@ export abstract class FluidDataStoreContext
|
|
|
740
745
|
this.makeLocallyVisibleFn();
|
|
741
746
|
}
|
|
742
747
|
|
|
743
|
-
/** @deprecated - To be replaced by calling makeLocallyVisible directly */
|
|
744
|
-
public bindToContext() {
|
|
745
|
-
this.makeLocallyVisibleFn();
|
|
746
|
-
}
|
|
747
|
-
|
|
748
748
|
protected bindRuntime(channel: IFluidDataStoreChannel) {
|
|
749
749
|
if (this.channel) {
|
|
750
750
|
throw new Error("Runtime already bound");
|
|
@@ -820,7 +820,7 @@ export abstract class FluidDataStoreContext
|
|
|
820
820
|
}
|
|
821
821
|
|
|
822
822
|
/**
|
|
823
|
-
* @deprecated
|
|
823
|
+
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
824
824
|
*/
|
|
825
825
|
public async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {
|
|
826
826
|
return {};
|
|
@@ -1206,7 +1206,7 @@ export class LocalDetachedFluidDataStoreContext
|
|
|
1206
1206
|
// of data store factories tends to construct the data object (at least kick off an async method that returns
|
|
1207
1207
|
// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes
|
|
1208
1208
|
// before the data store is attached.
|
|
1209
|
-
await dataStoreChannel.entryPoint
|
|
1209
|
+
await dataStoreChannel.entryPoint.get();
|
|
1210
1210
|
|
|
1211
1211
|
if (await this.isRoot()) {
|
|
1212
1212
|
dataStoreChannel.makeVisibleAndAttachGraph();
|
package/src/dataStoreRegistry.ts
CHANGED
package/src/dataStores.ts
CHANGED
|
@@ -212,7 +212,7 @@ export class DataStores implements IDisposable {
|
|
|
212
212
|
|
|
213
213
|
public async waitIfPendingAlias(maybeAlias: string): Promise<AliasResult> {
|
|
214
214
|
const pendingAliasPromise = this.pendingAliases.get(maybeAlias);
|
|
215
|
-
return pendingAliasPromise
|
|
215
|
+
return pendingAliasPromise ?? "Success";
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
public processAttachMessage(message: ISequencedDocumentMessage, local: boolean) {
|
package/src/error.ts
CHANGED
|
@@ -12,7 +12,10 @@ import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
|
|
|
12
12
|
export class ClientSessionExpiredError extends LoggingError implements IFluidErrorBase {
|
|
13
13
|
readonly errorType = ContainerErrorTypes.clientSessionExpiredError;
|
|
14
14
|
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
message: string,
|
|
17
|
+
readonly expiryMs: number,
|
|
18
|
+
) {
|
|
16
19
|
super(message, { timeoutMs: expiryMs });
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -287,15 +287,13 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
287
287
|
return { gcData: { gcNodes }, usedRoutes };
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
-
// Log all the GC options and the state determined by the garbage collector.
|
|
291
|
-
//
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
});
|
|
298
|
-
}
|
|
290
|
+
// Log all the GC options and the state determined by the garbage collector.
|
|
291
|
+
// This is useful even for interactive clients since they track unreferenced nodes and log errors.
|
|
292
|
+
this.mc.logger.sendTelemetryEvent({
|
|
293
|
+
eventName: "GarbageCollectorLoaded",
|
|
294
|
+
gcConfigs: JSON.stringify(this.configs),
|
|
295
|
+
gcOptions: JSON.stringify(createParams.gcOptions),
|
|
296
|
+
});
|
|
299
297
|
}
|
|
300
298
|
|
|
301
299
|
/**
|
|
@@ -883,8 +881,11 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
883
881
|
viaHandle: requestHeaders?.[RuntimeHeaders.viaHandle],
|
|
884
882
|
});
|
|
885
883
|
|
|
886
|
-
// Unless this is a Loaded event, we're done after telemetry tracking
|
|
887
|
-
if (
|
|
884
|
+
// Unless this is a Loaded event for a Blob or DataStore, we're done after telemetry tracking
|
|
885
|
+
if (
|
|
886
|
+
reason !== "Loaded" ||
|
|
887
|
+
![GCNodeType.Blob, GCNodeType.DataStore].includes(this.runtime.getNodeType(nodePath))
|
|
888
|
+
) {
|
|
888
889
|
return;
|
|
889
890
|
}
|
|
890
891
|
|
package/src/gc/gcConfigs.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { MonitoringContext, UsageError } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { IContainerRuntimeMetadata } from "../summary";
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
nextGCVersion,
|
|
10
10
|
defaultInactiveTimeoutMs,
|
|
11
11
|
defaultSessionExpiryDurationMs,
|
|
12
12
|
disableTombstoneKey,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
gcTestModeKey,
|
|
16
16
|
gcTombstoneGenerationOptionName,
|
|
17
17
|
GCVersion,
|
|
18
|
-
|
|
18
|
+
gcVersionUpgradeToV4Key,
|
|
19
19
|
IGarbageCollectorConfigs,
|
|
20
20
|
IGCRuntimeOptions,
|
|
21
21
|
maxSnapshotCacheExpiryMs,
|
|
@@ -107,7 +107,7 @@ export function generateGCConfigs(
|
|
|
107
107
|
|
|
108
108
|
// If version upgrade is not enabled, fall back to the stable GC version.
|
|
109
109
|
const gcVersionInEffect =
|
|
110
|
-
mc.config.getBoolean(
|
|
110
|
+
mc.config.getBoolean(gcVersionUpgradeToV4Key) === true ? nextGCVersion : stableGCVersion;
|
|
111
111
|
|
|
112
112
|
// The GC version is up-to-date if the GC version in effect is at least equal to the GC version in base snapshot.
|
|
113
113
|
// If it is not up-to-date, there is a newer version of GC out there which is more reliable than this. So, GC
|
package/src/gc/gcDefinitions.ts
CHANGED
|
@@ -20,12 +20,15 @@ import {
|
|
|
20
20
|
IRefreshSummaryResult,
|
|
21
21
|
} from "../summary";
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
23
26
|
export type GCVersion = number;
|
|
24
27
|
|
|
25
|
-
/** The stable version of
|
|
26
|
-
export const stableGCVersion: GCVersion =
|
|
27
|
-
/** The
|
|
28
|
-
export const
|
|
28
|
+
/** The stable/default version of GC Data */
|
|
29
|
+
export const stableGCVersion: GCVersion = 3;
|
|
30
|
+
/** The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files. */
|
|
31
|
+
export const nextGCVersion: GCVersion = 4;
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
34
|
* This undocumented GC Option (on ContainerRuntime Options) allows an app to disable enforcing GC on old documents by incrementing this value
|
|
@@ -60,7 +63,7 @@ export const throwOnTombstoneLoadKey = "Fluid.GarbageCollection.ThrowOnTombstone
|
|
|
60
63
|
/** Config key to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops). */
|
|
61
64
|
export const throwOnTombstoneUsageKey = "Fluid.GarbageCollection.ThrowOnTombstoneUsage";
|
|
62
65
|
/** Config key to enable GC version upgrade. */
|
|
63
|
-
export const
|
|
66
|
+
export const gcVersionUpgradeToV4Key = "Fluid.GarbageCollection.GCVersionUpgradeToV4";
|
|
64
67
|
/** Config key to disable GC sweep for datastores. */
|
|
65
68
|
export const disableDatastoreSweepKey = "Fluid.GarbageCollection.DisableDataStoreSweep";
|
|
66
69
|
/** Config key to disable GC sweep for attachment blobs. */
|
|
@@ -80,7 +83,10 @@ export const maxSnapshotCacheExpiryMs = 5 * oneDayMs;
|
|
|
80
83
|
export const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days
|
|
81
84
|
export const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days
|
|
82
85
|
|
|
83
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* @see IGCMetadata.gcFeatureMatrix
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
84
90
|
export interface GCFeatureMatrix {
|
|
85
91
|
/**
|
|
86
92
|
* The Tombstone Generation value in effect when this file was created.
|
|
@@ -96,6 +102,9 @@ export interface GCFeatureMatrix {
|
|
|
96
102
|
sweepGeneration?: number;
|
|
97
103
|
}
|
|
98
104
|
|
|
105
|
+
/**
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
99
108
|
export interface IGCMetadata {
|
|
100
109
|
/**
|
|
101
110
|
* The version of the GC code that was run to generate the GC data that is written in the summary.
|
|
@@ -119,11 +128,11 @@ export interface IGCMetadata {
|
|
|
119
128
|
*/
|
|
120
129
|
readonly gcFeatureMatrix?: GCFeatureMatrix;
|
|
121
130
|
/**
|
|
122
|
-
* @deprecated - @see GCFeatureMatrix.sweepGeneration
|
|
123
|
-
*
|
|
124
131
|
* Tells whether the GC sweep phase is enabled for this container.
|
|
125
132
|
* - True means sweep phase is enabled.
|
|
126
133
|
* - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.
|
|
134
|
+
*
|
|
135
|
+
* @deprecated use GCFeatureMatrix.sweepGeneration instead. @see GCFeatureMatrix.sweepGeneration
|
|
127
136
|
*/
|
|
128
137
|
readonly sweepEnabled?: boolean;
|
|
129
138
|
/** If this is present, the session for this container will expire after this time and the container will close */
|
|
@@ -132,7 +141,10 @@ export interface IGCMetadata {
|
|
|
132
141
|
readonly sweepTimeoutMs?: number;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* The statistics of the system state after a garbage collection run.
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
136
148
|
export interface IGCStats {
|
|
137
149
|
/** The number of nodes in the container. */
|
|
138
150
|
nodeCount: number;
|
|
@@ -154,7 +166,10 @@ export interface IGCStats {
|
|
|
154
166
|
updatedAttachmentBlobCount: number;
|
|
155
167
|
}
|
|
156
168
|
|
|
157
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* The types of GC nodes in the GC reference graph.
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
158
173
|
export const GCNodeType = {
|
|
159
174
|
// Nodes that are for data stores.
|
|
160
175
|
DataStore: "DataStore",
|
|
@@ -165,7 +180,11 @@ export const GCNodeType = {
|
|
|
165
180
|
// Nodes that are neither of the above. For example, root node.
|
|
166
181
|
Other: "Other",
|
|
167
182
|
};
|
|
168
|
-
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
|
|
169
188
|
|
|
170
189
|
/**
|
|
171
190
|
* Defines the APIs for the runtime object to be passed to the garbage collector.
|
|
@@ -260,6 +279,9 @@ export interface IGarbageCollectorCreateParams {
|
|
|
260
279
|
readonly activeConnection: () => boolean;
|
|
261
280
|
}
|
|
262
281
|
|
|
282
|
+
/**
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
263
285
|
export interface IGCRuntimeOptions {
|
|
264
286
|
/**
|
|
265
287
|
* Flag that if true, will enable running garbage collection (GC) for a new container.
|
|
@@ -267,24 +289,12 @@ export interface IGCRuntimeOptions {
|
|
|
267
289
|
* GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified
|
|
268
290
|
* and marked as such in the summary. This option enables the mark phase.
|
|
269
291
|
* In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
|
|
270
|
-
* Sweep phase can be enabled
|
|
292
|
+
* Sweep phase can be enabled using the "gcSweepGeneration" option.
|
|
271
293
|
*
|
|
272
294
|
* Note: This setting is persisted in the container's summary and cannot be changed.
|
|
273
295
|
*/
|
|
274
296
|
gcAllowed?: boolean;
|
|
275
297
|
|
|
276
|
-
/**
|
|
277
|
-
* @deprecated - @see gcSweepGenerationOptionName and @see GCFeatureMatrix.sweepGeneration
|
|
278
|
-
*
|
|
279
|
-
* Flag that if true, enables GC's sweep phase for a new container.
|
|
280
|
-
*
|
|
281
|
-
* This will allow GC to eventually delete unreferenced objects from the container.
|
|
282
|
-
* This flag should only be set to true if "gcAllowed" is true.
|
|
283
|
-
*
|
|
284
|
-
* Note: This setting is persisted in the container's summary and cannot be changed.
|
|
285
|
-
*/
|
|
286
|
-
sweepAllowed?: boolean;
|
|
287
|
-
|
|
288
298
|
/**
|
|
289
299
|
* Flag that if true, will disable garbage collection for the session.
|
|
290
300
|
* Can be used to disable running GC on containers where it is allowed via the gcAllowed option.
|
|
@@ -372,7 +382,7 @@ export const UnreferencedState = {
|
|
|
372
382
|
/** The node is ready to be deleted by the sweep phase. */
|
|
373
383
|
SweepReady: "SweepReady",
|
|
374
384
|
} as const;
|
|
375
|
-
export type UnreferencedState = typeof UnreferencedState[keyof typeof UnreferencedState];
|
|
385
|
+
export type UnreferencedState = (typeof UnreferencedState)[keyof typeof UnreferencedState];
|
|
376
386
|
|
|
377
387
|
/**
|
|
378
388
|
* Represents the result of a GC run.
|
|
@@ -41,7 +41,7 @@ export interface IGarbageCollectionSnapshotData {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* @deprecated
|
|
44
|
+
* @deprecated IGarbageCollectionState is written in the root of the summary now.
|
|
45
45
|
* Legacy GC details from when the GC details were written at the data store's summary tree.
|
|
46
46
|
*/
|
|
47
47
|
export interface IGarbageCollectionSummaryDetailsLegacy {
|
package/src/gc/gcTelemetry.ts
CHANGED
|
@@ -96,7 +96,7 @@ export class GCTelemetryTracker {
|
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
98
|
* Returns whether an event should be logged for a node that isn't active anymore. Some scenarios where we won't log:
|
|
99
|
-
* 1. When a DDS is changed
|
|
99
|
+
* 1. When a DDS is changed. The corresponding data store's event will be logged instead.
|
|
100
100
|
* 2. An event is logged only once per container instance per event per node.
|
|
101
101
|
*/
|
|
102
102
|
private shouldLogNonActiveEvent(
|
|
@@ -110,12 +110,13 @@ export class GCTelemetryTracker {
|
|
|
110
110
|
return false;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
// so skip logging to make the telemetry less noisy.
|
|
115
|
-
if (nodeType === GCNodeType.SubDataStore && usageType !== "Revived") {
|
|
113
|
+
if (nodeType === GCNodeType.Other) {
|
|
116
114
|
return false;
|
|
117
115
|
}
|
|
118
|
-
|
|
116
|
+
|
|
117
|
+
// For sub data store (DDS) nodes, if they are changed, its data store will also be changed,
|
|
118
|
+
// so skip logging to make the telemetry less noisy.
|
|
119
|
+
if (nodeType === GCNodeType.SubDataStore && usageType === "Changed") {
|
|
119
120
|
return false;
|
|
120
121
|
}
|
|
121
122
|
|
package/src/gc/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
export { GarbageCollector } from "./garbageCollection";
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
nextGCVersion,
|
|
9
9
|
defaultInactiveTimeoutMs,
|
|
10
10
|
defaultSessionExpiryDurationMs,
|
|
11
11
|
disableSweepLogKey,
|
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
gcSweepGenerationOptionName,
|
|
16
16
|
GCFeatureMatrix,
|
|
17
17
|
GCVersion,
|
|
18
|
-
|
|
18
|
+
gcVersionUpgradeToV4Key,
|
|
19
19
|
IGarbageCollectionRuntime,
|
|
20
20
|
IGarbageCollector,
|
|
21
21
|
IGarbageCollectorConfigs,
|
|
@@ -35,6 +35,7 @@ export function createSessionId(): SessionId {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Asserts that the given string is a stable ID.
|
|
38
|
+
* @public
|
|
38
39
|
*/
|
|
39
40
|
export function assertIsStableId(stableId: string): StableId {
|
|
40
41
|
assert(isStableId(stableId), 0x4a3 /* Expected a StableId */);
|
|
@@ -51,6 +52,7 @@ export function assertIsSessionId(stableId: string): SessionId {
|
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* Generate a random stable ID
|
|
55
|
+
* @public
|
|
54
56
|
*/
|
|
55
57
|
export function generateStableId(): StableId {
|
|
56
58
|
return assertIsStableId(v4());
|
|
@@ -59,6 +61,7 @@ export function generateStableId(): StableId {
|
|
|
59
61
|
/**
|
|
60
62
|
* Returns true iff the given string is a valid Version 4, variant 2 UUID
|
|
61
63
|
* 'xxxxxxxx-xxxx-4xxx-vxxx-xxxxxxxxxxxx'
|
|
64
|
+
* @public
|
|
62
65
|
*/
|
|
63
66
|
export function isStableId(str: string): str is StableId {
|
|
64
67
|
if (str.length !== 36) {
|
package/src/index.ts
CHANGED
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
ContainerMessageType,
|
|
8
|
-
ContainerRuntimeMessage,
|
|
9
|
-
IContainerRuntimeMessageCompatDetails,
|
|
10
|
-
CompatModeBehavior,
|
|
11
7
|
ISummaryRuntimeOptions,
|
|
12
8
|
ISummaryBaseConfiguration,
|
|
13
9
|
ISummaryConfigurationHeuristics,
|
|
@@ -27,9 +23,25 @@ export {
|
|
|
27
23
|
DefaultSummaryConfiguration,
|
|
28
24
|
ICompressionRuntimeOptions,
|
|
29
25
|
CompressionAlgorithms,
|
|
26
|
+
TEST_requestSummarizer,
|
|
30
27
|
} from "./containerRuntime";
|
|
28
|
+
export {
|
|
29
|
+
ContainerMessageType,
|
|
30
|
+
ContainerRuntimeMessage,
|
|
31
|
+
IContainerRuntimeMessageCompatDetails,
|
|
32
|
+
CompatModeBehavior,
|
|
33
|
+
RecentlyAddedContainerRuntimeMessageDetails,
|
|
34
|
+
} from "./messageTypes";
|
|
35
|
+
export { IBlobManagerLoadInfo } from "./blobManager";
|
|
31
36
|
export { FluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
32
|
-
export {
|
|
37
|
+
export {
|
|
38
|
+
GCNodeType,
|
|
39
|
+
IGCMetadata,
|
|
40
|
+
GCFeatureMatrix,
|
|
41
|
+
GCVersion,
|
|
42
|
+
IGCRuntimeOptions,
|
|
43
|
+
IGCStats,
|
|
44
|
+
} from "./gc";
|
|
33
45
|
export {
|
|
34
46
|
IAckedSummary,
|
|
35
47
|
ISummarizer,
|
|
@@ -45,6 +57,8 @@ export {
|
|
|
45
57
|
IBroadcastSummaryResult,
|
|
46
58
|
ICancellationToken,
|
|
47
59
|
IConnectableRuntime,
|
|
60
|
+
IContainerRuntimeMetadata,
|
|
61
|
+
ICreateContainerMetadata,
|
|
48
62
|
IEnqueueSummarizeOptions,
|
|
49
63
|
IGenerateSummaryTreeResult,
|
|
50
64
|
IGeneratedSummaryStats,
|
|
@@ -53,6 +67,7 @@ export {
|
|
|
53
67
|
IRefreshSummaryAckOptions,
|
|
54
68
|
ISubmitSummaryOpResult,
|
|
55
69
|
ISubmitSummaryOptions,
|
|
70
|
+
ISerializedElection,
|
|
56
71
|
ISummarizeOptions,
|
|
57
72
|
ISummarizerEvents,
|
|
58
73
|
ISummarizerInternalsProvider,
|
|
@@ -65,6 +80,7 @@ export {
|
|
|
65
80
|
ISummary,
|
|
66
81
|
ISummaryCollectionOpEvents,
|
|
67
82
|
ISummaryAckMessage,
|
|
83
|
+
ISummaryMetadataMessage,
|
|
68
84
|
ISummaryNackMessage,
|
|
69
85
|
ISummaryOpMessage,
|
|
70
86
|
OpActionEventListener,
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
7
|
+
import {
|
|
8
|
+
IEnvelope,
|
|
9
|
+
InboundAttachMessage,
|
|
10
|
+
IAttachMessage,
|
|
11
|
+
IdCreationRangeWithStashedState,
|
|
12
|
+
IdCreationRange,
|
|
13
|
+
} from "@fluidframework/runtime-definitions";
|
|
14
|
+
import { IDataStoreAliasMessage } from "./dataStore";
|
|
15
|
+
import { IChunkedOp } from "./opLifecycle";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export enum ContainerMessageType {
|
|
21
|
+
// An op to be delivered to store
|
|
22
|
+
FluidDataStoreOp = "component",
|
|
23
|
+
|
|
24
|
+
// Creates a new store
|
|
25
|
+
Attach = "attach",
|
|
26
|
+
|
|
27
|
+
// Chunked operation.
|
|
28
|
+
ChunkedOp = "chunkedOp",
|
|
29
|
+
|
|
30
|
+
// Signifies that a blob has been attached and should not be garbage collected by storage
|
|
31
|
+
BlobAttach = "blobAttach",
|
|
32
|
+
|
|
33
|
+
// Ties our new clientId to our old one on reconnect
|
|
34
|
+
Rejoin = "rejoin",
|
|
35
|
+
|
|
36
|
+
// Sets the alias of a root data store
|
|
37
|
+
Alias = "alias",
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* An op containing an IdRange of Ids allocated using the runtime's IdCompressor since
|
|
41
|
+
* the last allocation op was sent.
|
|
42
|
+
* See the [IdCompressor README](./id-compressor/README.md) for more details.
|
|
43
|
+
*/
|
|
44
|
+
IdAllocation = "idAllocation",
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* How should an older client handle an unrecognized remote op type?
|
|
49
|
+
*
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export type CompatModeBehavior =
|
|
53
|
+
/** Ignore the op. It won't be persisted if this client summarizes */
|
|
54
|
+
| "Ignore"
|
|
55
|
+
/** Fail processing immediately. (The container will close) */
|
|
56
|
+
| "FailToProcess";
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* All the info an older client would need to know how to handle an unrecognized remote op type
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export interface IContainerRuntimeMessageCompatDetails {
|
|
64
|
+
/** How should an older client handle an unrecognized remote op type? */
|
|
65
|
+
behavior: CompatModeBehavior;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime.
|
|
70
|
+
* Message type are differentiated via a `type` string and contain different contents depending on their type.
|
|
71
|
+
*
|
|
72
|
+
* IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
|
|
73
|
+
* This way stringified values can be compared.
|
|
74
|
+
*/
|
|
75
|
+
interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents> {
|
|
76
|
+
/** Type of the op, within the ContainerRuntime's domain */
|
|
77
|
+
type: TType;
|
|
78
|
+
/** Domain-specific contents, interpreted according to the type */
|
|
79
|
+
contents: TContents;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Additional details expected for any recently added message.
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
export interface RecentlyAddedContainerRuntimeMessageDetails {
|
|
87
|
+
/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */
|
|
88
|
+
compatDetails: IContainerRuntimeMessageCompatDetails;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type ContainerRuntimeDataStoreOpMessage = TypedContainerRuntimeMessage<
|
|
92
|
+
ContainerMessageType.FluidDataStoreOp,
|
|
93
|
+
IEnvelope
|
|
94
|
+
>;
|
|
95
|
+
export type InboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<
|
|
96
|
+
ContainerMessageType.Attach,
|
|
97
|
+
InboundAttachMessage
|
|
98
|
+
>;
|
|
99
|
+
export type OutboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<
|
|
100
|
+
ContainerMessageType.Attach,
|
|
101
|
+
IAttachMessage
|
|
102
|
+
>;
|
|
103
|
+
export type ContainerRuntimeChunkedOpMessage = TypedContainerRuntimeMessage<
|
|
104
|
+
ContainerMessageType.ChunkedOp,
|
|
105
|
+
IChunkedOp
|
|
106
|
+
>;
|
|
107
|
+
export type ContainerRuntimeBlobAttachMessage = TypedContainerRuntimeMessage<
|
|
108
|
+
ContainerMessageType.BlobAttach,
|
|
109
|
+
undefined
|
|
110
|
+
>;
|
|
111
|
+
export type ContainerRuntimeRejoinMessage = TypedContainerRuntimeMessage<
|
|
112
|
+
ContainerMessageType.Rejoin,
|
|
113
|
+
undefined
|
|
114
|
+
>;
|
|
115
|
+
export type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage<
|
|
116
|
+
ContainerMessageType.Alias,
|
|
117
|
+
IDataStoreAliasMessage
|
|
118
|
+
>;
|
|
119
|
+
export type LocalContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<
|
|
120
|
+
ContainerMessageType.IdAllocation,
|
|
121
|
+
IdCreationRangeWithStashedState
|
|
122
|
+
>;
|
|
123
|
+
export type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<
|
|
124
|
+
ContainerMessageType.IdAllocation,
|
|
125
|
+
IdCreationRange & { stashedState?: never }
|
|
126
|
+
>;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Represents an unrecognized {@link TypedContainerRuntimeMessage}, e.g. a message from a future version of the container runtime.
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
export interface UnknownContainerRuntimeMessage
|
|
133
|
+
extends Partial<RecentlyAddedContainerRuntimeMessageDetails> {
|
|
134
|
+
/** Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime.
|
|
135
|
+
* This is useful for type narrowing but should never be used as an actual message type at runtime.
|
|
136
|
+
* Actual value will not be "__unknown...", but the type `Exclude<string, ContainerMessageType>` is not supported.
|
|
137
|
+
*/
|
|
138
|
+
type: "__unknown_container_message_type__never_use_as_value__";
|
|
139
|
+
|
|
140
|
+
/** Domain-specific contents, but not decipherable by an unknown op. */
|
|
141
|
+
contents: unknown;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* A {@link TypedContainerRuntimeMessage} that is received from the server and will be processed by the container runtime.
|
|
146
|
+
*/
|
|
147
|
+
export type InboundContainerRuntimeMessage =
|
|
148
|
+
| ContainerRuntimeDataStoreOpMessage
|
|
149
|
+
| InboundContainerRuntimeAttachMessage
|
|
150
|
+
| ContainerRuntimeChunkedOpMessage
|
|
151
|
+
| ContainerRuntimeBlobAttachMessage
|
|
152
|
+
| ContainerRuntimeRejoinMessage
|
|
153
|
+
| ContainerRuntimeAliasMessage
|
|
154
|
+
| ContainerRuntimeIdAllocationMessage
|
|
155
|
+
// Inbound messages may include unknown types from other clients, so we include that as a special case here
|
|
156
|
+
| UnknownContainerRuntimeMessage;
|
|
157
|
+
|
|
158
|
+
/** A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime but is not yet being sent to the server. */
|
|
159
|
+
export type LocalContainerRuntimeMessage =
|
|
160
|
+
| ContainerRuntimeDataStoreOpMessage
|
|
161
|
+
| OutboundContainerRuntimeAttachMessage
|
|
162
|
+
| ContainerRuntimeChunkedOpMessage
|
|
163
|
+
| ContainerRuntimeBlobAttachMessage
|
|
164
|
+
| ContainerRuntimeRejoinMessage
|
|
165
|
+
| ContainerRuntimeAliasMessage
|
|
166
|
+
| LocalContainerRuntimeIdAllocationMessage
|
|
167
|
+
// In rare cases (e.g. related to stashed ops) we could have a local message of an unknown type
|
|
168
|
+
| UnknownContainerRuntimeMessage;
|
|
169
|
+
|
|
170
|
+
/** A {@link TypedContainerRuntimeMessage} that is being sent to the server from the container runtime. */
|
|
171
|
+
export type OutboundContainerRuntimeMessage =
|
|
172
|
+
| ContainerRuntimeDataStoreOpMessage
|
|
173
|
+
| OutboundContainerRuntimeAttachMessage
|
|
174
|
+
| ContainerRuntimeChunkedOpMessage
|
|
175
|
+
| ContainerRuntimeBlobAttachMessage
|
|
176
|
+
| ContainerRuntimeRejoinMessage
|
|
177
|
+
| ContainerRuntimeAliasMessage
|
|
178
|
+
| ContainerRuntimeIdAllocationMessage;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* An unpacked ISequencedDocumentMessage with the inner TypedContainerRuntimeMessage type/contents/etc
|
|
182
|
+
* promoted up to the outer object
|
|
183
|
+
*/
|
|
184
|
+
export type InboundSequencedContainerRuntimeMessage = Omit<
|
|
185
|
+
ISequencedDocumentMessage,
|
|
186
|
+
"type" | "contents"
|
|
187
|
+
> &
|
|
188
|
+
InboundContainerRuntimeMessage;
|
|
189
|
+
|
|
190
|
+
/** Essentially ISequencedDocumentMessage except that `type` is not `string` to enable narrowing
|
|
191
|
+
* as `Exclude<string, InboundContainerRuntimeMessage['type']>` is not supported.
|
|
192
|
+
* There should never be a runtime value of "__not_a_...".
|
|
193
|
+
* Currently additionally replaces `contents` type until protocol-definitions update is taken with `unknown` instead of `any`.
|
|
194
|
+
*/
|
|
195
|
+
type InboundSequencedNonContainerRuntimeMessage = Omit<
|
|
196
|
+
ISequencedDocumentMessage,
|
|
197
|
+
"type" | "contents"
|
|
198
|
+
> & { type: "__not_a_container_runtime_message_type__"; contents: unknown };
|
|
199
|
+
|
|
200
|
+
export type InboundSequencedContainerRuntimeMessageOrSystemMessage =
|
|
201
|
+
| InboundSequencedContainerRuntimeMessage
|
|
202
|
+
| InboundSequencedNonContainerRuntimeMessage;
|
|
203
|
+
|
|
204
|
+
/** A [loose] InboundSequencedContainerRuntimeMessage that is recent and may contain compat details.
|
|
205
|
+
* It exists solely to to provide access to those details.
|
|
206
|
+
*/
|
|
207
|
+
export type InboundSequencedRecentlyAddedContainerRuntimeMessage = ISequencedDocumentMessage &
|
|
208
|
+
Partial<RecentlyAddedContainerRuntimeMessageDetails>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime
|
|
212
|
+
*
|
|
213
|
+
* IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
|
|
214
|
+
* This way stringified values can be compared.
|
|
215
|
+
*
|
|
216
|
+
* @deprecated this is an internal type which should not be used outside of the package.
|
|
217
|
+
* Internally, it is superseded by `TypedContainerRuntimeMessage`.
|
|
218
|
+
*
|
|
219
|
+
* @internal
|
|
220
|
+
*/
|
|
221
|
+
export interface ContainerRuntimeMessage {
|
|
222
|
+
/** Type of the op, within the ContainerRuntime's domain */
|
|
223
|
+
type: ContainerMessageType;
|
|
224
|
+
/** Domain-specific contents, interpreted according to the type */
|
|
225
|
+
contents: any;
|
|
226
|
+
/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */
|
|
227
|
+
compatDetails?: IContainerRuntimeMessageCompatDetails;
|
|
228
|
+
}
|