@fluidframework/container-runtime 2.0.2 → 2.1.0-276326

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 (171) hide show
  1. package/README.md +9 -0
  2. package/api-extractor/api-extractor.legacy.json +4 -0
  3. package/api-report/container-runtime.beta.api.md +0 -64
  4. package/api-report/{container-runtime.alpha.api.md → container-runtime.legacy.alpha.api.md} +0 -64
  5. package/api-report/container-runtime.public.api.md +0 -64
  6. package/container-runtime.test-files.tar +0 -0
  7. package/dist/blobManager.d.ts +1 -0
  8. package/dist/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager.js.map +1 -1
  10. package/dist/channelCollection.d.ts +1 -0
  11. package/dist/channelCollection.d.ts.map +1 -1
  12. package/dist/channelCollection.js +1 -0
  13. package/dist/channelCollection.js.map +1 -1
  14. package/dist/containerRuntime.d.ts +19 -2
  15. package/dist/containerRuntime.d.ts.map +1 -1
  16. package/dist/containerRuntime.js +14 -2
  17. package/dist/containerRuntime.js.map +1 -1
  18. package/dist/gc/garbageCollection.d.ts.map +1 -1
  19. package/dist/gc/garbageCollection.js +4 -2
  20. package/dist/gc/garbageCollection.js.map +1 -1
  21. package/dist/gc/gcConfigs.d.ts.map +1 -1
  22. package/dist/gc/gcConfigs.js +5 -2
  23. package/dist/gc/gcConfigs.js.map +1 -1
  24. package/dist/gc/gcDefinitions.d.ts +11 -2
  25. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  26. package/dist/gc/gcDefinitions.js +2 -3
  27. package/dist/gc/gcDefinitions.js.map +1 -1
  28. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  29. package/dist/gc/gcTelemetry.js +0 -6
  30. package/dist/gc/gcTelemetry.js.map +1 -1
  31. package/dist/gc/index.d.ts +1 -1
  32. package/dist/gc/index.d.ts.map +1 -1
  33. package/dist/gc/index.js +1 -2
  34. package/dist/gc/index.js.map +1 -1
  35. package/dist/legacy.d.ts +1 -1
  36. package/dist/messageTypes.d.ts +1 -0
  37. package/dist/messageTypes.d.ts.map +1 -1
  38. package/dist/messageTypes.js +1 -0
  39. package/dist/messageTypes.js.map +1 -1
  40. package/dist/opLifecycle/batchManager.d.ts +4 -0
  41. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  42. package/dist/opLifecycle/batchManager.js.map +1 -1
  43. package/dist/opLifecycle/outbox.d.ts +8 -4
  44. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  45. package/dist/opLifecycle/outbox.js +18 -16
  46. package/dist/opLifecycle/outbox.js.map +1 -1
  47. package/dist/packageVersion.d.ts +1 -1
  48. package/dist/packageVersion.d.ts.map +1 -1
  49. package/dist/packageVersion.js +1 -1
  50. package/dist/packageVersion.js.map +1 -1
  51. package/dist/pendingStateManager.d.ts +8 -6
  52. package/dist/pendingStateManager.d.ts.map +1 -1
  53. package/dist/pendingStateManager.js +18 -14
  54. package/dist/pendingStateManager.js.map +1 -1
  55. package/dist/summary/documentSchema.d.ts +8 -0
  56. package/dist/summary/documentSchema.d.ts.map +1 -1
  57. package/dist/summary/documentSchema.js +2 -0
  58. package/dist/summary/documentSchema.js.map +1 -1
  59. package/dist/summary/orderedClientElection.d.ts +1 -0
  60. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  61. package/dist/summary/orderedClientElection.js.map +1 -1
  62. package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -0
  63. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  64. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  65. package/dist/summary/summarizer.d.ts +1 -0
  66. package/dist/summary/summarizer.d.ts.map +1 -1
  67. package/dist/summary/summarizer.js +1 -0
  68. package/dist/summary/summarizer.js.map +1 -1
  69. package/dist/summary/summarizerTypes.d.ts +29 -0
  70. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  71. package/dist/summary/summarizerTypes.js.map +1 -1
  72. package/dist/summary/summaryCollection.d.ts +10 -0
  73. package/dist/summary/summaryCollection.d.ts.map +1 -1
  74. package/dist/summary/summaryCollection.js +1 -0
  75. package/dist/summary/summaryCollection.js.map +1 -1
  76. package/dist/summary/summaryFormat.d.ts +8 -0
  77. package/dist/summary/summaryFormat.d.ts.map +1 -1
  78. package/dist/summary/summaryFormat.js.map +1 -1
  79. package/lib/blobManager.d.ts +1 -0
  80. package/lib/blobManager.d.ts.map +1 -1
  81. package/lib/blobManager.js.map +1 -1
  82. package/lib/channelCollection.d.ts +1 -0
  83. package/lib/channelCollection.d.ts.map +1 -1
  84. package/lib/channelCollection.js +1 -0
  85. package/lib/channelCollection.js.map +1 -1
  86. package/lib/containerRuntime.d.ts +19 -2
  87. package/lib/containerRuntime.d.ts.map +1 -1
  88. package/lib/containerRuntime.js +14 -2
  89. package/lib/containerRuntime.js.map +1 -1
  90. package/lib/gc/garbageCollection.d.ts.map +1 -1
  91. package/lib/gc/garbageCollection.js +4 -2
  92. package/lib/gc/garbageCollection.js.map +1 -1
  93. package/lib/gc/gcConfigs.d.ts.map +1 -1
  94. package/lib/gc/gcConfigs.js +6 -3
  95. package/lib/gc/gcConfigs.js.map +1 -1
  96. package/lib/gc/gcDefinitions.d.ts +11 -2
  97. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  98. package/lib/gc/gcDefinitions.js +1 -2
  99. package/lib/gc/gcDefinitions.js.map +1 -1
  100. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  101. package/lib/gc/gcTelemetry.js +1 -7
  102. package/lib/gc/gcTelemetry.js.map +1 -1
  103. package/lib/gc/index.d.ts +1 -1
  104. package/lib/gc/index.d.ts.map +1 -1
  105. package/lib/gc/index.js +1 -1
  106. package/lib/gc/index.js.map +1 -1
  107. package/lib/legacy.d.ts +1 -1
  108. package/lib/messageTypes.d.ts +1 -0
  109. package/lib/messageTypes.d.ts.map +1 -1
  110. package/lib/messageTypes.js +1 -0
  111. package/lib/messageTypes.js.map +1 -1
  112. package/lib/opLifecycle/batchManager.d.ts +4 -0
  113. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  114. package/lib/opLifecycle/batchManager.js.map +1 -1
  115. package/lib/opLifecycle/outbox.d.ts +8 -4
  116. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  117. package/lib/opLifecycle/outbox.js +18 -16
  118. package/lib/opLifecycle/outbox.js.map +1 -1
  119. package/lib/packageVersion.d.ts +1 -1
  120. package/lib/packageVersion.d.ts.map +1 -1
  121. package/lib/packageVersion.js +1 -1
  122. package/lib/packageVersion.js.map +1 -1
  123. package/lib/pendingStateManager.d.ts +8 -6
  124. package/lib/pendingStateManager.d.ts.map +1 -1
  125. package/lib/pendingStateManager.js +18 -14
  126. package/lib/pendingStateManager.js.map +1 -1
  127. package/lib/summary/documentSchema.d.ts +8 -0
  128. package/lib/summary/documentSchema.d.ts.map +1 -1
  129. package/lib/summary/documentSchema.js +2 -0
  130. package/lib/summary/documentSchema.js.map +1 -1
  131. package/lib/summary/orderedClientElection.d.ts +1 -0
  132. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  133. package/lib/summary/orderedClientElection.js.map +1 -1
  134. package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -0
  135. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  136. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  137. package/lib/summary/summarizer.d.ts +1 -0
  138. package/lib/summary/summarizer.d.ts.map +1 -1
  139. package/lib/summary/summarizer.js +1 -0
  140. package/lib/summary/summarizer.js.map +1 -1
  141. package/lib/summary/summarizerTypes.d.ts +29 -0
  142. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  143. package/lib/summary/summarizerTypes.js.map +1 -1
  144. package/lib/summary/summaryCollection.d.ts +10 -0
  145. package/lib/summary/summaryCollection.d.ts.map +1 -1
  146. package/lib/summary/summaryCollection.js +1 -0
  147. package/lib/summary/summaryCollection.js.map +1 -1
  148. package/lib/summary/summaryFormat.d.ts +8 -0
  149. package/lib/summary/summaryFormat.d.ts.map +1 -1
  150. package/lib/summary/summaryFormat.js.map +1 -1
  151. package/package.json +28 -92
  152. package/src/blobManager.ts +1 -0
  153. package/src/channelCollection.ts +1 -0
  154. package/src/containerRuntime.ts +23 -2
  155. package/src/gc/garbageCollection.ts +8 -2
  156. package/src/gc/gcConfigs.ts +6 -3
  157. package/src/gc/gcDefinitions.ts +11 -2
  158. package/src/gc/gcTelemetry.ts +0 -7
  159. package/src/gc/index.ts +0 -1
  160. package/src/messageTypes.ts +1 -0
  161. package/src/opLifecycle/batchManager.ts +4 -0
  162. package/src/opLifecycle/outbox.ts +19 -21
  163. package/src/packageVersion.ts +1 -1
  164. package/src/pendingStateManager.ts +25 -20
  165. package/src/summary/documentSchema.ts +8 -0
  166. package/src/summary/orderedClientElection.ts +1 -0
  167. package/src/summary/runWhileConnectedCoordinator.ts +1 -0
  168. package/src/summary/summarizer.ts +1 -0
  169. package/src/summary/summarizerTypes.ts +29 -0
  170. package/src/summary/summaryCollection.ts +10 -0
  171. package/src/summary/summaryFormat.ts +8 -0
@@ -24,6 +24,7 @@ import {
24
24
  } from "../summary/index.js";
25
25
 
26
26
  /**
27
+ * @legacy
27
28
  * @alpha
28
29
  */
29
30
  export type GCVersion = number;
@@ -60,8 +61,6 @@ export const gcDisableDataStoreSweepOptionName = "disableDataStoreSweep";
60
61
  */
61
62
  export const gcGenerationOptionName = "gcGeneration";
62
63
 
63
- /** Config key to turn GC sweep on / off. */
64
- export const runSweepKey = "Fluid.GarbageCollection.RunSweep";
65
64
  /** Config key to turn GC test mode on / off. */
66
65
  export const gcTestModeKey = "Fluid.GarbageCollection.GCTestMode";
67
66
  /** Config key to expire a session after a set period of time. Defaults to true. */
@@ -97,6 +96,7 @@ export const defaultSweepGracePeriodMs = 1 * oneDayMs; // 1 day
97
96
 
98
97
  /**
99
98
  * @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName
99
+ * @legacy
100
100
  * @alpha
101
101
  */
102
102
  export type GCFeatureMatrix =
@@ -134,6 +134,7 @@ export interface IGCMetadata_Deprecated {
134
134
  /**
135
135
  * GC-specific metadata to be written into the summary.
136
136
  *
137
+ * @legacy
137
138
  * @alpha
138
139
  */
139
140
  export interface IGCMetadata {
@@ -181,6 +182,7 @@ export interface IGCMetadata {
181
182
 
182
183
  /**
183
184
  * The statistics of the system state after a garbage collection mark phase run.
185
+ * @legacy
184
186
  * @alpha
185
187
  */
186
188
  export interface IMarkPhaseStats {
@@ -206,6 +208,7 @@ export interface IMarkPhaseStats {
206
208
 
207
209
  /**
208
210
  * The statistics of the system state after a garbage collection sweep phase run.
211
+ * @legacy
209
212
  * @alpha
210
213
  */
211
214
  export interface ISweepPhaseStats {
@@ -225,12 +228,14 @@ export interface ISweepPhaseStats {
225
228
 
226
229
  /**
227
230
  * The statistics of the system state after a garbage collection run.
231
+ * @legacy
228
232
  * @alpha
229
233
  */
230
234
  export interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}
231
235
 
232
236
  /**
233
237
  * The types of GC nodes in the GC reference graph.
238
+ * @legacy
234
239
  * @alpha
235
240
  */
236
241
  export const GCNodeType = {
@@ -245,6 +250,7 @@ export const GCNodeType = {
245
250
  } as const;
246
251
 
247
252
  /**
253
+ * @legacy
248
254
  * @alpha
249
255
  */
250
256
  export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
@@ -423,6 +429,7 @@ export interface IGarbageCollectorCreateParams {
423
429
  }
424
430
 
425
431
  /**
432
+ * @legacy
426
433
  * @alpha
427
434
  */
428
435
  export interface IGCRuntimeOptions {
@@ -476,6 +483,8 @@ export interface IGarbageCollectorConfigs {
476
483
  * throughout its lifetime.
477
484
  */
478
485
  readonly sweepEnabled: boolean;
486
+ /** Is Tombstone AutoRecovery enabled? Useful for preventing the GC "TombstoneLoaded" op, for compatibility reasons */
487
+ readonly tombstoneAutorecoveryEnabled: boolean;
479
488
  /**
480
489
  * Tracks if sweep phase should run or not, or if it should run only for attachment blobs.
481
490
  * Even if the sweep phase is allowed for a document (see sweepEnabled), it may be disabled or partially enabled
@@ -22,7 +22,6 @@ import {
22
22
  IGarbageCollectorConfigs,
23
23
  UnreferencedState,
24
24
  disableTombstoneKey,
25
- runSweepKey,
26
25
  throwOnTombstoneLoadOverrideKey,
27
26
  throwOnTombstoneUsageKey,
28
27
  } from "./gcDefinitions.js";
@@ -289,9 +288,6 @@ export class GCTelemetryTracker {
289
288
  ThrowOnTombstoneUsage: this.mc.config.getBoolean(throwOnTombstoneUsageKey),
290
289
  ThrowOnTombstoneLoad: this.mc.config.getBoolean(throwOnTombstoneLoadOverrideKey),
291
290
  },
292
- sweepFlags: {
293
- EnableSweepFlag: this.mc.config.getBoolean(runSweepKey),
294
- },
295
291
  };
296
292
 
297
293
  if (
@@ -431,9 +427,6 @@ export function sendGCUnexpectedUsageEvent(
431
427
  ThrowOnTombstoneUsage: mc.config.getBoolean(throwOnTombstoneUsageKey),
432
428
  ThrowOnTombstoneLoad: mc.config.getBoolean(throwOnTombstoneLoadOverrideKey),
433
429
  });
434
- event.sweepFlags = JSON.stringify({
435
- EnableSweepFlag: mc.config.getBoolean(runSweepKey),
436
- });
437
430
  event.gcVersion = getGCVersionInEffect(mc.config);
438
431
 
439
432
  mc.logger.sendTelemetryEvent(event, error);
package/src/gc/index.ts CHANGED
@@ -31,7 +31,6 @@ export {
31
31
  IGCStats,
32
32
  oneDayMs,
33
33
  runSessionExpiryKey,
34
- runSweepKey,
35
34
  stableGCVersion,
36
35
  disableAutoRecoveryKey,
37
36
  disableDatastoreSweepKey,
@@ -17,6 +17,7 @@ import { IChunkedOp } from "./opLifecycle/index.js";
17
17
  import { IDocumentSchemaChangeMessage } from "./summary/index.js";
18
18
 
19
19
  /**
20
+ * @legacy
20
21
  * @alpha
21
22
  */
22
23
  export enum ContainerMessageType {
@@ -56,6 +56,10 @@ export class BatchManager {
56
56
  : this.pendingBatch[this.pendingBatch.length - 1].referenceSequenceNumber;
57
57
  }
58
58
 
59
+ /**
60
+ * The last-processed CSN when this batch started.
61
+ * This is used to ensure that while the batch is open, no incoming ops are processed.
62
+ */
59
63
  private clientSequenceNumber: number | undefined;
60
64
 
61
65
  constructor(public readonly options: IBatchManagerOptions) {}
@@ -41,7 +41,7 @@ export interface IOutboxParameters {
41
41
  readonly submitBatchFn:
42
42
  | ((batch: IBatchMessage[], referenceSequenceNumber?: number) => number)
43
43
  | undefined;
44
- readonly legacySendBatchFn: (batch: IBatch) => void;
44
+ readonly legacySendBatchFn: (batch: IBatch) => number;
45
45
  readonly config: IOutboxConfig;
46
46
  readonly compressor: OpCompressor;
47
47
  readonly splitter: OpSplitter;
@@ -126,10 +126,14 @@ export class Outbox {
126
126
  }
127
127
 
128
128
  /**
129
- * If we detect that the reference sequence number of the incoming message does not match
130
- * what was already in the batch managers, this means that batching has been interrupted so
129
+ * Detect whether batching has been interrupted by an incoming message being processed. In this case,
131
130
  * we will flush the accumulated messages to account for that and create a new batch with the new
132
131
  * message as the first message.
132
+ *
133
+ * @remarks - To detect batch interruption, we compare both the reference sequence number
134
+ * (i.e. last message processed by DeltaManager) and the client sequence number of the
135
+ * last message processed by the ContainerRuntime. In the absence of op reentrancy, this
136
+ * pair will remain stable during a single JS turn during which the batch is being built up.
133
137
  */
134
138
  private maybeFlushPartialBatch() {
135
139
  const mainBatchSeqNums = this.mainBatch.sequenceNumbers;
@@ -254,6 +258,7 @@ export class Outbox {
254
258
  return;
255
259
  }
256
260
 
261
+ let clientSequenceNumber: number | undefined;
257
262
  // Did we disconnect? (i.e. is shouldSend false?)
258
263
  // If so, do nothing, as pending state manager will resubmit it correctly on reconnect.
259
264
  // Because flush() is a task that executes async (on clean stack), we can get here in disconnected state.
@@ -261,10 +266,10 @@ export class Outbox {
261
266
  const processedBatch = this.compressBatch(
262
267
  shouldGroup ? this.params.groupingManager.groupBatch(rawBatch) : rawBatch,
263
268
  );
264
- this.sendBatch(processedBatch);
269
+ clientSequenceNumber = this.sendBatch(processedBatch);
265
270
  }
266
271
 
267
- this.persistBatch(rawBatch.content);
272
+ this.params.pendingStateManager.onFlushBatch(rawBatch.content, clientSequenceNumber);
268
273
  }
269
274
 
270
275
  /**
@@ -355,11 +360,12 @@ export class Outbox {
355
360
  * Sends the batch object to the container context to be sent over the wire.
356
361
  *
357
362
  * @param batch - batch to be sent
363
+ * @returns the clientSequenceNumber of the start of the batch, or undefined if nothing was sent
358
364
  */
359
365
  private sendBatch(batch: IBatch) {
360
366
  const length = batch.content.length;
361
367
  if (length === 0) {
362
- return;
368
+ return undefined; // Nothing submitted
363
369
  }
364
370
 
365
371
  const socketSize = estimateSocketSize(batch);
@@ -372,6 +378,7 @@ export class Outbox {
372
378
  });
373
379
  }
374
380
 
381
+ let clientSequenceNumber: number;
375
382
  if (this.params.submitBatchFn === undefined) {
376
383
  // Legacy path - supporting old loader versions. Can be removed only when LTS moves above
377
384
  // version that has support for batches (submitBatchFn)
@@ -380,10 +387,10 @@ export class Outbox {
380
387
  0x5a6 /* Compression should not have happened if the loader does not support it */,
381
388
  );
382
389
 
383
- this.params.legacySendBatchFn(batch);
390
+ clientSequenceNumber = this.params.legacySendBatchFn(batch);
384
391
  } else {
385
392
  assert(batch.referenceSequenceNumber !== undefined, 0x58e /* Batch must not be empty */);
386
- this.params.submitBatchFn(
393
+ clientSequenceNumber = this.params.submitBatchFn(
387
394
  batch.content.map((message) => ({
388
395
  contents: message.contents,
389
396
  metadata: message.metadata,
@@ -393,20 +400,11 @@ export class Outbox {
393
400
  batch.referenceSequenceNumber,
394
401
  );
395
402
  }
396
- }
397
403
 
398
- private persistBatch(batch: BatchMessage[]) {
399
- // Let the PendingStateManager know that a message was submitted.
400
- // In future, need to shift toward keeping batch as a whole!
401
- for (const message of batch) {
402
- this.params.pendingStateManager.onSubmitMessage(
403
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
404
- message.contents!,
405
- message.referenceSequenceNumber,
406
- message.localOpMetadata,
407
- message.metadata,
408
- );
409
- }
404
+ // Convert from clientSequenceNumber of last message in the batch to clientSequenceNumber of first message.
405
+ clientSequenceNumber -= length - 1;
406
+ assert(clientSequenceNumber >= 0, 0x3d0 /* clientSequenceNumber can't be negative */);
407
+ return clientSequenceNumber;
410
408
  }
411
409
 
412
410
  public checkpoint() {
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.0.2";
9
+ export const pkgVersion = "2.1.0-276326";
@@ -16,6 +16,7 @@ import Deque from "double-ended-queue";
16
16
 
17
17
  import { InboundSequencedContainerRuntimeMessage } from "./messageTypes.js";
18
18
  import { IBatchMetadata } from "./metadata.js";
19
+ import type { BatchMessage } from "./opLifecycle/index.js";
19
20
  import { pkgVersion } from "./packageVersion.js";
20
21
 
21
22
  /**
@@ -29,6 +30,7 @@ export interface IPendingMessage {
29
30
  localOpMetadata: unknown;
30
31
  opMetadata: Record<string, unknown> | undefined;
31
32
  sequenceNumber?: number;
33
+ batchStartCsn?: number;
32
34
  }
33
35
 
34
36
  export interface IPendingLocalState {
@@ -187,27 +189,30 @@ export class PendingStateManager implements IDisposable {
187
189
  public readonly dispose = () => this.disposeOnce.value;
188
190
 
189
191
  /**
190
- * Called when a message is submitted locally. Adds the message and the associated details to the pending state
191
- * queue.
192
- * @param type - The container message type.
193
- * @param content - The message content.
194
- * @param localOpMetadata - The local metadata associated with the message.
192
+ * The given batch has been flushed, and needs to be tracked locally until the corresponding
193
+ * acks are processed, to ensure it is successfully sent.
194
+ * @param batch - The batch that was flushed
195
+ * @param clientSequenceNumber - The CSN of the first message in the batch,
196
+ * or undefined if the batch was not yet sent (e.g. by the time we flushed we lost the connection)
195
197
  */
196
- public onSubmitMessage(
197
- content: string,
198
- referenceSequenceNumber: number,
199
- localOpMetadata: unknown,
200
- opMetadata: Record<string, unknown> | undefined,
201
- ) {
202
- const pendingMessage: IPendingMessage = {
203
- type: "message",
204
- referenceSequenceNumber,
205
- content,
206
- localOpMetadata,
207
- opMetadata,
208
- };
209
-
210
- this.pendingMessages.push(pendingMessage);
198
+ public onFlushBatch(batch: BatchMessage[], clientSequenceNumber: number | undefined) {
199
+ for (const message of batch) {
200
+ const {
201
+ contents: content = "",
202
+ referenceSequenceNumber,
203
+ localOpMetadata,
204
+ metadata: opMetadata,
205
+ } = message;
206
+ const pendingMessage: IPendingMessage = {
207
+ type: "message",
208
+ referenceSequenceNumber,
209
+ content,
210
+ localOpMetadata,
211
+ opMetadata,
212
+ batchStartCsn: clientSequenceNumber,
213
+ };
214
+ this.pendingMessages.push(pendingMessage);
215
+ }
211
216
  }
212
217
 
213
218
  /**
@@ -13,6 +13,7 @@ import { pkgVersion } from "../packageVersion.js";
13
13
  * Please note that for all property types we should use undefined to indicate that particular capability is off.
14
14
  * Using false, or some string value (like "off") will result in clients who do not understand that property failing, whereas
15
15
  * we want them to continue to collaborate alongside clients who support that capability, but such capability is shipping dark for now.
16
+ * @legacy
16
17
  * @alpha
17
18
  */
18
19
  export type DocumentSchemaValueType = string | string[] | true | number | undefined;
@@ -27,6 +28,7 @@ export type DocumentSchemaValueType = string | string[] | true | number | undefi
27
28
  * undefined - ID compressor is not loaded.
28
29
  * While IContainerRuntime.generateDocumentUniqueId() is available, it will produce long IDs that are do not compress well.
29
30
  *
31
+ * @legacy
30
32
  * @alpha
31
33
  */
32
34
  export type IdCompressorMode = "on" | "delayed" | undefined;
@@ -55,6 +57,7 @@ export type IdCompressorMode = "on" | "delayed" | undefined;
55
57
  *
56
58
  * For now we are limiting it to just plain properties, and only really simple types, but that can be changed in the future.
57
59
  *
60
+ * @legacy
58
61
  * @alpha
59
62
  */
60
63
  export interface IDocumentSchema {
@@ -75,6 +78,7 @@ export interface IDocumentSchema {
75
78
  * ContainerMessageType.DocumentSchemaChange messages use CAS (Compare-and-swap) semantics, and convey
76
79
  * regSeq of last known schema change (known to a client proposing schema change).
77
80
  * @see ContainerRuntimeDocumentSchemaMessage
81
+ * @legacy
78
82
  * @alpha
79
83
  */
80
84
  export type IDocumentSchemaChangeMessage = IDocumentSchema;
@@ -85,6 +89,7 @@ export type IDocumentSchemaChangeMessage = IDocumentSchema;
85
89
  * WARNING: This type is used to infer IDocumentSchemaCurrent type!
86
90
  * Any changes here (including renaming of properties) are potentially changing document format and should be considered carefully!
87
91
  *
92
+ * @legacy
88
93
  * @alpha
89
94
  */
90
95
  export interface IDocumentSchemaFeatures {
@@ -114,12 +119,14 @@ export interface IDocumentSchemaFeatures {
114
119
  * This must be bumped whenever the format of document schema or protocol for changing the current document schema changes.
115
120
  * Ex: adding a new configuration property (under IDocumentSchema.runtime) does not require changing this version.
116
121
  * Ex: Changing the 'document schema acceptance' mechanism from convert-and-swap to one requiring consensus does require changing this version.
122
+ * @legacy
117
123
  * @alpha
118
124
  */
119
125
  export const currentDocumentVersionSchema = 1;
120
126
 
121
127
  /**
122
128
  * Current document schema.
129
+ * @legacy
123
130
  * @alpha
124
131
  */
125
132
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
@@ -420,6 +427,7 @@ function arrayToProp(arr: string[]) {
420
427
  * Clients can retry, but current implementation is simply - they will not (and will rely on next session / reload to do
421
428
  * recalc and decide if schema needs to be changed or not).
422
429
  *
430
+ * @legacy
423
431
  * @alpha
424
432
  */
425
433
  export class DocumentsSchemaController {
@@ -231,6 +231,7 @@ export interface IOrderedClientElectionEvents extends IEvent {
231
231
 
232
232
  /**
233
233
  * Serialized state of IOrderedClientElection.
234
+ * @legacy
234
235
  * @alpha
235
236
  */
236
237
  export interface ISerializedElection {
@@ -13,6 +13,7 @@ import {
13
13
 
14
14
  /**
15
15
  * Similar to AbortController, but using promise instead of events
16
+ * @legacy
16
17
  * @alpha
17
18
  */
18
19
  export interface ICancellableSummarizerController extends ISummaryCancellationToken {
@@ -67,6 +67,7 @@ export const createSummarizingWarning = (errorMessage: string, logged: boolean)
67
67
  * Summarizer is responsible for coordinating when to generate and send summaries.
68
68
  * It is the main entry point for summary work.
69
69
  * It is created only by summarizing container (i.e. one with clientType === "summarizer")
70
+ * @legacy
70
71
  * @alpha
71
72
  */
72
73
  export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
@@ -36,6 +36,7 @@ import { SummarizeReason } from "./summaryGenerator.js";
36
36
  /**
37
37
  * Similar to AbortSignal, but using promise instead of events
38
38
  * @param T - cancellation reason type
39
+ * @legacy
39
40
  * @alpha
40
41
  */
41
42
  export interface ICancellationToken<T> {
@@ -50,12 +51,14 @@ export interface ICancellationToken<T> {
50
51
 
51
52
  /**
52
53
  * Similar to AbortSignal, but using promise instead of events
54
+ * @legacy
53
55
  * @alpha
54
56
  */
55
57
  export type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
56
58
 
57
59
  /**
58
60
  * Data required to update internal tracking state after receiving a Summary Ack.
61
+ * @legacy
59
62
  * @alpha
60
63
  */
61
64
  export interface IRefreshSummaryAckOptions {
@@ -70,6 +73,7 @@ export interface IRefreshSummaryAckOptions {
70
73
  }
71
74
 
72
75
  /**
76
+ * @legacy
73
77
  * @alpha
74
78
  */
75
79
  export interface ISummarizerInternalsProvider {
@@ -89,6 +93,7 @@ export interface ISummarizingWarning extends ContainerWarning {
89
93
  }
90
94
 
91
95
  /**
96
+ * @legacy
92
97
  * @alpha
93
98
  */
94
99
  export interface IConnectableRuntime {
@@ -99,6 +104,7 @@ export interface IConnectableRuntime {
99
104
  }
100
105
 
101
106
  /**
107
+ * @legacy
102
108
  * @alpha
103
109
  */
104
110
  export interface ISummarizerRuntime extends IConnectableRuntime {
@@ -120,6 +126,7 @@ export interface ISummarizerRuntime extends IConnectableRuntime {
120
126
 
121
127
  /**
122
128
  * Options affecting summarize behavior.
129
+ * @legacy
123
130
  * @alpha
124
131
  */
125
132
  export interface ISummarizeOptions {
@@ -128,6 +135,7 @@ export interface ISummarizeOptions {
128
135
  }
129
136
 
130
137
  /**
138
+ * @legacy
131
139
  * @alpha
132
140
  */
133
141
  export interface ISubmitSummaryOptions extends ISummarizeOptions {
@@ -142,6 +150,7 @@ export interface ISubmitSummaryOptions extends ISummarizeOptions {
142
150
  }
143
151
 
144
152
  /**
153
+ * @legacy
145
154
  * @alpha
146
155
  */
147
156
  export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
@@ -153,6 +162,7 @@ export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
153
162
 
154
163
  /**
155
164
  * Options to use when enqueueing a summarize attempt.
165
+ * @legacy
156
166
  * @alpha
157
167
  */
158
168
  export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
@@ -171,6 +181,7 @@ export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
171
181
  /**
172
182
  * In addition to the normal summary tree + stats, this contains additional stats
173
183
  * only relevant at the root of the tree.
184
+ * @legacy
174
185
  * @alpha
175
186
  */
176
187
  export interface IGeneratedSummaryStats extends ISummaryStats {
@@ -190,6 +201,7 @@ export interface IGeneratedSummaryStats extends ISummaryStats {
190
201
 
191
202
  /**
192
203
  * Type for summarization failures that are retriable.
204
+ * @legacy
193
205
  * @alpha
194
206
  */
195
207
  export interface IRetriableFailureError extends Error {
@@ -198,6 +210,7 @@ export interface IRetriableFailureError extends Error {
198
210
 
199
211
  /**
200
212
  * Base results for all submitSummary attempts.
213
+ * @legacy
201
214
  * @alpha
202
215
  */
203
216
  export interface IBaseSummarizeResult {
@@ -211,6 +224,7 @@ export interface IBaseSummarizeResult {
211
224
 
212
225
  /**
213
226
  * Results of submitSummary after generating the summary tree.
227
+ * @legacy
214
228
  * @alpha
215
229
  */
216
230
  export interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "stage"> {
@@ -225,6 +239,7 @@ export interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "
225
239
 
226
240
  /**
227
241
  * Results of submitSummary after uploading the tree to storage.
242
+ * @legacy
228
243
  * @alpha
229
244
  */
230
245
  export interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "stage"> {
@@ -237,6 +252,7 @@ export interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "
237
252
 
238
253
  /**
239
254
  * Results of submitSummary after submitting the summarize op.
255
+ * @legacy
240
256
  * @alpha
241
257
  */
242
258
  export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stage" | "error"> {
@@ -262,6 +278,7 @@ export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stag
262
278
  * 3. "upload" - the summary was uploaded to storage, and the result contains the server-provided handle
263
279
  *
264
280
  * 4. "submit" - the summarize op was submitted, and the result contains the op client sequence number.
281
+ * @legacy
265
282
  * @alpha
266
283
  */
267
284
  export type SubmitSummaryResult =
@@ -272,12 +289,14 @@ export type SubmitSummaryResult =
272
289
 
273
290
  /**
274
291
  * The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage.
292
+ * @legacy
275
293
  * @alpha
276
294
  */
277
295
  export type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
278
296
 
279
297
  /**
280
298
  * The data in summarizer result when submit summary stage fails.
299
+ * @legacy
281
300
  * @alpha
282
301
  */
283
302
  export interface SubmitSummaryFailureData {
@@ -285,6 +304,7 @@ export interface SubmitSummaryFailureData {
285
304
  }
286
305
 
287
306
  /**
307
+ * @legacy
288
308
  * @alpha
289
309
  */
290
310
  export interface IBroadcastSummaryResult {
@@ -293,6 +313,7 @@ export interface IBroadcastSummaryResult {
293
313
  }
294
314
 
295
315
  /**
316
+ * @legacy
296
317
  * @alpha
297
318
  */
298
319
  export interface IAckSummaryResult {
@@ -301,6 +322,7 @@ export interface IAckSummaryResult {
301
322
  }
302
323
 
303
324
  /**
325
+ * @legacy
304
326
  * @alpha
305
327
  */
306
328
  export interface INackSummaryResult {
@@ -309,6 +331,7 @@ export interface INackSummaryResult {
309
331
  }
310
332
 
311
333
  /**
334
+ * @legacy
312
335
  * @alpha
313
336
  */
314
337
  export type SummarizeResultPart<TSuccess, TFailure = undefined> =
@@ -324,6 +347,7 @@ export type SummarizeResultPart<TSuccess, TFailure = undefined> =
324
347
  };
325
348
 
326
349
  /**
350
+ * @legacy
327
351
  * @alpha
328
352
  */
329
353
  export interface ISummarizeResults {
@@ -340,6 +364,7 @@ export interface ISummarizeResults {
340
364
  }
341
365
 
342
366
  /**
367
+ * @legacy
343
368
  * @alpha
344
369
  */
345
370
  export type EnqueueSummarizeResult =
@@ -370,6 +395,7 @@ export type EnqueueSummarizeResult =
370
395
  };
371
396
 
372
397
  /**
398
+ * @legacy
373
399
  * @alpha
374
400
  */
375
401
  export type SummarizerStopReason =
@@ -399,6 +425,7 @@ export type SummarizerStopReason =
399
425
  | "latestSummaryStateStale";
400
426
 
401
427
  /**
428
+ * @legacy
402
429
  * @alpha
403
430
  */
404
431
  export interface ISummarizeEventProps {
@@ -409,6 +436,7 @@ export interface ISummarizeEventProps {
409
436
  }
410
437
 
411
438
  /**
439
+ * @legacy
412
440
  * @alpha
413
441
  */
414
442
  export interface ISummarizerEvents extends IEvent {
@@ -416,6 +444,7 @@ export interface ISummarizerEvents extends IEvent {
416
444
  }
417
445
 
418
446
  /**
447
+ * @legacy
419
448
  * @alpha
420
449
  */
421
450
  export interface ISummarizer extends IEventProvider<ISummarizerEvents> {