@fluidframework/container-runtime 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.204906
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 +866 -0
- package/dist/blobManager.d.ts +4 -6
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +56 -78
- 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 +1744 -0
- package/dist/container-runtime-beta.d.ts +1744 -0
- package/dist/container-runtime-public.d.ts +1744 -0
- package/dist/container-runtime-untrimmed.d.ts +1805 -0
- package/dist/containerHandleContext.js +3 -3
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +94 -102
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +478 -454
- 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 +56 -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.d.ts +0 -2
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +3 -8
- 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 +6 -0
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +36 -25
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts +1 -0
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +13 -3
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +48 -28
- 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 +3 -4
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +7 -8
- 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 +2 -2
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -7
- 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 -6
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +58 -80
- 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 +94 -102
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +437 -418
- 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 +57 -60
- 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.d.ts +0 -2
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +4 -9
- 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 +6 -0
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +36 -25
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts +1 -0
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +15 -5
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +48 -28
- 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 +3 -4
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +7 -8
- 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 +2 -2
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +2 -2
- 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 +32 -29
- package/src/blobManager.ts +67 -92
- package/src/connectionTelemetry.ts +97 -52
- package/src/containerRuntime.ts +351 -351
- package/src/dataStore.ts +3 -3
- package/src/dataStoreContext.ts +9 -13
- package/src/dataStoreRegistry.ts +3 -0
- package/src/dataStores.ts +5 -17
- package/src/error.ts +4 -1
- package/src/gc/garbageCollection.ts +25 -12
- package/src/gc/gcConfigs.ts +25 -7
- package/src/gc/gcDefinitions.ts +49 -29
- package/src/gc/gcSummaryDefinitions.ts +1 -1
- package/src/gc/gcTelemetry.ts +8 -8
- package/src/gc/index.ts +2 -6
- 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
|
@@ -6,13 +6,21 @@
|
|
|
6
6
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import {
|
|
8
8
|
ContainerMessageType,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type InboundContainerRuntimeMessage,
|
|
10
|
+
type InboundSequencedContainerRuntimeMessage,
|
|
11
|
+
type InboundSequencedContainerRuntimeMessageOrSystemMessage,
|
|
12
|
+
type InboundSequencedRecentlyAddedContainerRuntimeMessage,
|
|
13
|
+
} from "../messageTypes";
|
|
12
14
|
import { OpDecompressor } from "./opDecompressor";
|
|
13
15
|
import { OpGroupingManager } from "./opGroupingManager";
|
|
14
16
|
import { OpSplitter } from "./opSplitter";
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Stateful class for processing incoming remote messages as the virtualization measures are unwrapped,
|
|
20
|
+
* potentially across numerous inbound ops.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
16
24
|
export class RemoteMessageProcessor {
|
|
17
25
|
constructor(
|
|
18
26
|
private readonly opSplitter: OpSplitter,
|
|
@@ -30,14 +38,25 @@ export class RemoteMessageProcessor {
|
|
|
30
38
|
|
|
31
39
|
/**
|
|
32
40
|
* Ungroups and Unchunks the runtime ops encapsulated by the single remoteMessage received over the wire
|
|
33
|
-
* @param
|
|
34
|
-
*
|
|
41
|
+
* @param remoteMessageCopy - A shallow copy of a message from another client, possibly virtualized
|
|
42
|
+
* (grouped, compressed, and/or chunked).
|
|
43
|
+
* Being a shallow copy, it's considered mutable, meaning no other Container or other parallel procedure
|
|
44
|
+
* depends on this object instance.
|
|
45
|
+
* Note remoteMessageCopy.contents (and other object props) MUST not be modified,
|
|
46
|
+
* but may be overwritten (as is the case with contents).
|
|
47
|
+
* @returns the unchunked, decompressed, ungrouped, unpacked SequencedContainerRuntimeMessages encapsulated in the remote message.
|
|
48
|
+
* For ops that weren't virtualized (e.g. System ops that the ContainerRuntime will ultimately ignore),
|
|
49
|
+
* a singleton array [remoteMessageCopy] is returned
|
|
35
50
|
*/
|
|
36
|
-
public process(
|
|
37
|
-
|
|
51
|
+
public process(
|
|
52
|
+
remoteMessageCopy: ISequencedDocumentMessage,
|
|
53
|
+
): InboundSequencedContainerRuntimeMessageOrSystemMessage[] {
|
|
54
|
+
const result: InboundSequencedContainerRuntimeMessageOrSystemMessage[] = [];
|
|
55
|
+
|
|
56
|
+
ensureContentsDeserialized(remoteMessageCopy);
|
|
38
57
|
|
|
39
58
|
// Ungroup before and after decompression for back-compat (cleanup tracked by AB#4371)
|
|
40
|
-
for (const ungroupedMessage of this.opGroupingManager.ungroupOp(
|
|
59
|
+
for (const ungroupedMessage of this.opGroupingManager.ungroupOp(remoteMessageCopy)) {
|
|
41
60
|
const message = this.opDecompressor.processMessage(ungroupedMessage).message;
|
|
42
61
|
|
|
43
62
|
for (let ungroupedMessage2 of this.opGroupingManager.ungroupOp(message)) {
|
|
@@ -50,7 +69,9 @@ export class RemoteMessageProcessor {
|
|
|
50
69
|
if (chunkProcessingResult.state !== "Processed") {
|
|
51
70
|
// If the message is not chunked or if the splitter is still rebuilding the original message,
|
|
52
71
|
// there is no need to continue processing
|
|
53
|
-
result.push(
|
|
72
|
+
result.push(
|
|
73
|
+
ungroupedMessage2 as InboundSequencedContainerRuntimeMessageOrSystemMessage,
|
|
74
|
+
);
|
|
54
75
|
continue;
|
|
55
76
|
}
|
|
56
77
|
|
|
@@ -68,7 +89,9 @@ export class RemoteMessageProcessor {
|
|
|
68
89
|
if (decompressionAfterChunking.state === "Skipped") {
|
|
69
90
|
// After chunking, if the original message was not compressed,
|
|
70
91
|
// there is no need to continue processing
|
|
71
|
-
result.push(
|
|
92
|
+
result.push(
|
|
93
|
+
ungroupedMessageAfterChunking2 as InboundSequencedContainerRuntimeMessageOrSystemMessage,
|
|
94
|
+
);
|
|
72
95
|
continue;
|
|
73
96
|
}
|
|
74
97
|
|
|
@@ -84,40 +107,38 @@ export class RemoteMessageProcessor {
|
|
|
84
107
|
}
|
|
85
108
|
}
|
|
86
109
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// There might be multiple container instances receiving same message
|
|
90
|
-
// We do not need to make deep copy, as each layer will just replace message.content itself,
|
|
91
|
-
// but would not modify contents details
|
|
92
|
-
const message = { ...remoteMessage };
|
|
93
|
-
|
|
110
|
+
/** Takes an incoming message and if the contents is a string, JSON.parse's it in place */
|
|
111
|
+
function ensureContentsDeserialized(mutableMessage: ISequencedDocumentMessage): void {
|
|
94
112
|
// back-compat: ADO #1385: eventually should become unconditional, but only for runtime messages!
|
|
95
113
|
// System message may have no contents, or in some cases (mostly for back-compat) they may have actual objects.
|
|
96
114
|
// Old ops may contain empty string (I assume noops).
|
|
97
|
-
if (typeof
|
|
98
|
-
|
|
115
|
+
if (typeof mutableMessage.contents === "string" && mutableMessage.contents !== "") {
|
|
116
|
+
mutableMessage.contents = JSON.parse(mutableMessage.contents);
|
|
99
117
|
}
|
|
100
|
-
|
|
101
|
-
return message;
|
|
102
|
-
};
|
|
118
|
+
}
|
|
103
119
|
|
|
104
120
|
/**
|
|
105
|
-
* For a given message, it moves the nested
|
|
121
|
+
* For a given message, it moves the nested InboundContainerRuntimeMessage props one level up.
|
|
106
122
|
*
|
|
107
123
|
* The return type illustrates the assumption that the message param
|
|
108
|
-
* becomes a
|
|
109
|
-
* (but there is no runtime validation of the 'type' or 'compatDetails' values)
|
|
124
|
+
* becomes a InboundSequencedContainerRuntimeMessage by the time the function returns
|
|
125
|
+
* (but there is no runtime validation of the 'type' or 'compatDetails' values).
|
|
110
126
|
*/
|
|
111
127
|
function unpack(
|
|
112
128
|
message: ISequencedDocumentMessage,
|
|
113
|
-
): asserts message is
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
): asserts message is InboundSequencedContainerRuntimeMessage {
|
|
130
|
+
// We assume the contents is an InboundContainerRuntimeMessage (the message is "packed")
|
|
131
|
+
const contents = message.contents as InboundContainerRuntimeMessage;
|
|
132
|
+
|
|
133
|
+
// We're going to unpack message in-place (promoting those properties of contents up to message itself)
|
|
134
|
+
const messageUnpacked = message as InboundSequencedContainerRuntimeMessage;
|
|
135
|
+
|
|
136
|
+
messageUnpacked.type = contents.type;
|
|
137
|
+
messageUnpacked.contents = contents.contents;
|
|
138
|
+
if ("compatDetails" in contents) {
|
|
139
|
+
(messageUnpacked as InboundSequencedRecentlyAddedContainerRuntimeMessage).compatDetails =
|
|
140
|
+
contents.compatDetails;
|
|
141
|
+
}
|
|
121
142
|
}
|
|
122
143
|
|
|
123
144
|
/**
|
package/src/packageVersion.ts
CHANGED
|
@@ -11,28 +11,15 @@ import { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
|
11
11
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
12
12
|
import { DataProcessingError, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
13
13
|
|
|
14
|
-
import { ContainerMessageType,
|
|
14
|
+
import { ContainerMessageType, InboundSequencedContainerRuntimeMessage } from "./messageTypes";
|
|
15
15
|
import { pkgVersion } from "./packageVersion";
|
|
16
16
|
import { IBatchMetadata } from "./metadata";
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew (AB#4763)
|
|
20
|
-
*/
|
|
21
|
-
export interface IPendingMessageOld {
|
|
22
|
-
type: "message";
|
|
23
|
-
messageType: ContainerMessageType;
|
|
24
|
-
clientSequenceNumber: number;
|
|
25
|
-
referenceSequenceNumber: number;
|
|
26
|
-
content: any;
|
|
27
|
-
localOpMetadata: unknown;
|
|
28
|
-
opMetadata: Record<string, unknown> | undefined;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
18
|
/**
|
|
32
19
|
* This represents a message that has been submitted and is added to the pending queue when `submit` is called on the
|
|
33
20
|
* ContainerRuntime. This message has either not been ack'd by the server or has not been submitted to the server yet.
|
|
34
21
|
*/
|
|
35
|
-
export interface
|
|
22
|
+
export interface IPendingMessage {
|
|
36
23
|
type: "message";
|
|
37
24
|
clientSequenceNumber: number;
|
|
38
25
|
referenceSequenceNumber: number;
|
|
@@ -41,16 +28,11 @@ export interface IPendingMessageNew {
|
|
|
41
28
|
opMetadata: Record<string, unknown> | undefined;
|
|
42
29
|
}
|
|
43
30
|
|
|
44
|
-
/**
|
|
45
|
-
* ! TODO: Remove this type in "2.0.0-internal.7.0.0" (AB#4763)
|
|
46
|
-
*/
|
|
47
|
-
export type IPendingState = IPendingMessageOld | IPendingMessageNew;
|
|
48
|
-
|
|
49
31
|
export interface IPendingLocalState {
|
|
50
32
|
/**
|
|
51
33
|
* list of pending states, including ops and batch information
|
|
52
34
|
*/
|
|
53
|
-
pendingStates:
|
|
35
|
+
pendingStates: IPendingMessage[];
|
|
54
36
|
}
|
|
55
37
|
|
|
56
38
|
export interface IPendingBatchMessage {
|
|
@@ -69,6 +51,26 @@ export interface IRuntimeStateHandler {
|
|
|
69
51
|
isActiveConnection: () => boolean;
|
|
70
52
|
}
|
|
71
53
|
|
|
54
|
+
/** Union of keys of T */
|
|
55
|
+
type KeysOfUnion<T extends object> = T extends T ? keyof T : never;
|
|
56
|
+
/** *Partial* type all possible combinations of properties and values of union T.
|
|
57
|
+
* This loosens typing allowing access to all possible properties without
|
|
58
|
+
* narrowing.
|
|
59
|
+
*/
|
|
60
|
+
type AnyComboFromUnion<T extends object> = { [P in KeysOfUnion<T>]?: T[P] };
|
|
61
|
+
|
|
62
|
+
function buildPendingMessageContent(
|
|
63
|
+
// AnyComboFromUnion is needed need to gain access to compatDetails that
|
|
64
|
+
// is only defined for some cases.
|
|
65
|
+
message: AnyComboFromUnion<InboundSequencedContainerRuntimeMessage>,
|
|
66
|
+
): string {
|
|
67
|
+
// IMPORTANT: Order matters here, this must match the order of the properties used
|
|
68
|
+
// when submitting the message.
|
|
69
|
+
const { type, contents, compatDetails } = message;
|
|
70
|
+
// Any properties that are not defined, won't be emitted by stringify.
|
|
71
|
+
return JSON.stringify({ type, contents, compatDetails });
|
|
72
|
+
}
|
|
73
|
+
|
|
72
74
|
/**
|
|
73
75
|
* PendingStateManager is responsible for maintaining the messages that have not been sent or have not yet been
|
|
74
76
|
* acknowledged by the server. It also maintains the batch information for both automatically and manually flushed
|
|
@@ -79,13 +81,13 @@ export interface IRuntimeStateHandler {
|
|
|
79
81
|
* It verifies that all the ops are acked, are received in the right order and batch information is correct.
|
|
80
82
|
*/
|
|
81
83
|
export class PendingStateManager implements IDisposable {
|
|
82
|
-
private readonly pendingMessages = new Deque<
|
|
83
|
-
private readonly initialMessages = new Deque<
|
|
84
|
+
private readonly pendingMessages = new Deque<IPendingMessage>();
|
|
85
|
+
private readonly initialMessages = new Deque<IPendingMessage>();
|
|
84
86
|
|
|
85
87
|
/**
|
|
86
88
|
* Sequenced local ops that are saved when stashing since pending ops may depend on them
|
|
87
89
|
*/
|
|
88
|
-
private savedOps:
|
|
90
|
+
private savedOps: IPendingMessage[] = [];
|
|
89
91
|
|
|
90
92
|
private readonly disposeOnce = new Lazy<void>(() => {
|
|
91
93
|
this.initialMessages.clear();
|
|
@@ -149,29 +151,8 @@ export class PendingStateManager implements IDisposable {
|
|
|
149
151
|
initialLocalState: IPendingLocalState | undefined,
|
|
150
152
|
private readonly logger: ITelemetryLoggerExt | undefined,
|
|
151
153
|
) {
|
|
152
|
-
/**
|
|
153
|
-
* Convert old local state format to the new format (IPendingMessageOld to IPendingMessageNew)
|
|
154
|
-
* ! TODO: Remove this conversion in "2.0.0-internal.7.0.0" (AB#4763)
|
|
155
|
-
*/
|
|
156
154
|
if (initialLocalState?.pendingStates) {
|
|
157
|
-
|
|
158
|
-
let messageContent = initialState.content;
|
|
159
|
-
if (
|
|
160
|
-
(initialState as IPendingMessageOld).messageType !== undefined &&
|
|
161
|
-
typeof initialState.content !== "string"
|
|
162
|
-
) {
|
|
163
|
-
// Convert IPendingMessageOld to IPendingMessageNew
|
|
164
|
-
messageContent = JSON.stringify({
|
|
165
|
-
type: (initialState as IPendingMessageOld).messageType,
|
|
166
|
-
contents: initialState.content,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
// Note: this object may contain "messageType" prop, but it should not be easily accesible due to interface being used
|
|
170
|
-
this.initialMessages.push({
|
|
171
|
-
...initialState,
|
|
172
|
-
content: messageContent,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
155
|
+
this.initialMessages.push(...initialLocalState.pendingStates);
|
|
175
156
|
}
|
|
176
157
|
}
|
|
177
158
|
|
|
@@ -193,7 +174,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
193
174
|
localOpMetadata: unknown,
|
|
194
175
|
opMetadata: Record<string, unknown> | undefined,
|
|
195
176
|
) {
|
|
196
|
-
const pendingMessage:
|
|
177
|
+
const pendingMessage: IPendingMessage = {
|
|
197
178
|
type: "message",
|
|
198
179
|
clientSequenceNumber: -1, // dummy value (not to be used anywhere)
|
|
199
180
|
referenceSequenceNumber,
|
|
@@ -242,7 +223,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
242
223
|
* the batch information was preserved for batch messages.
|
|
243
224
|
* @param message - The message that got ack'd and needs to be processed.
|
|
244
225
|
*/
|
|
245
|
-
public processPendingLocalMessage(message:
|
|
226
|
+
public processPendingLocalMessage(message: InboundSequencedContainerRuntimeMessage): unknown {
|
|
246
227
|
// Pre-processing part - This may be the start of a batch.
|
|
247
228
|
this.maybeProcessBatchBegin(message);
|
|
248
229
|
|
|
@@ -256,10 +237,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
256
237
|
|
|
257
238
|
this.pendingMessages.shift();
|
|
258
239
|
|
|
259
|
-
|
|
260
|
-
// when submitting the message.
|
|
261
|
-
const { type, contents, compatDetails } = message;
|
|
262
|
-
const messageContent = JSON.stringify({ type, contents, compatDetails });
|
|
240
|
+
const messageContent = buildPendingMessageContent(message);
|
|
263
241
|
|
|
264
242
|
// Stringified content should match
|
|
265
243
|
if (pendingMessage.content !== messageContent) {
|
|
@@ -340,6 +318,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
340
318
|
{
|
|
341
319
|
runtimeVersion: pkgVersion,
|
|
342
320
|
batchClientId:
|
|
321
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
343
322
|
this.pendingBatchBeginMessage.clientId === null
|
|
344
323
|
? "null"
|
|
345
324
|
: this.pendingBatchBeginMessage.clientId,
|
package/src/scheduleManager.ts
CHANGED
|
@@ -271,6 +271,7 @@ class ScheduleManagerCore {
|
|
|
271
271
|
{
|
|
272
272
|
runtimeVersion: pkgVersion,
|
|
273
273
|
batchClientId:
|
|
274
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
274
275
|
this.currentBatchClientId === null ? "null" : this.currentBatchClientId,
|
|
275
276
|
pauseSequenceNumber: this.pauseSequenceNumber,
|
|
276
277
|
localBatch: this.currentBatchClientId === this.getClientId(),
|
|
@@ -306,6 +307,7 @@ class ScheduleManagerCore {
|
|
|
306
307
|
throw new DataCorruptionError("OpBatchIncomplete", {
|
|
307
308
|
runtimeVersion: pkgVersion,
|
|
308
309
|
batchClientId:
|
|
310
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
309
311
|
this.currentBatchClientId === null ? "null" : this.currentBatchClientId,
|
|
310
312
|
pauseSequenceNumber: this.pauseSequenceNumber,
|
|
311
313
|
localBatch: this.currentBatchClientId === this.getClientId(),
|
|
@@ -225,7 +225,10 @@ export interface IOrderedClientElectionEvents extends IEvent {
|
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Serialized state of IOrderedClientElection.
|
|
230
|
+
* @public
|
|
231
|
+
*/
|
|
229
232
|
export interface ISerializedElection {
|
|
230
233
|
/** Sequence number at the time of the latest election. */
|
|
231
234
|
readonly electionSequenceNumber: number;
|
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
ISummaryCancellationToken,
|
|
11
11
|
} from "./summarizerTypes";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Similar to AbortController, but using promise instead of events
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
14
17
|
export interface ICancellableSummarizerController extends ISummaryCancellationToken {
|
|
15
18
|
stop(reason: SummarizerStopReason): void;
|
|
16
19
|
}
|
|
@@ -18,6 +21,7 @@ export interface ICancellableSummarizerController extends ISummaryCancellationTo
|
|
|
18
21
|
/**
|
|
19
22
|
* Can be useful in testing as well as in places where caller does not use cancellation.
|
|
20
23
|
* This object implements ISummaryCancellationToken interface but cancellation is never leveraged.
|
|
24
|
+
* @public
|
|
21
25
|
*/
|
|
22
26
|
export const neverCancelledSummaryToken: ISummaryCancellationToken = {
|
|
23
27
|
cancelled: false,
|
|
@@ -308,7 +308,8 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
308
308
|
// latest version with which we will refresh the state. However in case of single commit
|
|
309
309
|
// summary, we might me missing a summary ack, so in that case we are still fine as the
|
|
310
310
|
// code in `submitSummary` function in container runtime, will refresh the latest state
|
|
311
|
-
// by calling `
|
|
311
|
+
// by calling `prefetchLatestSummaryThenClose`. We will load the next summarizer from the
|
|
312
|
+
// updated state and be fine.
|
|
312
313
|
const isIgnoredError =
|
|
313
314
|
isFluidError(error) &&
|
|
314
315
|
error.errorType === DriverErrorTypes.fileNotFoundOrAccessDeniedError;
|
|
@@ -407,6 +408,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
407
408
|
!this.heuristicRunnerMicroTaskExists
|
|
408
409
|
) {
|
|
409
410
|
this.heuristicRunnerMicroTaskExists = true;
|
|
411
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
410
412
|
Promise.resolve()
|
|
411
413
|
.then(() => {
|
|
412
414
|
this.heuristicRunner?.run();
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from "@fluidframework/telemetry-utils";
|
|
16
16
|
import { ILoader, LoaderHeader } from "@fluidframework/container-definitions";
|
|
17
17
|
import { DriverHeader } from "@fluidframework/driver-definitions";
|
|
18
|
-
import { requestFluidObject } from "@fluidframework/runtime-utils";
|
|
19
18
|
import { FluidObject, IFluidHandleContext, IRequest } from "@fluidframework/core-interfaces";
|
|
19
|
+
import { responseToException } from "@fluidframework/runtime-utils";
|
|
20
20
|
import { ISummaryConfiguration } from "../containerRuntime";
|
|
21
21
|
import { ICancellableSummarizerController } from "./runWhileConnectedCoordinator";
|
|
22
22
|
import { summarizerClientType } from "./summarizerClientElection";
|
|
@@ -49,7 +49,10 @@ export class SummarizingWarning
|
|
|
49
49
|
readonly errorType = summarizingError;
|
|
50
50
|
readonly canRetry = true;
|
|
51
51
|
|
|
52
|
-
constructor(
|
|
52
|
+
constructor(
|
|
53
|
+
errorMessage: string,
|
|
54
|
+
readonly logged: boolean = false,
|
|
55
|
+
) {
|
|
53
56
|
super(errorMessage);
|
|
54
57
|
}
|
|
55
58
|
|
|
@@ -66,6 +69,7 @@ export const createSummarizingWarning = (errorMessage: string, logged: boolean)
|
|
|
66
69
|
* Summarizer is responsible for coordinating when to generate and send summaries.
|
|
67
70
|
* It is the main entry point for summary work.
|
|
68
71
|
* It is created only by summarizing container (i.e. one with clientType === "summarizer")
|
|
72
|
+
* @public
|
|
69
73
|
*/
|
|
70
74
|
export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
|
|
71
75
|
public get ISummarizer() {
|
|
@@ -107,6 +111,7 @@ export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements
|
|
|
107
111
|
* interface will expect an absolute URL and will not handle "/".
|
|
108
112
|
* @param loader - the loader that resolves the request
|
|
109
113
|
* @param url - the URL used to resolve the container
|
|
114
|
+
* @deprecated Creating a summarizer is not a publicly supported API. Please remove all usage of this static method.
|
|
110
115
|
*/
|
|
111
116
|
public static async create(loader: ILoader, url: string): Promise<ISummarizer> {
|
|
112
117
|
const request: IRequest = {
|
|
@@ -123,11 +128,20 @@ export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements
|
|
|
123
128
|
};
|
|
124
129
|
|
|
125
130
|
const resolvedContainer = await loader.resolve(request);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
let fluidObject: FluidObject<ISummarizer> | undefined;
|
|
132
|
+
|
|
133
|
+
// Older containers may not have the "getEntryPoint" API
|
|
134
|
+
// ! This check will need to stay until LTS of loader moves past 2.0.0-internal.7.0.0
|
|
135
|
+
if (resolvedContainer.getEntryPoint !== undefined) {
|
|
136
|
+
fluidObject = await resolvedContainer.getEntryPoint();
|
|
137
|
+
} else {
|
|
138
|
+
const response = await resolvedContainer.request({ url: "_summarizer" });
|
|
139
|
+
if (response.status !== 200 || response.mimeType !== "fluid/object") {
|
|
140
|
+
throw responseToException(response, request);
|
|
141
|
+
}
|
|
142
|
+
fluidObject = response.value;
|
|
143
|
+
}
|
|
144
|
+
|
|
131
145
|
if (fluidObject?.ISummarizer === undefined) {
|
|
132
146
|
throw new UsageError("Fluid object does not implement ISummarizer");
|
|
133
147
|
}
|
|
@@ -424,7 +424,7 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
424
424
|
* Called when we get an ack from the server for a summary we've just sent. Updates the reference state of this node
|
|
425
425
|
* from the state in the pending summary queue.
|
|
426
426
|
* @param proposalHandle - Handle for the current proposal.
|
|
427
|
-
* @param referenceSequenceNumber -
|
|
427
|
+
* @param referenceSequenceNumber - Reference sequence number of sent summary.
|
|
428
428
|
*/
|
|
429
429
|
protected refreshLatestSummaryFromPending(
|
|
430
430
|
proposalHandle: string,
|