@fluidframework/container-runtime 2.72.0 → 2.74.0-365691

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/blobManager/blobManager.d.ts.map +1 -1
  4. package/dist/blobManager/blobManager.js +1 -0
  5. package/dist/blobManager/blobManager.js.map +1 -1
  6. package/dist/containerCompatibility.d.ts.map +1 -1
  7. package/dist/containerCompatibility.js +8 -2
  8. package/dist/containerCompatibility.js.map +1 -1
  9. package/dist/containerRuntime.d.ts.map +1 -1
  10. package/dist/containerRuntime.js +3 -1
  11. package/dist/containerRuntime.js.map +1 -1
  12. package/dist/packageVersion.d.ts +1 -1
  13. package/dist/packageVersion.d.ts.map +1 -1
  14. package/dist/packageVersion.js +1 -1
  15. package/dist/packageVersion.js.map +1 -1
  16. package/dist/runtimeLayerCompatState.d.ts +1 -1
  17. package/dist/summary/documentSchema.d.ts +3 -1
  18. package/dist/summary/documentSchema.d.ts.map +1 -1
  19. package/dist/summary/documentSchema.js.map +1 -1
  20. package/dist/summary/orderedClientElection.js.map +1 -1
  21. package/lib/blobManager/blobManager.d.ts.map +1 -1
  22. package/lib/blobManager/blobManager.js +1 -0
  23. package/lib/blobManager/blobManager.js.map +1 -1
  24. package/lib/containerCompatibility.d.ts.map +1 -1
  25. package/lib/containerCompatibility.js +9 -3
  26. package/lib/containerCompatibility.js.map +1 -1
  27. package/lib/containerRuntime.d.ts.map +1 -1
  28. package/lib/containerRuntime.js +4 -2
  29. package/lib/containerRuntime.js.map +1 -1
  30. package/lib/packageVersion.d.ts +1 -1
  31. package/lib/packageVersion.d.ts.map +1 -1
  32. package/lib/packageVersion.js +1 -1
  33. package/lib/packageVersion.js.map +1 -1
  34. package/lib/runtimeLayerCompatState.d.ts +1 -1
  35. package/lib/summary/documentSchema.d.ts +3 -1
  36. package/lib/summary/documentSchema.d.ts.map +1 -1
  37. package/lib/summary/documentSchema.js.map +1 -1
  38. package/lib/summary/orderedClientElection.js.map +1 -1
  39. package/package.json +19 -19
  40. package/src/blobManager/blobManager.ts +1 -0
  41. package/src/containerCompatibility.ts +97 -91
  42. package/src/containerRuntime.ts +4 -2
  43. package/src/packageVersion.ts +1 -1
  44. package/src/summary/documentSchema.ts +3 -1
  45. package/src/summary/orderedClientElection.ts +1 -1
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  configValueToMinVersionForCollab,
12
12
  getConfigsForMinVersionForCollab,
13
- getValidationForRuntimeOptions,
13
+ validateConfigMapOverrides,
14
14
  type ConfigMap,
15
15
  type ConfigValidationMap,
16
16
  } from "@fluidframework/runtime-utils/internal";
@@ -101,60 +101,66 @@ export type RuntimeOptionKeysThatRequireExplicitSchemaControl = keyof Omit<
101
101
  * default value for `enableGroupedBatching` will be true because clients running 2.0 or later will be able to understand the format changes associated
102
102
  * with the batching feature.
103
103
  */
104
- const runtimeOptionsAffectingDocSchemaConfigMap = {
105
- enableGroupedBatching: {
106
- "1.0.0": false,
107
- "2.0.0-defaults": true,
108
- },
109
- compressionOptions: {
110
- "1.0.0": disabledCompressionConfig,
111
- "2.0.0-defaults": enabledCompressionConfig,
112
- },
113
- enableRuntimeIdCompressor: {
114
- // For IdCompressorMode, `undefined` represents a logical state (off).
115
- // However, to satisfy the Required<> constraint while
116
- // `exactOptionalPropertyTypes` is `false` (TODO: AB#8215), we need
117
- // to have it defined, so we trick the type checker here.
118
- "1.0.0": undefined,
119
- // We do not yet want to enable idCompressor by default since it will
120
- // increase bundle sizes, and not all customers will benefit from it.
121
- // Therefore, we will require customers to explicitly enable it. We
122
- // are keeping it as a DocSchema affecting option for now as this may
123
- // change in the future.
124
- },
125
- explicitSchemaControl: {
126
- "1.0.0": false,
127
- // This option's intention is to prevent 1.x clients from joining sessions
128
- // when enabled. This is set to true when the minVersionForCollab is set
129
- // to >=2.0.0 (explicitly). This is different than other 2.0 defaults
130
- // because it was not enabled by default prior to the implementation of
131
- // `minVersionForCollab`.
132
- // `defaultMinVersionForCollab` is set to "2.0.0-defaults" which "2.0.0"
133
- // does not satisfy to avoiding enabling this option by default as of
134
- // `minVersionForCollab` introduction, which could be unexpected.
135
- // Only enable as a default when `minVersionForCollab` is specified at
136
- // 2.0.0+.
137
- "2.0.0": true,
138
- },
139
- flushMode: {
140
- // Note: 1.x clients are compatible with TurnBased flushing, but here we elect to remain on Immediate flush mode
141
- // as a work-around for inability to send batches larger than 1Mb. Immediate flushing keeps batches smaller as
142
- // fewer messages will be included per flush.
143
- "1.0.0": FlushMode.Immediate,
144
- "2.0.0-defaults": FlushMode.TurnBased,
145
- },
146
- gcOptions: {
147
- "1.0.0": {},
148
- // Although sweep is supported in 2.x, it is disabled by default until minVersionForCollab>=3.0.0 to be extra safe.
149
- "3.0.0": { enableGCSweep: true },
150
- },
151
- createBlobPayloadPending: {
152
- // This feature is new and disabled by default. In the future we will enable it by default, but we have not
153
- // closed on the version where that will happen yet. Probably a .10 release since blob functionality is not
154
- // exposed on the `@public` API surface.
155
- "1.0.0": undefined,
156
- },
157
- } as const satisfies ConfigMap<RuntimeOptionsAffectingDocSchema>;
104
+ const runtimeOptionsAffectingDocSchemaConfigMap: ConfigMap<RuntimeOptionsAffectingDocSchema> =
105
+ {
106
+ enableGroupedBatching: {
107
+ "1.0.0": false,
108
+ "2.0.0-defaults": true,
109
+ },
110
+ compressionOptions: {
111
+ "1.0.0": disabledCompressionConfig,
112
+ "2.0.0-defaults": enabledCompressionConfig,
113
+ },
114
+ enableRuntimeIdCompressor: {
115
+ // For IdCompressorMode, `undefined` represents a logical state (off).
116
+ // However, to satisfy the Required<> constraint while
117
+ // `exactOptionalPropertyTypes` is `false` (TODO: AB#8215), we need
118
+ // to have it defined, so we trick the type checker here.
119
+ "1.0.0": undefined,
120
+ // We do not yet want to enable idCompressor by default since it will
121
+ // increase bundle sizes, and not all customers will benefit from it.
122
+ // Therefore, we will require customers to explicitly enable it. We
123
+ // are keeping it as a DocSchema affecting option for now as this may
124
+ // change in the future.
125
+ },
126
+ explicitSchemaControl: {
127
+ "1.0.0": false,
128
+ // This option's intention is to prevent 1.x clients from joining sessions
129
+ // when enabled. This is set to true when the minVersionForCollab is set
130
+ // to >=2.0.0 (explicitly). This is different than other 2.0 defaults
131
+ // because it was not enabled by default prior to the implementation of
132
+ // `minVersionForCollab`.
133
+ // `defaultMinVersionForCollab` is set to "2.0.0-defaults" which "2.0.0"
134
+ // does not satisfy to avoiding enabling this option by default as of
135
+ // `minVersionForCollab` introduction, which could be unexpected.
136
+ // Only enable as a default when `minVersionForCollab` is specified at
137
+ // 2.0.0+.
138
+ "2.0.0": true,
139
+ },
140
+ flushMode: {
141
+ // Note: 1.x clients are compatible with TurnBased flushing, but here we elect to remain on Immediate flush mode
142
+ // as a work-around for inability to send batches larger than 1Mb. Immediate flushing keeps batches smaller as
143
+ // fewer messages will be included per flush.
144
+ "1.0.0": FlushMode.Immediate,
145
+ "2.0.0-defaults": FlushMode.TurnBased,
146
+ },
147
+ gcOptions: {
148
+ "1.0.0": {},
149
+ // Although sweep is supported in 2.x, it is disabled by default until minVersionForCollab>=3.0.0 to be extra safe.
150
+ // Note that enabling this is a significant change, that should likely be announced in the relevant version:
151
+ // It would be bad if this simple caused the enablement when when the current package version passed this point without anyone being aware.
152
+ // This is configuration targeting a future versions, which is not supported.
153
+ // TODO: when preparing 3.0 (or at some later point), consider enabling this by default for clients 3.0 or newer
154
+ // (and add user facing documentation indicating this is enabled by that version).
155
+ // "3.0.0": { enableGCSweep: true },
156
+ },
157
+ createBlobPayloadPending: {
158
+ // This feature is new and disabled by default. In the future we will enable it by default, but we have not
159
+ // closed on the version where that will happen yet. Probably a .10 release since blob functionality is not
160
+ // exposed on the `@public` API surface.
161
+ "1.0.0": undefined,
162
+ },
163
+ };
158
164
 
159
165
  /**
160
166
  * Keys of {@link ContainerRuntimeOptionsInternal} that require explicitSchemaControl to be enabled.
@@ -169,37 +175,39 @@ export const runtimeOptionKeysThatRequireExplicitSchemaControl = (
169
175
  );
170
176
  }) as RuntimeOptionKeysThatRequireExplicitSchemaControl[];
171
177
 
172
- const runtimeOptionsAffectingDocSchemaConfigValidationMap = {
173
- enableGroupedBatching: configValueToMinVersionForCollab([
174
- [false, "1.0.0"],
175
- [true, "2.0.0-defaults"],
176
- ]),
177
- compressionOptions: configValueToMinVersionForCollab([
178
- [{ ...disabledCompressionConfig }, "1.0.0"],
179
- [{ ...enabledCompressionConfig }, "2.0.0-defaults"],
180
- ]),
181
- enableRuntimeIdCompressor: configValueToMinVersionForCollab([
182
- [undefined, "1.0.0"],
183
- ["on", "2.0.0-defaults"],
184
- ["delayed", "2.0.0-defaults"],
185
- ]),
186
- explicitSchemaControl: configValueToMinVersionForCollab([
187
- [false, "1.0.0"],
188
- [true, "2.0.0-defaults"],
189
- ]),
190
- flushMode: configValueToMinVersionForCollab([
191
- [FlushMode.Immediate, "1.0.0"],
192
- [FlushMode.TurnBased, "2.0.0-defaults"],
193
- ]),
194
- gcOptions: configValueToMinVersionForCollab([
195
- [{ enableGCSweep: undefined }, "1.0.0"],
196
- [{ enableGCSweep: true }, "2.0.0-defaults"],
197
- ]),
198
- createBlobPayloadPending: configValueToMinVersionForCollab([
199
- [undefined, "1.0.0"],
200
- [true, "2.40.0"],
201
- ]),
202
- } as const satisfies ConfigValidationMap<RuntimeOptionsAffectingDocSchema>;
178
+ // A lot of the information in this seems redundant with whats defined above. Might be nice to combine them somehow.
179
+ const runtimeOptionsAffectingDocSchemaConfigValidationMap: ConfigValidationMap<RuntimeOptionsAffectingDocSchema> =
180
+ {
181
+ enableGroupedBatching: configValueToMinVersionForCollab([
182
+ [false, "1.0.0"],
183
+ [true, "2.0.0-defaults"],
184
+ ]),
185
+ compressionOptions: configValueToMinVersionForCollab([
186
+ [{ ...disabledCompressionConfig }, "1.0.0"],
187
+ [{ ...enabledCompressionConfig }, "2.0.0-defaults"],
188
+ ]),
189
+ enableRuntimeIdCompressor: configValueToMinVersionForCollab([
190
+ [undefined, "1.0.0"],
191
+ ["on", "2.0.0-defaults"],
192
+ ["delayed", "2.0.0-defaults"],
193
+ ]),
194
+ explicitSchemaControl: configValueToMinVersionForCollab([
195
+ [false, "1.0.0"],
196
+ [true, "2.0.0-defaults"],
197
+ ]),
198
+ flushMode: configValueToMinVersionForCollab([
199
+ [FlushMode.Immediate, "1.0.0"],
200
+ [FlushMode.TurnBased, "2.0.0-defaults"],
201
+ ]),
202
+ gcOptions: configValueToMinVersionForCollab([
203
+ [{ enableGCSweep: undefined }, "1.0.0"],
204
+ [{ enableGCSweep: true }, "2.0.0-defaults"],
205
+ ]),
206
+ createBlobPayloadPending: configValueToMinVersionForCollab([
207
+ [undefined, "1.0.0"],
208
+ [true, "2.40.0"],
209
+ ]),
210
+ };
203
211
 
204
212
  /**
205
213
  * Returns the default RuntimeOptionsAffectingDocSchema configuration for a given minVersionForCollab.
@@ -210,9 +218,7 @@ export function getMinVersionForCollabDefaults(
210
218
  return getConfigsForMinVersionForCollab(
211
219
  minVersionForCollab,
212
220
  runtimeOptionsAffectingDocSchemaConfigMap,
213
- // This is a bad cast away from Partial that getConfigsForCompatMode provides.
214
- // ConfigMap should be restructured to provide RuntimeOptionsAffectingDocSchema guarantee.
215
- ) as RuntimeOptionsAffectingDocSchema;
221
+ );
216
222
  }
217
223
 
218
224
  /**
@@ -224,9 +230,9 @@ export function validateRuntimeOptions(
224
230
  minVersionForCollab: MinimumVersionForCollab,
225
231
  runtimeOptions: Partial<ContainerRuntimeOptionsInternal>,
226
232
  ): void {
227
- getValidationForRuntimeOptions<RuntimeOptionsAffectingDocSchema>(
233
+ validateConfigMapOverrides<RuntimeOptionsAffectingDocSchema>(
228
234
  minVersionForCollab,
229
- runtimeOptions as Partial<RuntimeOptionsAffectingDocSchema>,
235
+ runtimeOptions,
230
236
  runtimeOptionsAffectingDocSchemaConfigValidationMap,
231
237
  );
232
238
  }
@@ -143,7 +143,7 @@ import {
143
143
  isValidMinVersionForCollab,
144
144
  RequestParser,
145
145
  RuntimeHeaders,
146
- semanticVersionToMinimumVersionForCollab,
146
+ validateMinimumVersionForCollab,
147
147
  seqFromTree,
148
148
  TelemetryContext,
149
149
  } from "@fluidframework/runtime-utils/internal";
@@ -1219,6 +1219,7 @@ export class ContainerRuntime
1219
1219
  createBlobPayloadPending,
1220
1220
  };
1221
1221
 
1222
+ validateMinimumVersionForCollab(updatedMinVersionForCollab);
1222
1223
  const runtime = new containerRuntimeCtor(
1223
1224
  context,
1224
1225
  registry,
@@ -1236,7 +1237,7 @@ export class ContainerRuntime
1236
1237
  documentSchemaController,
1237
1238
  featureGatesForTelemetry,
1238
1239
  provideEntryPoint,
1239
- semanticVersionToMinimumVersionForCollab(updatedMinVersionForCollab),
1240
+ updatedMinVersionForCollab,
1240
1241
  requestHandler,
1241
1242
  undefined, // summaryConfiguration
1242
1243
  recentBatchInfo,
@@ -4348,6 +4349,7 @@ export class ContainerRuntime
4348
4349
  if (lastAckedContext !== this.lastAckedSummaryContext) {
4349
4350
  return {
4350
4351
  continue: false,
4352
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
4351
4353
  error: `Last summary changed while summarizing. ${this.lastAckedSummaryContext} !== ${lastAckedContext}`,
4352
4354
  };
4353
4355
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.72.0";
9
+ export const pkgVersion = "2.74.0-365691";
@@ -107,8 +107,10 @@ export interface IDocumentSchemaInfo {
107
107
  * See {@link @fluidframework/container-runtime#LoadContainerRuntimeParams} for additional details on `minVersionForCollab`.
108
108
  *
109
109
  * @remarks
110
- * We use `SemanticVersion` instead of `MinimumVersionForCollab` since we may open future documents that with a
110
+ * We use `SemanticVersion` instead of `MinimumVersionForCollab` since we may open future documents with a
111
111
  * minVersionForCollab version that `MinimumVersionForCollab` does not support.
112
+ * Note that in such a case (where minVersionForCollab is not a valid `MinimumVersionForCollab`),
113
+ * loading the document might not work since this version of the runtime may not support it.
112
114
  */
113
115
  minVersionForCollab: SemanticVersion;
114
116
  }
@@ -27,7 +27,7 @@ import {
27
27
  import { summarizerClientType } from "./summarizerTypes.js";
28
28
 
29
29
  // helper types for recursive readonly.
30
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type, @typescript-eslint/ban-types
30
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
31
31
  export type ImmutablePrimitives = undefined | null | boolean | string | number | Function;
32
32
  export type Immutable<T> = T extends ImmutablePrimitives
33
33
  ? T