@fluidframework/container-runtime 2.10.0 → 2.11.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 +62 -0
- package/container-runtime.test-files.tar +0 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +12 -20
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +15 -2
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +39 -1
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -0
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +10 -2
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +2 -0
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +40 -11
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +0 -7
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +0 -12
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +3 -39
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +1 -5
- 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.map +1 -1
- package/dist/pendingStateManager.js +2 -3
- package/dist/pendingStateManager.js.map +1 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +12 -20
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +15 -2
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +40 -2
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +1 -0
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +8 -0
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +2 -0
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +40 -11
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts +0 -7
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +0 -12
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +3 -39
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +1 -5
- 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.map +1 -1
- package/lib/pendingStateManager.js +2 -3
- package/lib/pendingStateManager.js.map +1 -1
- package/package.json +20 -72
- package/src/containerRuntime.ts +12 -21
- package/src/dataStoreContext.ts +57 -1
- package/src/dataStoreRegistry.ts +10 -0
- package/src/gc/garbageCollection.ts +41 -11
- package/src/gc/gcSummaryStateTracker.ts +0 -13
- package/src/index.ts +0 -3
- package/src/messageTypes.ts +3 -50
- package/src/opLifecycle/remoteMessageProcessor.ts +1 -6
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +2 -3
package/src/messageTypes.ts
CHANGED
|
@@ -58,29 +58,6 @@ export enum ContainerMessageType {
|
|
|
58
58
|
GC = "GC",
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
/**
|
|
62
|
-
* How should an older client handle an unrecognized remote op type?
|
|
63
|
-
*
|
|
64
|
-
* @deprecated The utility of a mechanism to handle unknown messages is outweighed by the nuance required to get it right.
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
|
-
export type CompatModeBehavior =
|
|
68
|
-
/** Ignore the op. It won't be persisted if this client summarizes */
|
|
69
|
-
| "Ignore"
|
|
70
|
-
/** Fail processing immediately. (The container will close) */
|
|
71
|
-
| "FailToProcess";
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* All the info an older client would need to know how to handle an unrecognized remote op type
|
|
75
|
-
*
|
|
76
|
-
* @deprecated The utility of a mechanism to handle unknown messages is outweighed by the nuance required to get it right.
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
export interface IContainerRuntimeMessageCompatDetails {
|
|
80
|
-
/** How should an older client handle an unrecognized remote op type? */
|
|
81
|
-
behavior: CompatModeBehavior;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
61
|
/**
|
|
85
62
|
* The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime.
|
|
86
63
|
* Message type are differentiated via a `type` string and contain different contents depending on their type.
|
|
@@ -88,27 +65,11 @@ export interface IContainerRuntimeMessageCompatDetails {
|
|
|
88
65
|
* IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
|
|
89
66
|
* This way stringified values can be compared.
|
|
90
67
|
*/
|
|
91
|
-
|
|
92
|
-
TType extends ContainerMessageType,
|
|
93
|
-
TContents,
|
|
94
|
-
TUSedCompatDetails extends boolean = false,
|
|
95
|
-
> = {
|
|
68
|
+
interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents> {
|
|
96
69
|
/** Type of the op, within the ContainerRuntime's domain */
|
|
97
70
|
type: TType;
|
|
98
71
|
/** Domain-specific contents, interpreted according to the type */
|
|
99
72
|
contents: TContents;
|
|
100
|
-
} & (TUSedCompatDetails extends true
|
|
101
|
-
? Partial<RecentlyAddedContainerRuntimeMessageDetails>
|
|
102
|
-
: { compatDetails?: undefined });
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Additional details expected for any recently added message.
|
|
106
|
-
* @deprecated The utility of a mechanism to handle unknown messages is outweighed by the nuance required to get it right.
|
|
107
|
-
* @internal
|
|
108
|
-
*/
|
|
109
|
-
export interface RecentlyAddedContainerRuntimeMessageDetails {
|
|
110
|
-
/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */
|
|
111
|
-
compatDetails: IContainerRuntimeMessageCompatDetails;
|
|
112
73
|
}
|
|
113
74
|
|
|
114
75
|
export type ContainerRuntimeDataStoreOpMessage = TypedContainerRuntimeMessage<
|
|
@@ -145,8 +106,7 @@ export type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<
|
|
|
145
106
|
>;
|
|
146
107
|
export type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<
|
|
147
108
|
ContainerMessageType.GC,
|
|
148
|
-
GarbageCollectionMessage
|
|
149
|
-
true // TUsedCompatDetails
|
|
109
|
+
GarbageCollectionMessage
|
|
150
110
|
>;
|
|
151
111
|
export type ContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<
|
|
152
112
|
ContainerMessageType.DocumentSchemaChange,
|
|
@@ -157,8 +117,7 @@ export type ContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage
|
|
|
157
117
|
* Represents an unrecognized TypedContainerRuntimeMessage, e.g. a message from a future version of the container runtime.
|
|
158
118
|
* @internal
|
|
159
119
|
*/
|
|
160
|
-
export interface UnknownContainerRuntimeMessage
|
|
161
|
-
extends Partial<RecentlyAddedContainerRuntimeMessageDetails> {
|
|
120
|
+
export interface UnknownContainerRuntimeMessage {
|
|
162
121
|
/** Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime.
|
|
163
122
|
* This is useful for type narrowing but should never be used as an actual message type at runtime.
|
|
164
123
|
* Actual value will not be "__unknown...", but the type `Exclude<string, ContainerMessageType>` is not supported.
|
|
@@ -222,9 +181,3 @@ export type InboundSequencedContainerRuntimeMessage = Omit<
|
|
|
222
181
|
"type" | "contents"
|
|
223
182
|
> &
|
|
224
183
|
InboundContainerRuntimeMessage;
|
|
225
|
-
|
|
226
|
-
/** A [loose] InboundSequencedContainerRuntimeMessage that is recent and may contain compat details.
|
|
227
|
-
* It exists solely to to provide access to those details.
|
|
228
|
-
*/
|
|
229
|
-
export type InboundSequencedRecentlyAddedContainerRuntimeMessage = ISequencedDocumentMessage &
|
|
230
|
-
Partial<RecentlyAddedContainerRuntimeMessageDetails>;
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
ContainerMessageType,
|
|
14
14
|
type InboundContainerRuntimeMessage,
|
|
15
15
|
type InboundSequencedContainerRuntimeMessage,
|
|
16
|
-
type InboundSequencedRecentlyAddedContainerRuntimeMessage,
|
|
17
16
|
} from "../messageTypes.js";
|
|
18
17
|
import { asBatchMetadata } from "../metadata.js";
|
|
19
18
|
|
|
@@ -259,7 +258,7 @@ export function ensureContentsDeserialized(mutableMessage: ISequencedDocumentMes
|
|
|
259
258
|
*
|
|
260
259
|
* The return type illustrates the assumption that the message param
|
|
261
260
|
* becomes a InboundSequencedContainerRuntimeMessage by the time the function returns
|
|
262
|
-
* (but there is no runtime validation of the 'type'
|
|
261
|
+
* (but there is no runtime validation of the 'type').
|
|
263
262
|
*/
|
|
264
263
|
function unpack(message: ISequencedDocumentMessage): InboundSequencedContainerRuntimeMessage {
|
|
265
264
|
// We assume the contents is an InboundContainerRuntimeMessage (the message is "packed")
|
|
@@ -270,10 +269,6 @@ function unpack(message: ISequencedDocumentMessage): InboundSequencedContainerRu
|
|
|
270
269
|
|
|
271
270
|
messageUnpacked.type = contents.type;
|
|
272
271
|
messageUnpacked.contents = contents.contents;
|
|
273
|
-
if ("compatDetails" in contents) {
|
|
274
|
-
(messageUnpacked as InboundSequencedRecentlyAddedContainerRuntimeMessage).compatDetails =
|
|
275
|
-
contents.compatDetails;
|
|
276
|
-
}
|
|
277
272
|
return messageUnpacked;
|
|
278
273
|
}
|
|
279
274
|
|
package/src/packageVersion.ts
CHANGED
|
@@ -105,9 +105,9 @@ function isEmptyBatchPendingMessage(message: IPendingMessageFromStash): boolean
|
|
|
105
105
|
function buildPendingMessageContent(message: InboundSequencedContainerRuntimeMessage): string {
|
|
106
106
|
// IMPORTANT: Order matters here, this must match the order of the properties used
|
|
107
107
|
// when submitting the message.
|
|
108
|
-
const { type, contents
|
|
108
|
+
const { type, contents }: InboundContainerRuntimeMessage = message;
|
|
109
109
|
// Any properties that are not defined, won't be emitted by stringify.
|
|
110
|
-
return JSON.stringify({ type, contents
|
|
110
|
+
return JSON.stringify({ type, contents });
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function typesOfKeys<T extends object>(obj: T): Record<keyof T, string> {
|
|
@@ -126,7 +126,6 @@ function scrubAndStringify(
|
|
|
126
126
|
// For these known/expected keys, we can either drill in (for contents)
|
|
127
127
|
// or just use the value as-is (since it's not personal info)
|
|
128
128
|
scrubbed.contents = message.contents && typesOfKeys(message.contents);
|
|
129
|
-
scrubbed.compatDetails = message.compatDetails;
|
|
130
129
|
scrubbed.type = message.type;
|
|
131
130
|
|
|
132
131
|
return JSON.stringify(scrubbed);
|