@fluidframework/container-runtime 2.41.0-338401 → 2.42.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.
Files changed (161) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/channelCollection.d.ts +1 -1
  4. package/dist/channelCollection.d.ts.map +1 -1
  5. package/dist/channelCollection.js +4 -4
  6. package/dist/channelCollection.js.map +1 -1
  7. package/dist/compatUtils.d.ts +22 -1
  8. package/dist/compatUtils.d.ts.map +1 -1
  9. package/dist/compatUtils.js +109 -7
  10. package/dist/compatUtils.js.map +1 -1
  11. package/dist/containerRuntime.d.ts +67 -28
  12. package/dist/containerRuntime.d.ts.map +1 -1
  13. package/dist/containerRuntime.js +332 -186
  14. package/dist/containerRuntime.js.map +1 -1
  15. package/dist/dataStore.d.ts.map +1 -1
  16. package/dist/dataStore.js +5 -0
  17. package/dist/dataStore.js.map +1 -1
  18. package/dist/gc/garbageCollection.d.ts.map +1 -1
  19. package/dist/gc/garbageCollection.js +2 -0
  20. package/dist/gc/garbageCollection.js.map +1 -1
  21. package/dist/gc/gcDefinitions.d.ts +1 -1
  22. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  23. package/dist/gc/gcDefinitions.js.map +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/messageTypes.d.ts +5 -4
  28. package/dist/messageTypes.d.ts.map +1 -1
  29. package/dist/messageTypes.js.map +1 -1
  30. package/dist/metadata.d.ts +1 -1
  31. package/dist/metadata.d.ts.map +1 -1
  32. package/dist/metadata.js.map +1 -1
  33. package/dist/opLifecycle/batchManager.d.ts +4 -0
  34. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  35. package/dist/opLifecycle/batchManager.js +7 -0
  36. package/dist/opLifecycle/batchManager.js.map +1 -1
  37. package/dist/opLifecycle/definitions.d.ts +6 -5
  38. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  39. package/dist/opLifecycle/definitions.js.map +1 -1
  40. package/dist/opLifecycle/index.d.ts +1 -1
  41. package/dist/opLifecycle/index.d.ts.map +1 -1
  42. package/dist/opLifecycle/index.js.map +1 -1
  43. package/dist/opLifecycle/opGroupingManager.d.ts +9 -0
  44. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  45. package/dist/opLifecycle/opGroupingManager.js +6 -4
  46. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  47. package/dist/opLifecycle/opSerialization.d.ts +2 -1
  48. package/dist/opLifecycle/opSerialization.d.ts.map +1 -1
  49. package/dist/opLifecycle/opSerialization.js.map +1 -1
  50. package/dist/opLifecycle/outbox.d.ts +1 -0
  51. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  52. package/dist/opLifecycle/outbox.js +6 -1
  53. package/dist/opLifecycle/outbox.js.map +1 -1
  54. package/dist/packageVersion.d.ts +1 -1
  55. package/dist/packageVersion.d.ts.map +1 -1
  56. package/dist/packageVersion.js +1 -1
  57. package/dist/packageVersion.js.map +1 -1
  58. package/dist/pendingStateManager.d.ts +22 -5
  59. package/dist/pendingStateManager.d.ts.map +1 -1
  60. package/dist/pendingStateManager.js +34 -11
  61. package/dist/pendingStateManager.js.map +1 -1
  62. package/dist/runCounter.d.ts.map +1 -1
  63. package/dist/runCounter.js +1 -1
  64. package/dist/runCounter.js.map +1 -1
  65. package/dist/summary/documentSchema.d.ts +42 -18
  66. package/dist/summary/documentSchema.d.ts.map +1 -1
  67. package/dist/summary/documentSchema.js +62 -52
  68. package/dist/summary/documentSchema.js.map +1 -1
  69. package/dist/summary/index.d.ts +1 -1
  70. package/dist/summary/index.d.ts.map +1 -1
  71. package/dist/summary/index.js.map +1 -1
  72. package/lib/channelCollection.d.ts +1 -1
  73. package/lib/channelCollection.d.ts.map +1 -1
  74. package/lib/channelCollection.js +4 -4
  75. package/lib/channelCollection.js.map +1 -1
  76. package/lib/compatUtils.d.ts +22 -1
  77. package/lib/compatUtils.d.ts.map +1 -1
  78. package/lib/compatUtils.js +102 -3
  79. package/lib/compatUtils.js.map +1 -1
  80. package/lib/containerRuntime.d.ts +67 -28
  81. package/lib/containerRuntime.d.ts.map +1 -1
  82. package/lib/containerRuntime.js +333 -188
  83. package/lib/containerRuntime.js.map +1 -1
  84. package/lib/dataStore.d.ts.map +1 -1
  85. package/lib/dataStore.js +5 -0
  86. package/lib/dataStore.js.map +1 -1
  87. package/lib/gc/garbageCollection.d.ts.map +1 -1
  88. package/lib/gc/garbageCollection.js +2 -0
  89. package/lib/gc/garbageCollection.js.map +1 -1
  90. package/lib/gc/gcDefinitions.d.ts +1 -1
  91. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  92. package/lib/gc/gcDefinitions.js.map +1 -1
  93. package/lib/index.d.ts +1 -1
  94. package/lib/index.d.ts.map +1 -1
  95. package/lib/index.js.map +1 -1
  96. package/lib/messageTypes.d.ts +5 -4
  97. package/lib/messageTypes.d.ts.map +1 -1
  98. package/lib/messageTypes.js.map +1 -1
  99. package/lib/metadata.d.ts +1 -1
  100. package/lib/metadata.d.ts.map +1 -1
  101. package/lib/metadata.js.map +1 -1
  102. package/lib/opLifecycle/batchManager.d.ts +4 -0
  103. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  104. package/lib/opLifecycle/batchManager.js +7 -0
  105. package/lib/opLifecycle/batchManager.js.map +1 -1
  106. package/lib/opLifecycle/definitions.d.ts +6 -5
  107. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  108. package/lib/opLifecycle/definitions.js.map +1 -1
  109. package/lib/opLifecycle/index.d.ts +1 -1
  110. package/lib/opLifecycle/index.d.ts.map +1 -1
  111. package/lib/opLifecycle/index.js.map +1 -1
  112. package/lib/opLifecycle/opGroupingManager.d.ts +9 -0
  113. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  114. package/lib/opLifecycle/opGroupingManager.js +6 -4
  115. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  116. package/lib/opLifecycle/opSerialization.d.ts +2 -1
  117. package/lib/opLifecycle/opSerialization.d.ts.map +1 -1
  118. package/lib/opLifecycle/opSerialization.js.map +1 -1
  119. package/lib/opLifecycle/outbox.d.ts +1 -0
  120. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  121. package/lib/opLifecycle/outbox.js +6 -1
  122. package/lib/opLifecycle/outbox.js.map +1 -1
  123. package/lib/packageVersion.d.ts +1 -1
  124. package/lib/packageVersion.d.ts.map +1 -1
  125. package/lib/packageVersion.js +1 -1
  126. package/lib/packageVersion.js.map +1 -1
  127. package/lib/pendingStateManager.d.ts +22 -5
  128. package/lib/pendingStateManager.d.ts.map +1 -1
  129. package/lib/pendingStateManager.js +34 -11
  130. package/lib/pendingStateManager.js.map +1 -1
  131. package/lib/runCounter.d.ts.map +1 -1
  132. package/lib/runCounter.js +1 -1
  133. package/lib/runCounter.js.map +1 -1
  134. package/lib/summary/documentSchema.d.ts +42 -18
  135. package/lib/summary/documentSchema.d.ts.map +1 -1
  136. package/lib/summary/documentSchema.js +62 -52
  137. package/lib/summary/documentSchema.js.map +1 -1
  138. package/lib/summary/index.d.ts +1 -1
  139. package/lib/summary/index.d.ts.map +1 -1
  140. package/lib/summary/index.js.map +1 -1
  141. package/package.json +19 -19
  142. package/src/channelCollection.ts +4 -4
  143. package/src/compatUtils.ts +145 -10
  144. package/src/containerRuntime.ts +472 -225
  145. package/src/dataStore.ts +7 -0
  146. package/src/gc/garbageCollection.ts +2 -0
  147. package/src/gc/gcDefinitions.ts +1 -1
  148. package/src/index.ts +2 -1
  149. package/src/messageTypes.ts +12 -5
  150. package/src/metadata.ts +1 -1
  151. package/src/opLifecycle/batchManager.ts +8 -0
  152. package/src/opLifecycle/definitions.ts +7 -3
  153. package/src/opLifecycle/index.ts +1 -0
  154. package/src/opLifecycle/opGroupingManager.ts +17 -4
  155. package/src/opLifecycle/opSerialization.ts +6 -1
  156. package/src/opLifecycle/outbox.ts +8 -1
  157. package/src/packageVersion.ts +1 -1
  158. package/src/pendingStateManager.ts +64 -20
  159. package/src/runCounter.ts +4 -1
  160. package/src/summary/documentSchema.ts +111 -86
  161. package/src/summary/index.ts +2 -1
@@ -10,46 +10,49 @@ const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  const packageVersion_js_1 = require("../packageVersion.js");
11
11
  /**
12
12
  * Current version known properties that define document schema
13
- * This must be bumped whenever the format of document schema or protocol for changing the current document schema changes.
14
- * Ex: adding a new configuration property (under IDocumentSchema.runtime) does not require changing this version.
15
- * Ex: Changing the 'document schema acceptance' mechanism from convert-and-swap to one requiring consensus does require changing this version.
13
+ * This must be bumped whenever the format of document schema or protocol for changing the current document schema changes
14
+ * in a way that all old/new clients are required to understand.
15
+ * Ex: Adding a new configuration property (under IDocumentSchema.runtime) does not require changing this version since there is logic
16
+ * in old clients for handling new/unknown properties.
17
+ * Ex: Changing the 'document schema acceptance' mechanism from convert-and-swap to one requiring consensus does require changing this version
18
+ * since all clients need to understand the new protocol.
16
19
  * @internal
17
20
  */
18
21
  exports.currentDocumentVersionSchema = 1;
19
22
  class TrueOrUndefined {
20
- and(currentDocSchema, desiredDocSchema) {
21
- return currentDocSchema === true && desiredDocSchema === true ? true : undefined;
23
+ and(persistedSchema, providedSchema) {
24
+ return persistedSchema === true && providedSchema === true ? true : undefined;
22
25
  }
23
- or(currentDocSchema, desiredDocSchema) {
24
- return currentDocSchema === true || desiredDocSchema === true ? true : undefined;
26
+ or(persistedSchema, providedSchema) {
27
+ return persistedSchema === true || providedSchema === true ? true : undefined;
25
28
  }
26
29
  validate(t) {
27
30
  return t === undefined || t === true;
28
31
  }
29
32
  }
30
33
  class TrueOrUndefinedMax extends TrueOrUndefined {
31
- and(currentDocSchema, desiredDocSchema) {
32
- return this.or(currentDocSchema, desiredDocSchema);
34
+ and(persistedSchema, providedSchema) {
35
+ return this.or(persistedSchema, providedSchema);
33
36
  }
34
37
  }
35
38
  class MultiChoice {
36
39
  constructor(choices) {
37
40
  this.choices = choices;
38
41
  }
39
- and(currentDocSchema, desiredDocSchema) {
40
- if (currentDocSchema === undefined || desiredDocSchema === undefined) {
42
+ and(persistedSchema, providedSchema) {
43
+ if (persistedSchema === undefined || providedSchema === undefined) {
41
44
  return undefined;
42
45
  }
43
- return this.choices[Math.min(this.choices.indexOf(currentDocSchema), this.choices.indexOf(desiredDocSchema))];
46
+ return this.choices[Math.min(this.choices.indexOf(persistedSchema), this.choices.indexOf(providedSchema))];
44
47
  }
45
- or(currentDocSchema, desiredDocSchema) {
46
- if (currentDocSchema === undefined) {
47
- return desiredDocSchema;
48
+ or(persistedSchema, providedSchema) {
49
+ if (persistedSchema === undefined) {
50
+ return providedSchema;
48
51
  }
49
- if (desiredDocSchema === undefined) {
50
- return currentDocSchema;
52
+ if (providedSchema === undefined) {
53
+ return persistedSchema;
51
54
  }
52
- return this.choices[Math.max(this.choices.indexOf(currentDocSchema), this.choices.indexOf(desiredDocSchema))];
55
+ return this.choices[Math.max(this.choices.indexOf(persistedSchema), this.choices.indexOf(providedSchema))];
53
56
  }
54
57
  validate(t) {
55
58
  return t === undefined || (typeof t === "string" && this.choices.includes(t));
@@ -57,18 +60,18 @@ class MultiChoice {
57
60
  }
58
61
  class IdCompressorProperty extends MultiChoice {
59
62
  // document schema always wins!
60
- and(currentDocSchema, desiredDocSchema) {
61
- return currentDocSchema;
63
+ and(persistedSchema, providedSchema) {
64
+ return persistedSchema;
62
65
  }
63
66
  }
64
67
  class CheckVersions {
65
- or(currentDocSchema = [], desiredDocSchema = []) {
66
- const set = new Set([...currentDocSchema, ...desiredDocSchema]);
68
+ or(persistedSchema = [], providedSchema = []) {
69
+ const set = new Set([...persistedSchema, ...providedSchema]);
67
70
  return arrayToProp([...set.values()]);
68
71
  }
69
72
  // Once version is there, it stays there forever.
70
- and(currentDocSchema = [], desiredDocSchema = []) {
71
- return this.or(currentDocSchema, desiredDocSchema);
73
+ and(persistedSchema = [], providedSchema = []) {
74
+ return this.or(persistedSchema, providedSchema);
72
75
  }
73
76
  validate(t) {
74
77
  return t === undefined || (Array.isArray(t) && !t.includes(packageVersion_js_1.pkgVersion));
@@ -136,42 +139,42 @@ function checkRuntimeCompatibility(documentSchema, schemaName) {
136
139
  });
137
140
  }
138
141
  }
139
- function and(currentDocSchema, desiredDocSchema) {
142
+ function and(persistedSchema, providedSchema) {
140
143
  const runtime = {};
141
144
  for (const key of new Set([
142
- ...Object.keys(currentDocSchema.runtime),
143
- ...Object.keys(desiredDocSchema.runtime),
145
+ ...Object.keys(persistedSchema.runtime),
146
+ ...Object.keys(providedSchema.runtime),
144
147
  ])) {
145
- runtime[key] = documentSchemaSupportedConfigs[key].and(currentDocSchema.runtime[key], desiredDocSchema.runtime[key]);
148
+ runtime[key] = documentSchemaSupportedConfigs[key].and(persistedSchema.runtime[key], providedSchema.runtime[key]);
146
149
  }
147
150
  return {
148
151
  version: exports.currentDocumentVersionSchema,
149
- refSeq: currentDocSchema.refSeq,
152
+ refSeq: persistedSchema.refSeq,
150
153
  runtime,
151
154
  };
152
155
  }
153
- function or(currentDocSchema, desiredDocSchema) {
156
+ function or(persistedSchema, providedSchema) {
154
157
  const runtime = {};
155
158
  for (const key of new Set([
156
- ...Object.keys(currentDocSchema.runtime),
157
- ...Object.keys(desiredDocSchema.runtime),
159
+ ...Object.keys(persistedSchema.runtime),
160
+ ...Object.keys(providedSchema.runtime),
158
161
  ])) {
159
- runtime[key] = documentSchemaSupportedConfigs[key].or(currentDocSchema.runtime[key], desiredDocSchema.runtime[key]);
162
+ runtime[key] = documentSchemaSupportedConfigs[key].or(persistedSchema.runtime[key], providedSchema.runtime[key]);
160
163
  }
161
164
  return {
162
165
  version: exports.currentDocumentVersionSchema,
163
- refSeq: currentDocSchema.refSeq,
166
+ refSeq: persistedSchema.refSeq,
164
167
  runtime,
165
168
  };
166
169
  }
167
- function same(currentDocSchema, desiredDocSchema) {
170
+ function same(persistedSchema, providedSchema) {
168
171
  for (const key of new Set([
169
- ...Object.keys(currentDocSchema.runtime),
170
- ...Object.keys(desiredDocSchema.runtime),
172
+ ...Object.keys(persistedSchema.runtime),
173
+ ...Object.keys(providedSchema.runtime),
171
174
  ])) {
172
175
  // If schemas differ only by type of behavior, then we should not send schema change ops!
173
176
  if (key !== "explicitSchemaControl" &&
174
- currentDocSchema.runtime[key] !== desiredDocSchema.runtime[key]) {
177
+ persistedSchema.runtime[key] !== providedSchema.runtime[key]) {
175
178
  return false;
176
179
  }
177
180
  }
@@ -260,7 +263,11 @@ class DocumentsSchemaController {
260
263
  */
261
264
  constructor(existing, snapshotSequenceNumber, documentMetadataSchema, features, onSchemaChange) {
262
265
  this.onSchemaChange = onSchemaChange;
263
- this.sendOp = true;
266
+ /**
267
+ * Have we generated a DocumentSchemaChange op and we're waiting for the ack?
268
+ * This is used to ensure that we do not generate multiple schema change ops - this client should only ever send one (if any).
269
+ */
270
+ this.opPending = false;
264
271
  // For simplicity, let's only support new schema features for explicit schema control mode
265
272
  (0, internal_1.assert)(features.disallowedVersions.length === 0 || features.explicitSchemaControl, 0x949 /* not supported */);
266
273
  // Desired schema by this session - almost all props are coming from arguments
@@ -278,7 +285,7 @@ class DocumentsSchemaController {
278
285
  };
279
286
  // Schema coming from document metadata (snapshot we loaded from), or if no document exists
280
287
  // (this is a new document) then this is the same as desiredSchema (same as session schema in such case).
281
- // Latter is importnat sure that's what will go into summary.
288
+ // Latter is important sure that's what will go into summary.
282
289
  this.documentSchema = existing
283
290
  ? (documentMetadataSchema ??
284
291
  ({
@@ -340,17 +347,14 @@ class DocumentsSchemaController {
340
347
  /**
341
348
  * Called by Container runtime whenever it is about to send some op.
342
349
  * It gives opportunity for controller to issue its own ops - we do not want to send ops if there are no local changes in document.
343
- * Please consider note above constructor about race conditions - current design is to send op only once in a session lifetime.
350
+ * Please consider note above constructor about race conditions - current design is to generate op only once in a session lifetime.
344
351
  * @returns Optional message to send.
345
352
  */
346
- maybeSendSchemaMessage() {
347
- if (this.sendOp && this.futureSchema !== undefined) {
348
- this.sendOp = false;
353
+ maybeGenerateSchemaMessage() {
354
+ if (this.futureSchema !== undefined && !this.opPending) {
355
+ this.opPending = true;
349
356
  (0, internal_1.assert)(this.explicitSchemaControl && this.futureSchema.runtime.explicitSchemaControl === true, 0x94e /* not legacy */);
350
- return {
351
- ...this.futureSchema,
352
- refSeq: this.documentSchema.refSeq,
353
- };
357
+ return this.futureSchema;
354
358
  }
355
359
  }
356
360
  validateSeqNumber(schemaSeqNumber, lastKnowSeqNumber, message) {
@@ -386,9 +390,12 @@ class DocumentsSchemaController {
386
390
  (0, internal_1.assert)(!local || (this.explicitSchemaControl && this.futureSchema !== undefined), 0x951 /* not sending ops */);
387
391
  // Changes are in effect. Immediately check that this client understands these changes
388
392
  checkRuntimeCompatibility(content, "change");
389
- const schema = { ...content, refSeq: sequenceNumber };
393
+ const schema = {
394
+ ...content,
395
+ refSeq: sequenceNumber,
396
+ };
390
397
  this.documentSchema = schema;
391
- this.sessionSchema = and(this.documentSchema, this.desiredSchema);
398
+ this.sessionSchema = and(schema, this.desiredSchema);
392
399
  (0, internal_1.assert)(this.sessionSchema.refSeq === sequenceNumber, 0x97d /* seq# */);
393
400
  // legacy behavior is automatically off for the document once someone sends a schema op -
394
401
  // from now on it's fully controlled by ops.
@@ -405,8 +412,11 @@ class DocumentsSchemaController {
405
412
  }
406
413
  return true;
407
414
  }
408
- onDisconnect() {
409
- this.sendOp = true;
415
+ /**
416
+ * Indicates the pending op was not ack'd and we may try to send it again if needed.
417
+ */
418
+ pendingOpNotAcked() {
419
+ this.opPending = false;
410
420
  }
411
421
  }
412
422
  exports.DocumentsSchemaController = DocumentsSchemaController;
@@ -1 +1 @@
1
- {"version":3,"file":"documentSchema.js","sourceRoot":"","sources":["../../src/summary/documentSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,uEAA+E;AAE/E,4DAAkD;AAyGlD;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAwB9C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gC,CAAC;YACvD,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAClE,IAAA,iBAAM,EAAC,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;YAEvE,yFAAyF;YACzF,4CAA4C;YAC5C,mFAAmF;YACnF,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;YAElC,mCAAmC;YACnC,sEAAsE;YACtE,6DAA6D;YAC7D,2FAA2F;YAC3F,qGAAqG;YACrG,+DAA+D;YAC/D,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;YAE9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,YAAY;QAClB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACpB,CAAC;CACD;AAxOD,8DAwOC;AAED,2CAA2C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { DataProcessingError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"../packageVersion.js\";\n\n/**\n * Descripe allowed type for properties in document schema.\n * Please note that for all property types we should use undefined to indicate that particular capability is off.\n * Using false, or some string value (like \"off\") will result in clients who do not understand that property failing, whereas\n * we want them to continue to collaborate alongside clients who support that capability, but such capability is shipping dark for now.\n * @internal\n */\nexport type DocumentSchemaValueType = string | string[] | true | number | undefined;\n\n/**\n * ID Compressor mode.\n * \"on\" - compressor is On. It's loaded as part of container load. This mode is sticky - once on, compressor is On for all\n * sessions for a given document. This results in IContainerRuntime.idCompressor to be always available.\n * \"delayed\" - ID compressor bundle is loaded only on establishing of first delta connection, i.e. it does not impact boot of cotnainer.\n * In such mode IContainerRuntime.idCompressor is not made available (unless previous sessions of same document had it \"On\").\n * The only thing that is available is IContainerRuntime.generateDocumentUniqueId() that provides opportunistically short IDs.\n * undefined - ID compressor is not loaded.\n * While IContainerRuntime.generateDocumentUniqueId() is available, it will produce long IDs that are do not compress well.\n *\n * @legacy\n * @alpha\n */\nexport type IdCompressorMode = \"on\" | \"delayed\" | undefined;\n\n/**\n * Document schema information.\n * Describes overall shape of document schema, including unknown (to this version) properties.\n *\n * Used by runtime to make a call if it can understand document schema.\n * If it can't, it should not continue with document and immediately fail, preventing random (cryptic) failures\n * down the road and potentially corrupting documents.\n * For now this structure and appropriate interpretation / behavior is focused only on runtime features.\n * In the future that could be interpolated to more areas, including DDSs used, and even possibly - application\n * schema.\n *\n * Runtime will ignore any properties at the root that it does not understand (i.e. IDocumentSchema.app), but will\n * stop (and fail session) on any unknown properties within \"runtime\" sub-tree.\n *\n * In most cases values preserved in the document will not dictate if such features should be enabled in a given session.\n * I.e. if compression is mentioned in document schema, this means that runtime version that opens such document must know\n * how to interpret such ops, but does not need to actually use compression itself. That said, some options could be\n * sticky, i.e. influence feature selection for all runtimes opening a document. ID compression is one such example.\n * Currently there is no mechanism to remove feature from this property bag, i.e. once compression was used, even if it's\n * disabled (through feature gate or code deployment), all existing documents that used compression will continue to fail\n * if opened by clients who do not support compression.\n *\n * For now we are limiting it to just plain properties, and only really simple types, but that can be changed in the future.\n *\n * @internal\n */\nexport interface IDocumentSchema {\n\t// version that describes how data is stored in this structure.\n\t// If runtime sees a version it does not understand, it should immediately fail and not\n\t// attempt to interpret any further data.\n\tversion: number;\n\n\t// Sequence number when this schema became active.\n\trefSeq: number;\n\n\truntime: Record<string, DocumentSchemaValueType>;\n}\n\n/**\n * Content of the type=ContainerMessageType.DocumentSchemaChange ops.\n * The meaning of refSeq field is different in such messages (compared to other usages of IDocumentSchemaCurrent)\n * ContainerMessageType.DocumentSchemaChange messages use CAS (Compare-and-swap) semantics, and convey\n * regSeq of last known schema change (known to a client proposing schema change).\n * @see ContainerRuntimeDocumentSchemaMessage\n * @internal\n */\nexport type IDocumentSchemaChangeMessage = IDocumentSchema;\n\n/**\n * Settings that this session would like to have, based on options and feature gates.\n *\n * WARNING: This type is used to infer IDocumentSchemaCurrent type!\n * Any changes here (including renaming of properties) are potentially changing document format and should be considered carefully!\n *\n * @internal\n */\nexport interface IDocumentSchemaFeatures {\n\t// Tells if client uses legacy behavior of changing schema.\n\t// - Legacy behavior - changing schema without leveraging schema change ops.\n\t// - New behavior - changes in schema require ops and take into affect with delay.\n\texplicitSchemaControl: boolean;\n\tcompressionLz4: boolean;\n\tidCompressorMode: IdCompressorMode;\n\topGroupingEnabled: boolean;\n\tcreateBlobPayloadPending: true | undefined;\n\n\t/**\n\t * List of disallowed versions of the runtime.\n\t * This option is sticky. Once a version of runtime is added to this list (when supplied to DocumentsSchemaController's constructor)\n\t * it will be added to the list of disallowed versions and stored in document metadata.\n\t * Each runtime checks if its version is in this list on container open. If it is, it immediately exits with error message\n\t * indicating to the user that this version is no longer supported.\n\t * Currently there is no mechanism to remove version from this list. I.e. If it was once added to the list,\n\t * it gets added to any document metadata (documents that gets open by this runtime) and there is no way to clear it from document's\n\t * metadata.\n\t */\n\tdisallowedVersions: string[];\n}\n\n/**\n * Current version known properties that define document schema\n * This must be bumped whenever the format of document schema or protocol for changing the current document schema changes.\n * Ex: adding a new configuration property (under IDocumentSchema.runtime) does not require changing this version.\n * Ex: Changing the 'document schema acceptance' mechanism from convert-and-swap to one requiring consensus does require changing this version.\n * @internal\n */\nexport const currentDocumentVersionSchema = 1;\n\n/**\n * Current document schema.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type IDocumentSchemaCurrent = {\n\tversion: 1;\n\trefSeq: number;\n\n\truntime: {\n\t\t[P in keyof IDocumentSchemaFeatures]?: IDocumentSchemaFeatures[P] extends boolean\n\t\t\t? true\n\t\t\t: IDocumentSchemaFeatures[P];\n\t};\n};\n\ninterface IProperty<T = unknown> {\n\tand: (currentDocSchema: T, desiredDocSchema: T) => T;\n\tor: (currentDocSchema: T, desiredDocSchema: T) => T;\n\tvalidate(t: unknown): boolean;\n}\n\nclass TrueOrUndefined implements IProperty<true | undefined> {\n\tpublic and(currentDocSchema?: true, desiredDocSchema?: true): true | undefined {\n\t\treturn currentDocSchema === true && desiredDocSchema === true ? true : undefined;\n\t}\n\n\tpublic or(currentDocSchema?: true, desiredDocSchema?: true): true | undefined {\n\t\treturn currentDocSchema === true || desiredDocSchema === true ? true : undefined;\n\t}\n\n\tpublic validate(t: unknown): t is true | undefined {\n\t\treturn t === undefined || t === true;\n\t}\n}\n\nclass TrueOrUndefinedMax extends TrueOrUndefined {\n\tpublic and(currentDocSchema?: true, desiredDocSchema?: true): true | undefined {\n\t\treturn this.or(currentDocSchema, desiredDocSchema);\n\t}\n}\n\nclass MultiChoice implements IProperty<string | undefined> {\n\tconstructor(private readonly choices: string[]) {}\n\n\tpublic and(currentDocSchema?: string, desiredDocSchema?: string): string | undefined {\n\t\tif (currentDocSchema === undefined || desiredDocSchema === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.choices[\n\t\t\tMath.min(this.choices.indexOf(currentDocSchema), this.choices.indexOf(desiredDocSchema))\n\t\t];\n\t}\n\n\tpublic or(currentDocSchema?: string, desiredDocSchema?: string): string | undefined {\n\t\tif (currentDocSchema === undefined) {\n\t\t\treturn desiredDocSchema;\n\t\t}\n\t\tif (desiredDocSchema === undefined) {\n\t\t\treturn currentDocSchema;\n\t\t}\n\t\treturn this.choices[\n\t\t\tMath.max(this.choices.indexOf(currentDocSchema), this.choices.indexOf(desiredDocSchema))\n\t\t];\n\t}\n\n\tpublic validate(t: unknown): boolean {\n\t\treturn t === undefined || (typeof t === \"string\" && this.choices.includes(t));\n\t}\n}\n\nclass IdCompressorProperty extends MultiChoice {\n\t// document schema always wins!\n\tpublic and(currentDocSchema?: string, desiredDocSchema?: string): string | undefined {\n\t\treturn currentDocSchema;\n\t}\n}\n\nclass CheckVersions implements IProperty<string[] | undefined> {\n\tpublic or(\n\t\tcurrentDocSchema: string[] = [],\n\t\tdesiredDocSchema: string[] = [],\n\t): string[] | undefined {\n\t\tconst set = new Set<string>([...currentDocSchema, ...desiredDocSchema]);\n\t\treturn arrayToProp([...set.values()]);\n\t}\n\n\t// Once version is there, it stays there forever.\n\tpublic and(\n\t\tcurrentDocSchema: string[] = [],\n\t\tdesiredDocSchema: string[] = [],\n\t): string[] | undefined {\n\t\treturn this.or(currentDocSchema, desiredDocSchema);\n\t}\n\n\tpublic validate(t: unknown): boolean {\n\t\treturn t === undefined || (Array.isArray(t) && !t.includes(pkgVersion));\n\t}\n}\n\n/**\n * Helper structure to valida if a schema is compatible with existing code.\n */\nconst documentSchemaSupportedConfigs = {\n\texplicitSchemaControl: new TrueOrUndefinedMax(), // once new behavior shows up, it's sticky\n\tidCompressorMode: new IdCompressorProperty([\"delayed\", \"on\"]),\n\topGroupingEnabled: new TrueOrUndefined(),\n\tcompressionLz4: new TrueOrUndefined(),\n\tcreateBlobPayloadPending: new TrueOrUndefined(),\n\tdisallowedVersions: new CheckVersions(),\n};\n\n/**\n * Checks if a given schema is compatible with current code, i.e. if current code can understand all the features of that schema.\n * If schema is not compatible with current code, it throws an exception.\n * @param documentSchema - current schema\n */\nfunction checkRuntimeCompatibility(\n\tdocumentSchema: IDocumentSchema | undefined,\n\tschemaName: string,\n): void {\n\t// Back-compat - we can't do anything about legacy documents.\n\t// There is no way to validate them, so we are taking a guess that safe deployment processes used by a given app\n\t// do not run into compat problems.\n\tif (documentSchema === undefined) {\n\t\treturn;\n\t}\n\n\tconst msg = \"Document can't be opened with current version of the code\";\n\tif (documentSchema.version !== currentDocumentVersionSchema) {\n\t\tthrow DataProcessingError.create(\n\t\t\tmsg,\n\t\t\t\"checkRuntimeCompat1\",\n\t\t\tundefined, // message\n\t\t\t{\n\t\t\t\truntimeSchemaVersion: documentSchema.version,\n\t\t\t\tcurrentRuntimeSchemaVersion: currentDocumentVersionSchema,\n\t\t\t\tschemaName,\n\t\t\t},\n\t\t);\n\t}\n\n\tlet unknownProperty: string | undefined;\n\n\tconst regSeq = documentSchema.refSeq;\n\t// defence in depth - it should not be possible to get here anything other than integer, but worth validating it.\n\tif (typeof regSeq !== \"number\" || regSeq < 0 || !Number.isInteger(regSeq)) {\n\t\tunknownProperty = \"refSeq\";\n\t} else if (documentSchema.runtime === null || typeof documentSchema.runtime !== \"object\") {\n\t\tunknownProperty = \"runtime\";\n\t} else {\n\t\tfor (const [name, value] of Object.entries(documentSchema.runtime)) {\n\t\t\tconst validator = documentSchemaSupportedConfigs[name] as IProperty | undefined;\n\t\t\tif (validator === undefined || !validator.validate(value)) {\n\t\t\t\tunknownProperty = `runtime/${name}`;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (unknownProperty !== undefined) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\tconst value = documentSchema[unknownProperty];\n\t\tthrow DataProcessingError.create(\n\t\t\tmsg,\n\t\t\t\"checkRuntimeCompat2\",\n\t\t\tundefined, // message\n\t\t\t{\n\t\t\t\tcodeVersion: currentDocumentVersionSchema,\n\t\t\t\tproperty: unknownProperty,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tvalue,\n\t\t\t\tschemaName,\n\t\t\t},\n\t\t);\n\t}\n}\n\nfunction and(\n\tcurrentDocSchema: IDocumentSchemaCurrent,\n\tdesiredDocSchema: IDocumentSchemaCurrent,\n): IDocumentSchemaCurrent {\n\tconst runtime = {};\n\tfor (const key of new Set([\n\t\t...Object.keys(currentDocSchema.runtime),\n\t\t...Object.keys(desiredDocSchema.runtime),\n\t])) {\n\t\truntime[key] = (documentSchemaSupportedConfigs[key] as IProperty).and(\n\t\t\tcurrentDocSchema.runtime[key],\n\t\t\tdesiredDocSchema.runtime[key],\n\t\t);\n\t}\n\treturn {\n\t\tversion: currentDocumentVersionSchema,\n\t\trefSeq: currentDocSchema.refSeq,\n\t\truntime,\n\t} as unknown as IDocumentSchemaCurrent;\n}\n\nfunction or(\n\tcurrentDocSchema: IDocumentSchemaCurrent,\n\tdesiredDocSchema: IDocumentSchemaCurrent,\n): IDocumentSchemaCurrent {\n\tconst runtime = {};\n\tfor (const key of new Set([\n\t\t...Object.keys(currentDocSchema.runtime),\n\t\t...Object.keys(desiredDocSchema.runtime),\n\t])) {\n\t\truntime[key] = (documentSchemaSupportedConfigs[key] as IProperty).or(\n\t\t\tcurrentDocSchema.runtime[key],\n\t\t\tdesiredDocSchema.runtime[key],\n\t\t);\n\t}\n\treturn {\n\t\tversion: currentDocumentVersionSchema,\n\t\trefSeq: currentDocSchema.refSeq,\n\t\truntime,\n\t} as unknown as IDocumentSchemaCurrent;\n}\n\nfunction same(\n\tcurrentDocSchema: IDocumentSchemaCurrent,\n\tdesiredDocSchema: IDocumentSchemaCurrent,\n): boolean {\n\tfor (const key of new Set([\n\t\t...Object.keys(currentDocSchema.runtime),\n\t\t...Object.keys(desiredDocSchema.runtime),\n\t])) {\n\t\t// If schemas differ only by type of behavior, then we should not send schema change ops!\n\t\tif (\n\t\t\tkey !== \"explicitSchemaControl\" &&\n\t\t\tcurrentDocSchema.runtime[key] !== desiredDocSchema.runtime[key]\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction boolToProp(b: boolean): true | undefined {\n\treturn b ? true : undefined;\n}\n\nfunction arrayToProp(arr: string[]): string[] | undefined {\n\treturn arr.length === 0 ? undefined : arr;\n}\n\n/* eslint-disable jsdoc/check-indentation */\n\n/**\n * Controller of document schema.\n *\n * Recommended pre-reading: https://github.com/microsoft/FluidFramework/blob/main/packages/dds/SchemaVersioning.md\n *\n * This class manages current document schema and transitions between document schemas.\n * At the moment, it only focuses on subset of document schema, specifically - how FluidFramework runtime serializes data\n * (summary and op format), features & capabilities that a version of runtime has to support and understand in\n * order to collaborate on a document.\n * New features that modify document format have to be included in document schema definition.\n * Usage of such features could only happen after document schema has been updated to reflect such feature.\n *\n * This formality allows clients that do not understand such features to fail right away when they observe\n * document schema listing capabilities that such client does not understand.\n * Old clients will fail in predictable way. This allows us to\n * 1) Immediately see such issues and adjust if features are enabled too early, before changes have been saturated.\n * 2) There is no way to get to 100% saturation with new code. Even if we have 99.99% saturation, there are\n * still 0.01% of clients who will fail. Failing early and predictably ensures they have no chance to limp along\n * and potentially corrupt the document. This is especially true for summarizer client, who could simply \"undo\"\n * changes it does not understands.\n *\n * It's important to note how it overlaps with feature gates and safe velocity.\n * If new feature was in use, that resulted in a number of documents referencing such feature in document schema.\n * But, developers (through code deployment or feature gates) could disable usage of such features.\n * That will stop a process of further document schema changes (for documents that were not using such feature).\n * And documents that already list such capability in their schema will continue to do so. Later ensures that old\n * clients who do not understand such feature will continue to fail to open such documents, as such documents very\n * likely contain data in a new format.\n *\n * Controller operates with 4 schemas:\n * - document schema: whatever we loaded from summary metadata + ops. It follows eventuall consistency rules (i.e. like DDS).\n * - desired schema - what client is asking for to have (i.e. all the desired settings, based on runtime options / feature gates).\n * - session schema - current session schema. It's \"and\" of the above two schemas.\n * - future schema - \"or\" of document and desires schemas.\n *\n * \"or\" & \"and\" operators are defined individually for each property. For Boolean properties it's literally &&, || operators.\n * But for other properties it's more nuanced.\n *\n * Whenver document schema does not match future schema, controller will send an op that attempts to changs documents schema to\n * future schema.\n *\n * Users of this class need to use DocumentsSchemaController.sessionSchema to determine what features can be used.\n *\n * There are two modes this class can operate:\n * 1) Legacy mode. In such mode it does not issue any ops to change document schema. Any changes happen implicitly,\n * right away, and new features are available right away\n * 2) Non-legacy mode. In such mode any changes to schema require an op roundtrip. This class will manage such transitions.\n * However code should assume that any new features that were not enabled in a given document will not be available\n * for a given session. That's because this session may never send any ops (including read-only documents). Or it may\n * fail to convert schema.\n * This class promises eventual movement forward. I.e. if new feature is allowed (let's say - through feature gates),\n * then eventually all documents that are modified will have that feature reflected in their schema. It could require\n * multiple reloads / new sessions to get there (depends on if code reacts to schema changes right away, or only consults\n * schema on document load).\n *\n * How schemas are changed (in non-legacy mode):\n * If a client needs to change a schema, it will attempt to do so as part of normal ops sending process.\n * Changes happen in CAS (Compare-and-swap) fashion, i.e. client tells current schema and schema it wants to change to.\n * When a number of clients race to change a schema, then only one of them will win, all others will fail because they will\n * reference old schema that is no longer in effect.\n * Clients can retry, but current implementation is simply - they will not (and will rely on next session / reload to do\n * recalc and decide if schema needs to be changed or not).\n *\n * @internal\n * @sealed\n */\nexport class DocumentsSchemaController {\n\tprivate explicitSchemaControl: boolean;\n\tprivate sendOp = true;\n\n\t// schema coming from document metadata (snapshot we loaded from)\n\tprivate documentSchema: IDocumentSchemaCurrent;\n\n\t// desired schema, based on feature gates / runtime options.\n\t// This includes requests to enable to disable functionality\n\tprivate readonly desiredSchema: IDocumentSchemaCurrent;\n\n\t// OR() of document schema and desired schema. It enables all the features that are enabled in either of schemas.\n\tprivate futureSchema: IDocumentSchemaCurrent | undefined;\n\n\t// Current schema this session operates with.\n\t// 1) Legacy mode (explicitSchemaControl === false): this is same as desired schema - all options that were requested to be on are on, and all options requested to be off are off.\n\t// 2) Non-legacy mode (explicitSchemaControl === true): this is AND() of document schema and desired schema. Only options that are enabled in both are enabled here.\n\t// If there are any options that are not enabled in document schema, but are enabled in desired schema, then attempt to change schema\n\t// (and enable such options) will be made through the session.\n\tpublic sessionSchema: IDocumentSchemaCurrent;\n\n\t/**\n\t * Constructs DocumentsSchemaController that controls current schema and processes around it, including changes in schema.\n\t * @param existing - Is the document existing document, or a new doc.\n\t * @param documentMetadataSchema - current document's schema, if present.\n\t * @param features - features of the document schema that current session wants to see enabled.\n\t * @param onSchemaChange - callback that is called whenever schema is changed (not called on creation / load, only when processing document schema change ops)\n\t */\n\tconstructor(\n\t\texisting: boolean,\n\t\tsnapshotSequenceNumber: number,\n\t\tdocumentMetadataSchema: IDocumentSchema | undefined,\n\t\tfeatures: IDocumentSchemaFeatures,\n\t\tprivate readonly onSchemaChange: (schema: IDocumentSchemaCurrent) => void,\n\t) {\n\t\t// For simplicity, let's only support new schema features for explicit schema control mode\n\t\tassert(\n\t\t\tfeatures.disallowedVersions.length === 0 || features.explicitSchemaControl,\n\t\t\t0x949 /* not supported */,\n\t\t);\n\n\t\t// Desired schema by this session - almost all props are coming from arguments\n\t\tthis.desiredSchema = {\n\t\t\tversion: currentDocumentVersionSchema,\n\t\t\trefSeq: documentMetadataSchema?.refSeq ?? 0,\n\t\t\truntime: {\n\t\t\t\texplicitSchemaControl: boolToProp(features.explicitSchemaControl),\n\t\t\t\tcompressionLz4: boolToProp(features.compressionLz4),\n\t\t\t\tidCompressorMode: features.idCompressorMode,\n\t\t\t\topGroupingEnabled: boolToProp(features.opGroupingEnabled),\n\t\t\t\tcreateBlobPayloadPending: features.createBlobPayloadPending,\n\t\t\t\tdisallowedVersions: arrayToProp(features.disallowedVersions),\n\t\t\t},\n\t\t};\n\n\t\t// Schema coming from document metadata (snapshot we loaded from), or if no document exists\n\t\t// (this is a new document) then this is the same as desiredSchema (same as session schema in such case).\n\t\t// Latter is importnat sure that's what will go into summary.\n\t\tthis.documentSchema = existing\n\t\t\t? ((documentMetadataSchema as IDocumentSchemaCurrent) ??\n\t\t\t\t({\n\t\t\t\t\tversion: currentDocumentVersionSchema,\n\t\t\t\t\t// see comment in summarizeDocumentSchema() on why it has to stay zero\n\t\t\t\t\trefSeq: 0,\n\t\t\t\t\t// If it's existing document and it has no schema, then it was written by legacy client.\n\t\t\t\t\t// If it's a new document, then we define it's legacy-related behaviors.\n\t\t\t\t\truntime: {\n\t\t\t\t\t\texplicitSchemaControl: boolToProp(!existing && features.explicitSchemaControl),\n\t\t\t\t\t},\n\t\t\t\t} satisfies IDocumentSchemaCurrent))\n\t\t\t: this.desiredSchema;\n\n\t\tcheckRuntimeCompatibility(this.documentSchema, \"document\");\n\t\tthis.validateSeqNumber(this.documentSchema.refSeq, snapshotSequenceNumber, \"summary\");\n\n\t\t// Use legacy behavior only if both document and options tell us to use legacy.\n\t\t// Otherwise it's no longer legacy time!\n\t\tthis.explicitSchemaControl =\n\t\t\tthis.documentSchema.runtime.explicitSchemaControl === true ||\n\t\t\tfeatures.explicitSchemaControl;\n\n\t\t// Calculate\n\t\t// - current session schema (overlap of document schema and desired schema)\n\t\t// - future schema to propose (concatination of document schema and desired schema)\n\t\tif (!this.explicitSchemaControl || !existing) {\n\t\t\tthis.sessionSchema = this.desiredSchema;\n\t\t\tassert(\n\t\t\t\tboolToProp(this.explicitSchemaControl) ===\n\t\t\t\t\tthis.sessionSchema.runtime.explicitSchemaControl,\n\t\t\t\t0x94a /* explicitSchemaControl */,\n\t\t\t);\n\t\t\tthis.futureSchema = undefined;\n\t\t} else {\n\t\t\tthis.sessionSchema = and(this.documentSchema, this.desiredSchema);\n\t\t\tthis.futureSchema = or(this.documentSchema, this.desiredSchema);\n\t\t\tassert(this.sessionSchema.runtime.explicitSchemaControl === true, 0x94b /* legacy */);\n\t\t\tassert(this.futureSchema.runtime.explicitSchemaControl === true, 0x94c /* legacy */);\n\t\t\tif (same(this.documentSchema, this.futureSchema)) {\n\t\t\t\tthis.futureSchema = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Validate that schema we are operating in is actually a schema we consider compatible with current runtime.\n\t\tcheckRuntimeCompatibility(this.desiredSchema, \"desired\");\n\t\tcheckRuntimeCompatibility(this.sessionSchema, \"session\");\n\t\tcheckRuntimeCompatibility(this.futureSchema, \"future\");\n\t}\n\n\tpublic summarizeDocumentSchema(refSeq: number): IDocumentSchemaCurrent | undefined {\n\t\t// For legacy behavior, we could write nothing (return undefined).\n\t\t// It does not buy us anything, as whatever written in summary does not actually impact clients operating in legacy mode.\n\t\t// But writing current used config (and assuming most of the clients settle on same config over time) will help with transition\n\t\t// out of legacy mode, as clients transitioning out of it would be able to use all the\n\t\t// features that are mentioned in schema right away, without a need to go through schema transition (and thus for a session or\n\t\t// two losing ability to use all the features)\n\n\t\tconst schema = this.explicitSchemaControl ? this.documentSchema : this.desiredSchema;\n\n\t\t// It's important to keep refSeq at zero in legacy mode, such that transition out of it is simple and we do not have\n\t\t// race conditions. If we put any other number (including latest seq number), then we will have two clients\n\t\t// (loading from two different summaries) with different numbers, and eventual consistency will be broken as schema\n\t\t// change ops will be interpretted differently by those two clients.\n\t\tassert(\n\t\t\tthis.explicitSchemaControl || schema.refSeq === 0,\n\t\t\t0x94d /* refSeq should be zero */,\n\t\t);\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Called by Container runtime whenever it is about to send some op.\n\t * It gives opportunity for controller to issue its own ops - we do not want to send ops if there are no local changes in document.\n\t * Please consider note above constructor about race conditions - current design is to send op only once in a session lifetime.\n\t * @returns Optional message to send.\n\t */\n\tpublic maybeSendSchemaMessage(): IDocumentSchemaChangeMessage | undefined {\n\t\tif (this.sendOp && this.futureSchema !== undefined) {\n\t\t\tthis.sendOp = false;\n\t\t\tassert(\n\t\t\t\tthis.explicitSchemaControl && this.futureSchema.runtime.explicitSchemaControl === true,\n\t\t\t\t0x94e /* not legacy */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\t...this.futureSchema,\n\t\t\t\trefSeq: this.documentSchema.refSeq,\n\t\t\t};\n\t\t}\n\t}\n\n\tprivate validateSeqNumber(\n\t\tschemaSeqNumber: number,\n\t\tlastKnowSeqNumber: number,\n\t\tmessage: string,\n\t): void {\n\t\tif (!Number.isInteger(schemaSeqNumber) || !(schemaSeqNumber <= lastKnowSeqNumber)) {\n\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\"DocSchema: Incorrect sequence number\",\n\t\t\t\t\"checkRuntimeCompat3\",\n\t\t\t\tundefined, // message\n\t\t\t\t{\n\t\t\t\t\tschemaSeqNumber,\n\t\t\t\t\tsequenceNumber: lastKnowSeqNumber,\n\t\t\t\t\tmessage,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Process document schema change messages\n\t * Called by ContainerRuntime whenever it sees document schema messages.\n\t * @param contents - contents of the messages\n\t * @param local - whether op is local\n\t * @param sequenceNumber - sequence number of the op\n\t * @returns - true if schema was accepted, otherwise false (rejected due to failed CAS)\n\t */\n\tpublic processDocumentSchemaMessages(\n\t\tcontents: IDocumentSchemaChangeMessage[],\n\t\tlocal: boolean,\n\t\tsequenceNumber: number,\n\t): boolean {\n\t\tfor (const content of contents) {\n\t\t\tthis.validateSeqNumber(content.refSeq, this.documentSchema.refSeq, \"content.refSeq\");\n\t\t\tthis.validateSeqNumber(this.documentSchema.refSeq, sequenceNumber, \"refSeq\");\n\t\t\t// validate is strickly less, not equal\n\t\t\tassert(\n\t\t\t\tthis.documentSchema.refSeq < sequenceNumber,\n\t\t\t\t0x950 /* time should move forward only! */,\n\t\t\t);\n\n\t\t\tif (content.refSeq !== this.documentSchema.refSeq) {\n\t\t\t\t// CAS failed\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// This assert should be after checking for successful CAS above.\n\t\t\t// This will ensure we do not trip on our own messages that are no longer wanted as we processed someone else schema change message.\n\t\t\tassert(\n\t\t\t\t!local || (this.explicitSchemaControl && this.futureSchema !== undefined),\n\t\t\t\t0x951 /* not sending ops */,\n\t\t\t);\n\n\t\t\t// Changes are in effect. Immediately check that this client understands these changes\n\t\t\tcheckRuntimeCompatibility(content, \"change\");\n\n\t\t\tconst schema: IDocumentSchema = { ...content, refSeq: sequenceNumber };\n\t\t\tthis.documentSchema = schema as IDocumentSchemaCurrent;\n\t\t\tthis.sessionSchema = and(this.documentSchema, this.desiredSchema);\n\t\t\tassert(this.sessionSchema.refSeq === sequenceNumber, 0x97d /* seq# */);\n\n\t\t\t// legacy behavior is automatically off for the document once someone sends a schema op -\n\t\t\t// from now on it's fully controlled by ops.\n\t\t\t// This is very important, as summarizeDocumentSchema() should use this new schema!\n\t\t\tthis.explicitSchemaControl = true;\n\n\t\t\t// Stop attempting changing schema.\n\t\t\t// If it was local op, then we succeeded and do not need to try again.\n\t\t\t// If it was remote op, then some changes happened to schema.\n\t\t\t// We would need to recalculate this.futureSchema by merging changes that we just received.\n\t\t\t// Avoid this complexity for now - a new client session (loading from new summary with these changes)\n\t\t\t// will automatically do this recalculation and will figure out\n\t\t\tthis.futureSchema = undefined;\n\n\t\t\tthis.onSchemaChange(this.sessionSchema);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic onDisconnect(): void {\n\t\tthis.sendOp = true;\n\t}\n}\n\n/* eslint-enable jsdoc/check-indentation */\n"]}
1
+ {"version":3,"file":"documentSchema.js","sourceRoot":"","sources":["../../src/summary/documentSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,uEAA+E;AAE/E,4DAAkD;AAyHlD;;;;;;;;;GASG;AACU,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAsB9C,MAAM,eAAe;IACb,GAAG,CAAC,eAAsB,EAAE,cAAqB;QACvD,OAAO,eAAe,KAAK,IAAI,IAAI,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;IAEM,EAAE,CAAC,eAAsB,EAAE,cAAqB;QACtD,OAAO,eAAe,KAAK,IAAI,IAAI,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;IAEM,QAAQ,CAAC,CAAU;QACzB,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;IACtC,CAAC;CACD;AAED,MAAM,kBAAmB,SAAQ,eAAe;IACxC,GAAG,CAAC,eAAsB,EAAE,cAAqB;QACvD,OAAO,IAAI,CAAC,EAAE,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IACjD,CAAC;CACD;AAED,MAAM,WAAW;IAChB,YAA6B,OAAiB;QAAjB,YAAO,GAAP,OAAO,CAAU;IAAG,CAAC;IAE3C,GAAG,CAAC,eAAwB,EAAE,cAAuB;QAC3D,IAAI,eAAe,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACnE,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,O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,IAAI,CAAC,YAAY,KAAK,SAAS,CAAC,EACzE,KAAK,CAAC,qBAAqB,CAC3B,CAAC;YAEF,sFAAsF;YACtF,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC7C,MAAM,MAAM,GAAG;gBACd,GAAG,OAAO;gBACV,MAAM,EAAE,cAAc;aACW,CAAC;YACnC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;YAC7B,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YACrD,IAAA,iBAAM,EAAC,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;YAEvE,yFAAyF;YACzF,4CAA4C;YAC5C,mFAAmF;YACnF,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;YAElC,mCAAmC;YACnC,sEAAsE;YACtE,6DAA6D;YAC7D,2FAA2F;YAC3F,qGAAqG;YACrG,+DAA+D;YAC/D,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;YAE9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACI,iBAAiB;QACvB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACxB,CAAC;CACD;AAhPD,8DAgPC;AAED,2CAA2C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { DataProcessingError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"../packageVersion.js\";\n\n/**\n * Descripe allowed type for properties in document schema.\n * Please note that for all property types we should use undefined to indicate that particular capability is off.\n * Using false, or some string value (like \"off\") will result in clients who do not understand that property failing, whereas\n * we want them to continue to collaborate alongside clients who support that capability, but such capability is shipping dark for now.\n * @internal\n */\nexport type DocumentSchemaValueType = string | string[] | true | number | undefined;\n\n/**\n * ID Compressor mode.\n * \"on\" - compressor is On. It's loaded as part of container load. This mode is sticky - once on, compressor is On for all\n * sessions for a given document. This results in IContainerRuntime.idCompressor to be always available.\n * \"delayed\" - ID compressor bundle is loaded only on establishing of first delta connection, i.e. it does not impact boot of cotnainer.\n * In such mode IContainerRuntime.idCompressor is not made available (unless previous sessions of same document had it \"On\").\n * The only thing that is available is IContainerRuntime.generateDocumentUniqueId() that provides opportunistically short IDs.\n * undefined - ID compressor is not loaded.\n * While IContainerRuntime.generateDocumentUniqueId() is available, it will produce long IDs that are do not compress well.\n *\n * @legacy\n * @alpha\n */\nexport type IdCompressorMode = \"on\" | \"delayed\" | undefined;\n\n/**\n * Document schema information.\n * Describes overall shape of document schema, including unknown (to this version) properties.\n *\n * Used by runtime to make a call if it can understand document schema.\n * If it can't, it should not continue with document and immediately fail, preventing random (cryptic) failures\n * down the road and potentially corrupting documents.\n * For now this structure and appropriate interpretation / behavior is focused only on runtime features.\n * In the future that could be interpolated to more areas, including DDSs used, and even possibly - application\n * schema.\n *\n * Runtime will ignore any properties at the root that it does not understand (i.e. IDocumentSchema.app), but will\n * stop (and fail session) on any unknown properties within \"runtime\" sub-tree.\n *\n * In most cases values preserved in the document will not dictate if such features should be enabled in a given session.\n * I.e. if compression is mentioned in document schema, this means that runtime version that opens such document must know\n * how to interpret such ops, but does not need to actually use compression itself. That said, some options could be\n * sticky, i.e. influence feature selection for all runtimes opening a document. ID compression is one such example.\n * Currently there is no mechanism to remove feature from this property bag, i.e. once compression was used, even if it's\n * disabled (through feature gate or code deployment), all existing documents that used compression will continue to fail\n * if opened by clients who do not support compression.\n *\n * For now we are limiting it to just plain properties, and only really simple types, but that can be changed in the future.\n *\n * @internal\n */\nexport interface IDocumentSchema {\n\t// Note: Incoming schemas from other clients may have additional root-level properties (i.e. IDocumentSchema.app)\n\t// that this client does not understand. The runtime will ignore these properties, unless they are within the\n\t// \"runtime\" sub-tree, in which case it will fail if it is unable to understand any runtime properties.\n\n\t/**\n\t * Describes how data needed to understand the schema is stored in this structure.\n\t * If runtime sees a version it does not understand, it should immediately fail and not\n\t * attempt to interpret any further data.\n\t */\n\tversion: number;\n\n\t/**\n\t * Sequence number when this schema became active.\n\t */\n\trefSeq: number;\n\n\t/**\n\t * Runtime configurations that affect the document schema. Other clients must understand these\n\t * properties to be able to open the document.\n\t */\n\truntime: Record<string, DocumentSchemaValueType>;\n}\n\n/**\n * Content of the type=ContainerMessageType.DocumentSchemaChange ops.\n * @see InboundContainerRuntimeDocumentSchemaMessage\n * @internal\n */\nexport type IDocumentSchemaChangeMessageIncoming = IDocumentSchema;\n\n/**\n * Similar to {@link IDocumentSchemaChangeMessageIncoming}, but used for outgoing schema messages.\n * @see OutboundContainerRuntimeDocumentSchemaMessage\n * @internal\n */\nexport type IDocumentSchemaChangeMessageOutgoing = IDocumentSchemaCurrent;\n\n/**\n * Settings that this session would like to have, based on options and feature gates.\n *\n * WARNING: This type is used to infer IDocumentSchemaCurrent type!\n * Any changes here (including renaming of properties) are potentially changing document format and should be considered carefully!\n *\n * @internal\n */\nexport interface IDocumentSchemaFeatures {\n\t// Tells if client uses legacy behavior of changing schema.\n\t// - Legacy behavior - changing schema without leveraging schema change ops.\n\t// - New behavior - changes in schema require ops and take into affect with delay.\n\texplicitSchemaControl: boolean;\n\tcompressionLz4: boolean;\n\tidCompressorMode: IdCompressorMode;\n\topGroupingEnabled: boolean;\n\tcreateBlobPayloadPending: true | undefined;\n\n\t/**\n\t * List of disallowed versions of the runtime.\n\t * This option is sticky. Once a version of runtime is added to this list (when supplied to DocumentsSchemaController's constructor)\n\t * it will be added to the list of disallowed versions and stored in document metadata.\n\t * Each runtime checks if its version is in this list on container open. If it is, it immediately exits with error message\n\t * indicating to the user that this version is no longer supported.\n\t * Currently there is no mechanism to remove version from this list. I.e. If it was once added to the list,\n\t * it gets added to any document metadata (documents that gets open by this runtime) and there is no way to clear it from document's\n\t * metadata.\n\t */\n\tdisallowedVersions: string[];\n}\n\n/**\n * Current version known properties that define document schema\n * This must be bumped whenever the format of document schema or protocol for changing the current document schema changes\n * in a way that all old/new clients are required to understand.\n * Ex: Adding a new configuration property (under IDocumentSchema.runtime) does not require changing this version since there is logic\n * in old clients for handling new/unknown properties.\n * Ex: Changing the 'document schema acceptance' mechanism from convert-and-swap to one requiring consensus does require changing this version\n * since all clients need to understand the new protocol.\n * @internal\n */\nexport const currentDocumentVersionSchema = 1;\n\n/**\n * Current document schema.\n * @internal\n */\nexport interface IDocumentSchemaCurrent extends Required<IDocumentSchema> {\n\t// This is the version of the schema that we currently understand.\n\tversion: typeof currentDocumentVersionSchema;\n\truntime: {\n\t\t[P in keyof IDocumentSchemaFeatures]?: IDocumentSchemaFeatures[P] extends boolean\n\t\t\t? true\n\t\t\t: IDocumentSchemaFeatures[P];\n\t};\n}\n\ninterface IProperty<T = unknown> {\n\tand: (persistedSchema: T, providedSchema: T) => T;\n\tor: (persistedSchema: T, providedSchema: T) => T;\n\tvalidate(t: unknown): boolean;\n}\n\nclass TrueOrUndefined implements IProperty<true | undefined> {\n\tpublic and(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn persistedSchema === true && providedSchema === true ? true : undefined;\n\t}\n\n\tpublic or(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn persistedSchema === true || providedSchema === true ? true : undefined;\n\t}\n\n\tpublic validate(t: unknown): t is true | undefined {\n\t\treturn t === undefined || t === true;\n\t}\n}\n\nclass TrueOrUndefinedMax extends TrueOrUndefined {\n\tpublic and(persistedSchema?: true, providedSchema?: true): true | undefined {\n\t\treturn this.or(persistedSchema, providedSchema);\n\t}\n}\n\nclass MultiChoice implements IProperty<string | undefined> {\n\tconstructor(private readonly choices: string[]) {}\n\n\tpublic and(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\tif (persistedSchema === undefined || providedSchema === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.choices[\n\t\t\tMath.min(this.choices.indexOf(persistedSchema), this.choices.indexOf(providedSchema))\n\t\t];\n\t}\n\n\tpublic or(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\tif (persistedSchema === undefined) {\n\t\t\treturn providedSchema;\n\t\t}\n\t\tif (providedSchema === undefined) {\n\t\t\treturn persistedSchema;\n\t\t}\n\t\treturn this.choices[\n\t\t\tMath.max(this.choices.indexOf(persistedSchema), this.choices.indexOf(providedSchema))\n\t\t];\n\t}\n\n\tpublic validate(t: unknown): boolean {\n\t\treturn t === undefined || (typeof t === \"string\" && this.choices.includes(t));\n\t}\n}\n\nclass IdCompressorProperty extends MultiChoice {\n\t// document schema always wins!\n\tpublic and(persistedSchema?: string, providedSchema?: string): string | undefined {\n\t\treturn persistedSchema;\n\t}\n}\n\nclass CheckVersions implements IProperty<string[] | undefined> {\n\tpublic or(\n\t\tpersistedSchema: string[] = [],\n\t\tprovidedSchema: string[] = [],\n\t): string[] | undefined {\n\t\tconst set = new Set<string>([...persistedSchema, ...providedSchema]);\n\t\treturn arrayToProp([...set.values()]);\n\t}\n\n\t// Once version is there, it stays there forever.\n\tpublic and(\n\t\tpersistedSchema: string[] = [],\n\t\tprovidedSchema: string[] = [],\n\t): string[] | undefined {\n\t\treturn this.or(persistedSchema, providedSchema);\n\t}\n\n\tpublic validate(t: unknown): boolean {\n\t\treturn t === undefined || (Array.isArray(t) && !t.includes(pkgVersion));\n\t}\n}\n\n/**\n * Helper structure to valida if a schema is compatible with existing code.\n */\nconst documentSchemaSupportedConfigs = {\n\texplicitSchemaControl: new TrueOrUndefinedMax(), // once new behavior shows up, it's sticky\n\tidCompressorMode: new IdCompressorProperty([\"delayed\", \"on\"]),\n\topGroupingEnabled: new TrueOrUndefined(),\n\tcompressionLz4: new TrueOrUndefined(),\n\tcreateBlobPayloadPending: new TrueOrUndefined(),\n\tdisallowedVersions: new CheckVersions(),\n};\n\n/**\n * Checks if a given schema is compatible with current code, i.e. if current code can understand all the features of that schema.\n * If schema is not compatible with current code, it throws an exception.\n * @param documentSchema - current schema\n */\nfunction checkRuntimeCompatibility(\n\tdocumentSchema: IDocumentSchema | undefined,\n\tschemaName: string,\n): asserts documentSchema is IDocumentSchemaCurrent {\n\t// Back-compat - we can't do anything about legacy documents.\n\t// There is no way to validate them, so we are taking a guess that safe deployment processes used by a given app\n\t// do not run into compat problems.\n\tif (documentSchema === undefined) {\n\t\treturn;\n\t}\n\n\tconst msg = \"Document can't be opened with current version of the code\";\n\tif (documentSchema.version !== currentDocumentVersionSchema) {\n\t\tthrow DataProcessingError.create(\n\t\t\tmsg,\n\t\t\t\"checkRuntimeCompat1\",\n\t\t\tundefined, // message\n\t\t\t{\n\t\t\t\truntimeSchemaVersion: documentSchema.version,\n\t\t\t\tcurrentRuntimeSchemaVersion: currentDocumentVersionSchema,\n\t\t\t\tschemaName,\n\t\t\t},\n\t\t);\n\t}\n\n\tlet unknownProperty: string | undefined;\n\n\tconst regSeq = documentSchema.refSeq;\n\t// defence in depth - it should not be possible to get here anything other than integer, but worth validating it.\n\tif (typeof regSeq !== \"number\" || regSeq < 0 || !Number.isInteger(regSeq)) {\n\t\tunknownProperty = \"refSeq\";\n\t} else if (documentSchema.runtime === null || typeof documentSchema.runtime !== \"object\") {\n\t\tunknownProperty = \"runtime\";\n\t} else {\n\t\tfor (const [name, value] of Object.entries(documentSchema.runtime)) {\n\t\t\tconst validator = documentSchemaSupportedConfigs[name] as IProperty | undefined;\n\t\t\tif (validator === undefined || !validator.validate(value)) {\n\t\t\t\tunknownProperty = `runtime/${name}`;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (unknownProperty !== undefined) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\tconst value = documentSchema[unknownProperty];\n\t\tthrow DataProcessingError.create(\n\t\t\tmsg,\n\t\t\t\"checkRuntimeCompat2\",\n\t\t\tundefined, // message\n\t\t\t{\n\t\t\t\tcodeVersion: currentDocumentVersionSchema,\n\t\t\t\tproperty: unknownProperty,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tvalue,\n\t\t\t\tschemaName,\n\t\t\t},\n\t\t);\n\t}\n}\n\nfunction and(\n\tpersistedSchema: IDocumentSchemaCurrent,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): IDocumentSchemaCurrent {\n\tconst runtime = {};\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\truntime[key] = (documentSchemaSupportedConfigs[key] as IProperty).and(\n\t\t\tpersistedSchema.runtime[key],\n\t\t\tprovidedSchema.runtime[key],\n\t\t);\n\t}\n\treturn {\n\t\tversion: currentDocumentVersionSchema,\n\t\trefSeq: persistedSchema.refSeq,\n\t\truntime,\n\t};\n}\n\nfunction or(\n\tpersistedSchema: IDocumentSchemaCurrent,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): IDocumentSchemaCurrent {\n\tconst runtime = {};\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\truntime[key] = (documentSchemaSupportedConfigs[key] as IProperty).or(\n\t\t\tpersistedSchema.runtime[key],\n\t\t\tprovidedSchema.runtime[key],\n\t\t);\n\t}\n\treturn {\n\t\tversion: currentDocumentVersionSchema,\n\t\trefSeq: persistedSchema.refSeq,\n\t\truntime,\n\t};\n}\n\nfunction same(\n\tpersistedSchema: IDocumentSchemaCurrent,\n\tprovidedSchema: IDocumentSchemaCurrent,\n): boolean {\n\tfor (const key of new Set([\n\t\t...Object.keys(persistedSchema.runtime),\n\t\t...Object.keys(providedSchema.runtime),\n\t])) {\n\t\t// If schemas differ only by type of behavior, then we should not send schema change ops!\n\t\tif (\n\t\t\tkey !== \"explicitSchemaControl\" &&\n\t\t\tpersistedSchema.runtime[key] !== providedSchema.runtime[key]\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction boolToProp(b: boolean): true | undefined {\n\treturn b ? true : undefined;\n}\n\nfunction arrayToProp(arr: string[]): string[] | undefined {\n\treturn arr.length === 0 ? undefined : arr;\n}\n\n/* eslint-disable jsdoc/check-indentation */\n\n/**\n * Controller of document schema.\n *\n * Recommended pre-reading: https://github.com/microsoft/FluidFramework/blob/main/packages/dds/SchemaVersioning.md\n *\n * This class manages current document schema and transitions between document schemas.\n * At the moment, it only focuses on subset of document schema, specifically - how FluidFramework runtime serializes data\n * (summary and op format), features & capabilities that a version of runtime has to support and understand in\n * order to collaborate on a document.\n * New features that modify document format have to be included in document schema definition.\n * Usage of such features could only happen after document schema has been updated to reflect such feature.\n *\n * This formality allows clients that do not understand such features to fail right away when they observe\n * document schema listing capabilities that such client does not understand.\n * Old clients will fail in predictable way. This allows us to\n * 1) Immediately see such issues and adjust if features are enabled too early, before changes have been saturated.\n * 2) There is no way to get to 100% saturation with new code. Even if we have 99.99% saturation, there are\n * still 0.01% of clients who will fail. Failing early and predictably ensures they have no chance to limp along\n * and potentially corrupt the document. This is especially true for summarizer client, who could simply \"undo\"\n * changes it does not understands.\n *\n * It's important to note how it overlaps with feature gates and safe velocity.\n * If new feature was in use, that resulted in a number of documents referencing such feature in document schema.\n * But, developers (through code deployment or feature gates) could disable usage of such features.\n * That will stop a process of further document schema changes (for documents that were not using such feature).\n * And documents that already list such capability in their schema will continue to do so. Later ensures that old\n * clients who do not understand such feature will continue to fail to open such documents, as such documents very\n * likely contain data in a new format.\n *\n * Controller operates with 4 schemas:\n * - document schema: whatever we loaded from summary metadata + ops. It follows eventuall consistency rules (i.e. like DDS).\n * - desired schema - what client is asking for to have (i.e. all the desired settings, based on runtime options / feature gates).\n * - session schema - current session schema. It's \"and\" of the above two schemas.\n * - future schema - \"or\" of document and desires schemas.\n *\n * \"or\" & \"and\" operators are defined individually for each property. For Boolean properties it's literally &&, || operators.\n * But for other properties it's more nuanced.\n *\n * Whenver document schema does not match future schema, controller will send an op that attempts to changs documents schema to\n * future schema.\n *\n * Users of this class need to use DocumentsSchemaController.sessionSchema to determine what features can be used.\n *\n * There are two modes this class can operate:\n * 1) Legacy mode. In such mode it does not issue any ops to change document schema. Any changes happen implicitly,\n * right away, and new features are available right away\n * 2) Non-legacy mode. In such mode any changes to schema require an op roundtrip. This class will manage such transitions.\n * However code should assume that any new features that were not enabled in a given document will not be available\n * for a given session. That's because this session may never send any ops (including read-only documents). Or it may\n * fail to convert schema.\n * This class promises eventual movement forward. I.e. if new feature is allowed (let's say - through feature gates),\n * then eventually all documents that are modified will have that feature reflected in their schema. It could require\n * multiple reloads / new sessions to get there (depends on if code reacts to schema changes right away, or only consults\n * schema on document load).\n *\n * How schemas are changed (in non-legacy mode):\n * If a client needs to change a schema, it will attempt to do so as part of normal ops sending process.\n * Changes happen in CAS (Compare-and-swap) fashion, i.e. client tells current schema and schema it wants to change to.\n * When a number of clients race to change a schema, then only one of them will win, all others will fail because they will\n * reference old schema that is no longer in effect.\n * Clients can retry, but current implementation is simply - they will not (and will rely on next session / reload to do\n * recalc and decide if schema needs to be changed or not).\n *\n * @internal\n * @sealed\n */\nexport class DocumentsSchemaController {\n\tprivate explicitSchemaControl: boolean;\n\n\t/**\n\t * Have we generated a DocumentSchemaChange op and we're waiting for the ack?\n\t * This is used to ensure that we do not generate multiple schema change ops - this client should only ever send one (if any).\n\t */\n\tprivate opPending = false;\n\n\t// schema coming from document metadata (snapshot we loaded from)\n\tprivate documentSchema: IDocumentSchema;\n\n\t// desired schema, based on feature gates / runtime options.\n\t// This includes requests to enable to disable functionality\n\tprivate readonly desiredSchema: IDocumentSchemaCurrent;\n\n\t// OR() of document schema and desired schema. It enables all the features that are enabled in either of schemas.\n\tprivate futureSchema: IDocumentSchemaCurrent | undefined;\n\n\t// Current schema this session operates with.\n\t// 1) Legacy mode (explicitSchemaControl === false): this is same as desired schema - all options that were requested to be on are on, and all options requested to be off are off.\n\t// 2) Non-legacy mode (explicitSchemaControl === true): this is AND() of document schema and desired schema. Only options that are enabled in both are enabled here.\n\t// If there are any options that are not enabled in document schema, but are enabled in desired schema, then attempt to change schema\n\t// (and enable such options) will be made through the session.\n\tpublic sessionSchema: IDocumentSchemaCurrent;\n\n\t/**\n\t * Constructs DocumentsSchemaController that controls current schema and processes around it, including changes in schema.\n\t * @param existing - Is the document existing document, or a new doc.\n\t * @param documentMetadataSchema - current document's schema, if present.\n\t * @param features - features of the document schema that current session wants to see enabled.\n\t * @param onSchemaChange - callback that is called whenever schema is changed (not called on creation / load, only when processing document schema change ops)\n\t */\n\tconstructor(\n\t\texisting: boolean,\n\t\tsnapshotSequenceNumber: number,\n\t\tdocumentMetadataSchema: IDocumentSchema | undefined,\n\t\tfeatures: IDocumentSchemaFeatures,\n\t\tprivate readonly onSchemaChange: (schema: IDocumentSchemaCurrent) => void,\n\t) {\n\t\t// For simplicity, let's only support new schema features for explicit schema control mode\n\t\tassert(\n\t\t\tfeatures.disallowedVersions.length === 0 || features.explicitSchemaControl,\n\t\t\t0x949 /* not supported */,\n\t\t);\n\n\t\t// Desired schema by this session - almost all props are coming from arguments\n\t\tthis.desiredSchema = {\n\t\t\tversion: currentDocumentVersionSchema,\n\t\t\trefSeq: documentMetadataSchema?.refSeq ?? 0,\n\t\t\truntime: {\n\t\t\t\texplicitSchemaControl: boolToProp(features.explicitSchemaControl),\n\t\t\t\tcompressionLz4: boolToProp(features.compressionLz4),\n\t\t\t\tidCompressorMode: features.idCompressorMode,\n\t\t\t\topGroupingEnabled: boolToProp(features.opGroupingEnabled),\n\t\t\t\tcreateBlobPayloadPending: features.createBlobPayloadPending,\n\t\t\t\tdisallowedVersions: arrayToProp(features.disallowedVersions),\n\t\t\t},\n\t\t};\n\n\t\t// Schema coming from document metadata (snapshot we loaded from), or if no document exists\n\t\t// (this is a new document) then this is the same as desiredSchema (same as session schema in such case).\n\t\t// Latter is important sure that's what will go into summary.\n\t\tthis.documentSchema = existing\n\t\t\t? (documentMetadataSchema ??\n\t\t\t\t({\n\t\t\t\t\tversion: currentDocumentVersionSchema,\n\t\t\t\t\t// see comment in summarizeDocumentSchema() on why it has to stay zero\n\t\t\t\t\trefSeq: 0,\n\t\t\t\t\t// If it's existing document and it has no schema, then it was written by legacy client.\n\t\t\t\t\t// If it's a new document, then we define it's legacy-related behaviors.\n\t\t\t\t\truntime: {\n\t\t\t\t\t\texplicitSchemaControl: boolToProp(!existing && features.explicitSchemaControl),\n\t\t\t\t\t},\n\t\t\t\t} satisfies IDocumentSchemaCurrent))\n\t\t\t: this.desiredSchema;\n\n\t\tcheckRuntimeCompatibility(this.documentSchema, \"document\");\n\t\tthis.validateSeqNumber(this.documentSchema.refSeq, snapshotSequenceNumber, \"summary\");\n\n\t\t// Use legacy behavior only if both document and options tell us to use legacy.\n\t\t// Otherwise it's no longer legacy time!\n\t\tthis.explicitSchemaControl =\n\t\t\tthis.documentSchema.runtime.explicitSchemaControl === true ||\n\t\t\tfeatures.explicitSchemaControl;\n\n\t\t// Calculate\n\t\t// - current session schema (overlap of document schema and desired schema)\n\t\t// - future schema to propose (concatination of document schema and desired schema)\n\t\tif (!this.explicitSchemaControl || !existing) {\n\t\t\tthis.sessionSchema = this.desiredSchema;\n\t\t\tassert(\n\t\t\t\tboolToProp(this.explicitSchemaControl) ===\n\t\t\t\t\tthis.sessionSchema.runtime.explicitSchemaControl,\n\t\t\t\t0x94a /* explicitSchemaControl */,\n\t\t\t);\n\t\t\tthis.futureSchema = undefined;\n\t\t} else {\n\t\t\tthis.sessionSchema = and(this.documentSchema, this.desiredSchema);\n\t\t\tthis.futureSchema = or(this.documentSchema, this.desiredSchema);\n\t\t\tassert(this.sessionSchema.runtime.explicitSchemaControl === true, 0x94b /* legacy */);\n\t\t\tassert(this.futureSchema.runtime.explicitSchemaControl === true, 0x94c /* legacy */);\n\t\t\tif (same(this.documentSchema, this.futureSchema)) {\n\t\t\t\tthis.futureSchema = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Validate that schema we are operating in is actually a schema we consider compatible with current runtime.\n\t\tcheckRuntimeCompatibility(this.desiredSchema, \"desired\");\n\t\tcheckRuntimeCompatibility(this.sessionSchema, \"session\");\n\t\tcheckRuntimeCompatibility(this.futureSchema, \"future\");\n\t}\n\n\tpublic summarizeDocumentSchema(\n\t\trefSeq: number,\n\t): IDocumentSchema | IDocumentSchemaCurrent | undefined {\n\t\t// For legacy behavior, we could write nothing (return undefined).\n\t\t// It does not buy us anything, as whatever written in summary does not actually impact clients operating in legacy mode.\n\t\t// But writing current used config (and assuming most of the clients settle on same config over time) will help with transition\n\t\t// out of legacy mode, as clients transitioning out of it would be able to use all the\n\t\t// features that are mentioned in schema right away, without a need to go through schema transition (and thus for a session or\n\t\t// two losing ability to use all the features)\n\t\tconst schema = this.explicitSchemaControl ? this.documentSchema : this.desiredSchema;\n\n\t\t// It's important to keep refSeq at zero in legacy mode, such that transition out of it is simple and we do not have\n\t\t// race conditions. If we put any other number (including latest seq number), then we will have two clients\n\t\t// (loading from two different summaries) with different numbers, and eventual consistency will be broken as schema\n\t\t// change ops will be interpretted differently by those two clients.\n\t\tassert(\n\t\t\tthis.explicitSchemaControl || schema.refSeq === 0,\n\t\t\t0x94d /* refSeq should be zero */,\n\t\t);\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Called by Container runtime whenever it is about to send some op.\n\t * It gives opportunity for controller to issue its own ops - we do not want to send ops if there are no local changes in document.\n\t * Please consider note above constructor about race conditions - current design is to generate op only once in a session lifetime.\n\t * @returns Optional message to send.\n\t */\n\tpublic maybeGenerateSchemaMessage(): IDocumentSchemaChangeMessageOutgoing | undefined {\n\t\tif (this.futureSchema !== undefined && !this.opPending) {\n\t\t\tthis.opPending = true;\n\t\t\tassert(\n\t\t\t\tthis.explicitSchemaControl && this.futureSchema.runtime.explicitSchemaControl === true,\n\t\t\t\t0x94e /* not legacy */,\n\t\t\t);\n\t\t\treturn this.futureSchema;\n\t\t}\n\t}\n\n\tprivate validateSeqNumber(\n\t\tschemaSeqNumber: number,\n\t\tlastKnowSeqNumber: number,\n\t\tmessage: string,\n\t): void {\n\t\tif (!Number.isInteger(schemaSeqNumber) || !(schemaSeqNumber <= lastKnowSeqNumber)) {\n\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\"DocSchema: Incorrect sequence number\",\n\t\t\t\t\"checkRuntimeCompat3\",\n\t\t\t\tundefined, // message\n\t\t\t\t{\n\t\t\t\t\tschemaSeqNumber,\n\t\t\t\t\tsequenceNumber: lastKnowSeqNumber,\n\t\t\t\t\tmessage,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Process document schema change messages\n\t * Called by ContainerRuntime whenever it sees document schema messages.\n\t * @param contents - contents of the messages\n\t * @param local - whether op is local\n\t * @param sequenceNumber - sequence number of the op\n\t * @returns - true if schema was accepted, otherwise false (rejected due to failed CAS)\n\t */\n\tpublic processDocumentSchemaMessages(\n\t\tcontents: IDocumentSchemaChangeMessageIncoming[],\n\t\tlocal: boolean,\n\t\tsequenceNumber: number,\n\t): boolean {\n\t\tfor (const content of contents) {\n\t\t\tthis.validateSeqNumber(content.refSeq, this.documentSchema.refSeq, \"content.refSeq\");\n\t\t\tthis.validateSeqNumber(this.documentSchema.refSeq, sequenceNumber, \"refSeq\");\n\t\t\t// validate is strickly less, not equal\n\t\t\tassert(\n\t\t\t\tthis.documentSchema.refSeq < sequenceNumber,\n\t\t\t\t0x950 /* time should move forward only! */,\n\t\t\t);\n\n\t\t\tif (content.refSeq !== this.documentSchema.refSeq) {\n\t\t\t\t// CAS failed\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// This assert should be after checking for successful CAS above.\n\t\t\t// This will ensure we do not trip on our own messages that are no longer wanted as we processed someone else schema change message.\n\t\t\tassert(\n\t\t\t\t!local || (this.explicitSchemaControl && this.futureSchema !== undefined),\n\t\t\t\t0x951 /* not sending ops */,\n\t\t\t);\n\n\t\t\t// Changes are in effect. Immediately check that this client understands these changes\n\t\t\tcheckRuntimeCompatibility(content, \"change\");\n\t\t\tconst schema = {\n\t\t\t\t...content,\n\t\t\t\trefSeq: sequenceNumber,\n\t\t\t} satisfies IDocumentSchemaCurrent;\n\t\t\tthis.documentSchema = schema;\n\t\t\tthis.sessionSchema = and(schema, this.desiredSchema);\n\t\t\tassert(this.sessionSchema.refSeq === sequenceNumber, 0x97d /* seq# */);\n\n\t\t\t// legacy behavior is automatically off for the document once someone sends a schema op -\n\t\t\t// from now on it's fully controlled by ops.\n\t\t\t// This is very important, as summarizeDocumentSchema() should use this new schema!\n\t\t\tthis.explicitSchemaControl = true;\n\n\t\t\t// Stop attempting changing schema.\n\t\t\t// If it was local op, then we succeeded and do not need to try again.\n\t\t\t// If it was remote op, then some changes happened to schema.\n\t\t\t// We would need to recalculate this.futureSchema by merging changes that we just received.\n\t\t\t// Avoid this complexity for now - a new client session (loading from new summary with these changes)\n\t\t\t// will automatically do this recalculation and will figure out\n\t\t\tthis.futureSchema = undefined;\n\n\t\t\tthis.onSchemaChange(this.sessionSchema);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Indicates the pending op was not ack'd and we may try to send it again if needed.\n\t */\n\tpublic pendingOpNotAcked(): void {\n\t\tthis.opPending = false;\n\t}\n}\n\n/* eslint-enable jsdoc/check-indentation */\n"]}
@@ -9,7 +9,7 @@ export { IAckedSummary, ISummaryCollectionOpEvents, ISummaryOpMessage, SummaryCo
9
9
  export { ISummarizerClientElection, ISummarizerClientElectionEvents, SummarizerClientElection, } from "./summarizerClientElection.js";
10
10
  export { aliasBlobName, chunksBlobName, recentBatchInfoBlobName, dataStoreAttributesBlobName, electedSummarizerBlobName, extractSummaryMetadataMessage, getAttributesFormatVersion, getFluidDataStoreAttributes, hasIsolatedChannels, IContainerRuntimeMetadata, ICreateContainerMetadata, ISummaryMetadataMessage, metadataBlobName, nonDataStorePaths, ReadFluidDataStoreAttributes, rootHasIsolatedChannels, WriteFluidDataStoreAttributes, wrapSummaryInChannelsTree, idCompressorBlobName, IFluidDataStoreAttributes0, IFluidDataStoreAttributes1, IFluidDataStoreAttributes2, OmitAttributesVersions, } from "./summaryFormat.js";
11
11
  export { formCreateSummarizerFn, validateSummaryHeuristicConfiguration, summarizerRequestUrl, DefaultSummaryConfiguration, isSummariesDisabled, } from "./summaryHelpers.js";
12
- export { IdCompressorMode, IDocumentSchemaCurrent, IDocumentSchema, currentDocumentVersionSchema, DocumentSchemaValueType, DocumentsSchemaController, IDocumentSchemaChangeMessage, IDocumentSchemaFeatures, } from "./documentSchema.js";
12
+ export { IdCompressorMode, IDocumentSchemaCurrent, IDocumentSchema, currentDocumentVersionSchema, DocumentSchemaValueType, DocumentsSchemaController, IDocumentSchemaChangeMessageIncoming, IDocumentSchemaChangeMessageOutgoing, IDocumentSchemaFeatures, } from "./documentSchema.js";
13
13
  export { getFailMessage, RetriableSummaryError, SummarizeReason, } from "./summarizerUtils.js";
14
14
  export { IConnectedEvents, IConnectedState, ISummaryManagerConfig, SummaryManager, SummaryManagerState, } from "./summaryManager.js";
15
15
  export { defaultMaxAttempts, defaultMaxAttemptsForSubmitFailures, ICancellableSummarizerController, neverCancelledSummaryToken, RunWhileConnectedCoordinator, Summarizer, IBroadcastSummaryResult, ISummarizeResults, EnqueueSummarizeResult, IAckSummaryResult, INackSummaryResult, RunningSummarizer, SummarizeHeuristicData, SummarizeHeuristicRunner, } from "./summaryDelayLoadedModule/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/summary/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,wBAAwB,EACxB,8BAA8B,EAC9B,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,4BAA4B,EAC5B,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EAC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B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,kBAAkB,EAClB,mCAAmC,EACnC,gCAAgC,EAChC,0BAA0B,EAC1B,4BAA4B,EAC5B,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,GACxB,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/summary/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,wBAAwB,EACxB,8BAA8B,EAC9B,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,4BAA4B,EAC5B,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,EACZ,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,sCAAsC,EAC3C,KAAK,sCAAsC,EAC3C,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,wBAAwB,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,cAAc,OAAA;AACd,2HAAA,qBAAqB,OAAA;AAGtB,yDAM6B;AAF5B,mHAAA,cAAc,OAAA;AACd,wHAAA,mBAAmB,OAAA;AAEpB,gEAe6C;AAd5C,8GAAA,kBAAkB,OAAA;AAClB,+HAAA,mCAAmC,OAAA;AAEnC,sHAAA,0BAA0B,OAAA;AAC1B,wHAAA,4BAA4B,OAAA;AAC5B,sGAAA,UAAU,OAAA;AAMV,6GAAA,iBAAiB,OAAA;AACjB,kHAAA,sBAAsB,OAAA;AACtB,oHAAA,wBAAwB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateRootSummarizerNode,\n\tcreateRootSummarizerNodeWithGC,\n\tIRefreshSummaryResult,\n\tIRootSummarizerNode,\n\tIRootSummarizerNodeWithGC,\n} from \"./summarizerNode/index.js\";\nexport {\n\tsummarizerClientType,\n\tIConnectableRuntime,\n\tIGeneratedSummaryStats,\n\tIRefreshSummaryAckOptions,\n\tISubmitSummaryOptions,\n\tISummarizeAttempt,\n\tISummarizeHeuristicData,\n\tISummarizer,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummaryCancellationToken,\n\tSubmitSummaryResult,\n\tIBaseSummarizeResult,\n\tICancellationToken,\n\tIEnqueueSummarizeOptions,\n\tIGenerateSummaryTreeResult,\n\tIOnDemandSummarizeOptions,\n\tISubmitSummaryOpResult,\n\tISummarizeOptions,\n\tISummarizingWarning,\n\tIUploadSummaryResult,\n\tSummarizeResultPart,\n\tSubmitSummaryFailureData,\n\tSummaryStage,\n\tIRetriableFailureError,\n\ttype ISummaryConfiguration,\n\ttype ISummaryConfigurationDisableHeuristics,\n\ttype ISummaryConfigurationDisableSummarizer,\n\ttype ISummaryConfigurationHeuristics,\n\ttype ISummaryBaseConfiguration,\n} from \"./summarizerTypes.js\";\nexport {\n\tIOrderedClientCollection,\n\tIOrderedClientElection,\n\tISerializedElection,\n\tITrackedClient,\n\tOrderedClientCollection,\n\tOrderedClientElection,\n} from \"./orderedClientElection.js\";\nexport {\n\tIAckedSummary,\n\tISummaryCollectionOpEvents,\n\tISummaryOpMessage,\n\tSummaryCollection,\n\tIClientSummaryWatcher,\n\tISummary,\n\tISummaryAckMessage,\n\tISummaryNackMessage,\n\tOpActionEventListener,\n\tOpActionEventName,\n} from \"./summaryCollection.js\";\nexport {\n\tISummarizerClientElection,\n\tISummarizerClientElectionEvents,\n\tSummarizerClientElection,\n} from \"./summarizerClientElection.js\";\nexport {\n\taliasBlobName,\n\tchunksBlobName,\n\trecentBatchInfoBlobName,\n\tdataStoreAttributesBlobName,\n\telectedSummarizerBlobName,\n\textractSummaryMetadataMessage,\n\tgetAttributesFormatVersion,\n\tgetFluidDataStoreAttributes,\n\thasIsolatedChannels,\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tISummaryMetadataMessage,\n\tmetadataBlobName,\n\tnonDataStorePaths,\n\tReadFluidDataStoreAttributes,\n\trootHasIsolatedChannels,\n\tWriteFluidDataStoreAttributes,\n\twrapSummaryInChannelsTree,\n\tidCompressorBlobName,\n\tIFluidDataStoreAttributes0,\n\tIFluidDataStoreAttributes1,\n\tIFluidDataStoreAttributes2,\n\tOmitAttributesVersions,\n} from \"./summaryFormat.js\";\nexport {\n\tformCreateSummarizerFn,\n\tvalidateSummaryHeuristicConfiguration,\n\tsummarizerRequestUrl,\n\tDefaultSummaryConfiguration,\n\tisSummariesDisabled,\n} from \"./summaryHelpers.js\";\nexport {\n\tIdCompressorMode,\n\tIDocumentSchemaCurrent,\n\tIDocumentSchema,\n\tcurrentDocumentVersionSchema,\n\tDocumentSchemaValueType,\n\tDocumentsSchemaController,\n\tIDocumentSchemaChangeMessage,\n\tIDocumentSchemaFeatures,\n} from \"./documentSchema.js\";\nexport {\n\tgetFailMessage,\n\tRetriableSummaryError,\n\tSummarizeReason,\n} from \"./summarizerUtils.js\";\nexport {\n\tIConnectedEvents,\n\tIConnectedState,\n\tISummaryManagerConfig,\n\tSummaryManager,\n\tSummaryManagerState,\n} from \"./summaryManager.js\";\nexport {\n\tdefaultMaxAttempts,\n\tdefaultMaxAttemptsForSubmitFailures,\n\tICancellableSummarizerController,\n\tneverCancelledSummaryToken,\n\tRunWhileConnectedCoordinator,\n\tSummarizer,\n\tIBroadcastSummaryResult,\n\tISummarizeResults,\n\tEnqueueSummarizeResult,\n\tIAckSummaryResult,\n\tINackSummaryResult,\n\tRunningSummarizer,\n\tSummarizeHeuristicData,\n\tSummarizeHeuristicRunner,\n} from \"./summaryDelayLoadedModule/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/summary/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,sDAMmC;AALlC,oHAAA,wBAAwB,OAAA;AACxB,0HAAA,8BAA8B,OAAA;AAK/B,2DA+B8B;AA9B7B,0HAAA,oBAAoB,OAAA;AA+BrB,uEAOoC;AAFnC,mIAAA,uBAAuB,OAAA;AACvB,iIAAA,qBAAqB,OAAA;AAEtB,+DAWgC;AAP/B,yHAAA,iBAAiB,OAAA;AAQlB,6EAIuC;AADtC,uIAAA,wBAAwB,OAAA;AAEzB,uDAwB4B;AAvB3B,iHAAA,aAAa,OAAA;AACb,kHAAA,cAAc,OAAA;AACd,2HAAA,uBAAuB,OAAA;AACvB,+HAAA,2BAA2B,OAAA;AAC3B,6HAAA,yBAAyB,OAAA;AACzB,iIAAA,6BAA6B,OAAA;AAC7B,8HAAA,0BAA0B,OAAA;AAC1B,+HAAA,2BAA2B,OAAA;AAC3B,uHAAA,mBAAmB,OAAA;AAInB,oHAAA,gBAAgB,OAAA;AAChB,qHAAA,iBAAiB,OAAA;AAEjB,2HAAA,uBAAuB,OAAA;AAEvB,6HAAA,yBAAyB,OAAA;AACzB,wHAAA,oBAAoB,OAAA;AAMrB,yDAM6B;AAL5B,2HAAA,sBAAsB,OAAA;AACtB,0IAAA,qCAAqC,OAAA;AACrC,yHAAA,oBAAoB,OAAA;AACpB,gIAAA,2BAA2B,OAAA;AAC3B,wHAAA,mBAAmB,OAAA;AAEpB,yDAU6B;AAN5B,iIAAA,4BAA4B,OAAA;AAE5B,8HAAA,yBAAyB,OAAA;AAK1B,2DAI8B;AAH7B,oHAAA,cAAc,OAAA;AACd,2HAAA,qBAAqB,OAAA;AAGtB,yDAM6B;AAF5B,mHAAA,cAAc,OAAA;AACd,wHAAA,mBAAmB,OAAA;AAEpB,gEAe6C;AAd5C,8GAAA,kBAAkB,OAAA;AAClB,+HAAA,mCAAmC,OAAA;AAEnC,sHAAA,0BAA0B,OAAA;AAC1B,wHAAA,4BAA4B,OAAA;AAC5B,sGAAA,UAAU,OAAA;AAMV,6GAAA,iBAAiB,OAAA;AACjB,kHAAA,sBAAsB,OAAA;AACtB,oHAAA,wBAAwB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateRootSummarizerNode,\n\tcreateRootSummarizerNodeWithGC,\n\tIRefreshSummaryResult,\n\tIRootSummarizerNode,\n\tIRootSummarizerNodeWithGC,\n} from \"./summarizerNode/index.js\";\nexport {\n\tsummarizerClientType,\n\tIConnectableRuntime,\n\tIGeneratedSummaryStats,\n\tIRefreshSummaryAckOptions,\n\tISubmitSummaryOptions,\n\tISummarizeAttempt,\n\tISummarizeHeuristicData,\n\tISummarizer,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummaryCancellationToken,\n\tSubmitSummaryResult,\n\tIBaseSummarizeResult,\n\tICancellationToken,\n\tIEnqueueSummarizeOptions,\n\tIGenerateSummaryTreeResult,\n\tIOnDemandSummarizeOptions,\n\tISubmitSummaryOpResult,\n\tISummarizeOptions,\n\tISummarizingWarning,\n\tIUploadSummaryResult,\n\tSummarizeResultPart,\n\tSubmitSummaryFailureData,\n\tSummaryStage,\n\tIRetriableFailureError,\n\ttype ISummaryConfiguration,\n\ttype ISummaryConfigurationDisableHeuristics,\n\ttype ISummaryConfigurationDisableSummarizer,\n\ttype ISummaryConfigurationHeuristics,\n\ttype ISummaryBaseConfiguration,\n} from \"./summarizerTypes.js\";\nexport {\n\tIOrderedClientCollection,\n\tIOrderedClientElection,\n\tISerializedElection,\n\tITrackedClient,\n\tOrderedClientCollection,\n\tOrderedClientElection,\n} from \"./orderedClientElection.js\";\nexport {\n\tIAckedSummary,\n\tISummaryCollectionOpEvents,\n\tISummaryOpMessage,\n\tSummaryCollection,\n\tIClientSummaryWatcher,\n\tISummary,\n\tISummaryAckMessage,\n\tISummaryNackMessage,\n\tOpActionEventListener,\n\tOpActionEventName,\n} from \"./summaryCollection.js\";\nexport {\n\tISummarizerClientElection,\n\tISummarizerClientElectionEvents,\n\tSummarizerClientElection,\n} from \"./summarizerClientElection.js\";\nexport {\n\taliasBlobName,\n\tchunksBlobName,\n\trecentBatchInfoBlobName,\n\tdataStoreAttributesBlobName,\n\telectedSummarizerBlobName,\n\textractSummaryMetadataMessage,\n\tgetAttributesFormatVersion,\n\tgetFluidDataStoreAttributes,\n\thasIsolatedChannels,\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tISummaryMetadataMessage,\n\tmetadataBlobName,\n\tnonDataStorePaths,\n\tReadFluidDataStoreAttributes,\n\trootHasIsolatedChannels,\n\tWriteFluidDataStoreAttributes,\n\twrapSummaryInChannelsTree,\n\tidCompressorBlobName,\n\tIFluidDataStoreAttributes0,\n\tIFluidDataStoreAttributes1,\n\tIFluidDataStoreAttributes2,\n\tOmitAttributesVersions,\n} from \"./summaryFormat.js\";\nexport {\n\tformCreateSummarizerFn,\n\tvalidateSummaryHeuristicConfiguration,\n\tsummarizerRequestUrl,\n\tDefaultSummaryConfiguration,\n\tisSummariesDisabled,\n} from \"./summaryHelpers.js\";\nexport {\n\tIdCompressorMode,\n\tIDocumentSchemaCurrent,\n\tIDocumentSchema,\n\tcurrentDocumentVersionSchema,\n\tDocumentSchemaValueType,\n\tDocumentsSchemaController,\n\tIDocumentSchemaChangeMessageIncoming,\n\tIDocumentSchemaChangeMessageOutgoing,\n\tIDocumentSchemaFeatures,\n} from \"./documentSchema.js\";\nexport {\n\tgetFailMessage,\n\tRetriableSummaryError,\n\tSummarizeReason,\n} from \"./summarizerUtils.js\";\nexport {\n\tIConnectedEvents,\n\tIConnectedState,\n\tISummaryManagerConfig,\n\tSummaryManager,\n\tSummaryManagerState,\n} from \"./summaryManager.js\";\nexport {\n\tdefaultMaxAttempts,\n\tdefaultMaxAttemptsForSubmitFailures,\n\tICancellableSummarizerController,\n\tneverCancelledSummaryToken,\n\tRunWhileConnectedCoordinator,\n\tSummarizer,\n\tIBroadcastSummaryResult,\n\tISummarizeResults,\n\tEnqueueSummarizeResult,\n\tIAckSummaryResult,\n\tINackSummaryResult,\n\tRunningSummarizer,\n\tSummarizeHeuristicData,\n\tSummarizeHeuristicRunner,\n} from \"./summaryDelayLoadedModule/index.js\";\n"]}
@@ -148,7 +148,7 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
148
148
  */
149
149
  private checkAndLogIfDeleted;
150
150
  processSignal(messageArg: IInboundSignalMessage, local: boolean): void;
151
- setConnectionState(connected: boolean, clientId?: string): void;
151
+ setConnectionState(canSendOps: boolean, clientId?: string): void;
152
152
  /**
153
153
  * Enumerates the contexts and calls notifyReadOnlyState on them.
154
154
  */
@@ -1 +1 @@
1
- {"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EACN,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EACN,a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AAsB,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAmBxE;;;OAGG;YACW,iBAAiB;IAY/B;;OAEG;IACU,uBAAuB,CACnC,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAQzC;;;OAGG;IAEI,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAevD,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAIhC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;CAqD3D;AAED,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,aAAa,GAAG,SAAS,EAEnC,QAAQ,CAAC,EAAE,yBAAyB,GAClC,aAAa,GAAG,SAAS,CAsB3B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,OAAO,EACjB,sBAAsB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,GACxE,IAAI,CAiCN;AAED;;GAEG;AACH,qBAAa,wBAAyB,YAAW,sBAAsB;IAQrE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAPnC,SAAgB,IAAI,8BAA8B;IAE3C,uBAAuB,EAAE,uBAAuB,CAAC;gBAGvD,eAAe,EAAE,kCAAkC,EAElC,iBAAiB,EAAE,CACnC,OAAO,EAAE,sBAAsB,KAC3B,OAAO,CAAC,WAAW,CAAC;IAK1B,IAAW,sBAAsB,IAAI,wBAAwB,CAE5D;IAEY,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,OAAO,GAChB,OAAO,CAAC,sBAAsB,CAAC;CA2BlC"}
@@ -784,10 +784,10 @@ export class ChannelCollection {
784
784
  }
785
785
  context.processSignal(message, local);
786
786
  }
787
- setConnectionState(connected, clientId) {
787
+ setConnectionState(canSendOps, clientId) {
788
788
  for (const [fluidDataStoreId, context] of this.contexts) {
789
789
  try {
790
- context.setConnectionState(connected, clientId);
790
+ context.setConnectionState(canSendOps, clientId);
791
791
  }
792
792
  catch (error) {
793
793
  this.mc.logger.sendErrorEvent({
@@ -798,7 +798,7 @@ export class ChannelCollection {
798
798
  }),
799
799
  details: JSON.stringify({
800
800
  runtimeConnected: this.parentContext.connected,
801
- connected,
801
+ canSendOps,
802
802
  }),
803
803
  }, error);
804
804
  }
@@ -1132,7 +1132,7 @@ export class ChannelCollection {
1132
1132
  const requestParser = RequestParser.create(request);
1133
1133
  const id = requestParser.pathParts[0];
1134
1134
  // Differentiate between requesting the dataStore directly, or one of its children
1135
- const requestForChild = !requestParser.isLeaf(1);
1135
+ const requestForChild = requestParser.pathParts.length > 1;
1136
1136
  const headerData = {};
1137
1137
  if (typeof request.headers?.[RuntimeHeaders.wait] === "boolean") {
1138
1138
  headerData.wait = request.headers[RuntimeHeaders.wait];