@fluidframework/container-runtime 2.0.0-internal.5.4.2 → 2.0.0-internal.6.0.1

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 (196) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/batchTracker.d.ts +2 -1
  3. package/dist/batchTracker.d.ts.map +1 -1
  4. package/dist/batchTracker.js.map +1 -1
  5. package/dist/blobManager.d.ts +4 -1
  6. package/dist/blobManager.d.ts.map +1 -1
  7. package/dist/blobManager.js +61 -26
  8. package/dist/blobManager.js.map +1 -1
  9. package/dist/connectionTelemetry.js +10 -2
  10. package/dist/connectionTelemetry.js.map +1 -1
  11. package/dist/containerRuntime.d.ts +26 -11
  12. package/dist/containerRuntime.d.ts.map +1 -1
  13. package/dist/containerRuntime.js +177 -123
  14. package/dist/containerRuntime.js.map +1 -1
  15. package/dist/dataStore.js +8 -2
  16. package/dist/dataStore.js.map +1 -1
  17. package/dist/dataStoreContext.js +23 -24
  18. package/dist/dataStoreContext.js.map +1 -1
  19. package/dist/dataStores.d.ts +20 -4
  20. package/dist/dataStores.d.ts.map +1 -1
  21. package/dist/dataStores.js +107 -53
  22. package/dist/dataStores.js.map +1 -1
  23. package/dist/gc/garbageCollection.js +17 -20
  24. package/dist/gc/garbageCollection.js.map +1 -1
  25. package/dist/gc/gcConfigs.js +13 -11
  26. package/dist/gc/gcConfigs.js.map +1 -1
  27. package/dist/gc/gcHelpers.js +4 -6
  28. package/dist/gc/gcHelpers.js.map +1 -1
  29. package/dist/gc/gcSummaryStateTracker.js +4 -6
  30. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  31. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  32. package/dist/gc/gcTelemetry.js +55 -37
  33. package/dist/gc/gcTelemetry.js.map +1 -1
  34. package/dist/id-compressor/idCompressor.js +49 -51
  35. package/dist/id-compressor/idCompressor.js.map +1 -1
  36. package/dist/id-compressor/idRange.js +2 -2
  37. package/dist/id-compressor/idRange.js.map +1 -1
  38. package/dist/id-compressor/sessionIdNormalizer.js +11 -16
  39. package/dist/id-compressor/sessionIdNormalizer.js.map +1 -1
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/opLifecycle/batchManager.js +10 -6
  44. package/dist/opLifecycle/batchManager.js.map +1 -1
  45. package/dist/opLifecycle/opCompressor.js +6 -1
  46. package/dist/opLifecycle/opCompressor.js.map +1 -1
  47. package/dist/opLifecycle/opDecompressor.js +11 -9
  48. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  49. package/dist/opLifecycle/opGroupingManager.js +13 -5
  50. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  51. package/dist/opLifecycle/opSplitter.js +10 -6
  52. package/dist/opLifecycle/opSplitter.js.map +1 -1
  53. package/dist/opLifecycle/outbox.js +1 -2
  54. package/dist/opLifecycle/outbox.js.map +1 -1
  55. package/dist/opLifecycle/remoteMessageProcessor.js +1 -1
  56. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  57. package/dist/opProperties.js +1 -2
  58. package/dist/opProperties.js.map +1 -1
  59. package/dist/packageVersion.d.ts +1 -1
  60. package/dist/packageVersion.js +1 -1
  61. package/dist/packageVersion.js.map +1 -1
  62. package/dist/pendingStateManager.d.ts +2 -2
  63. package/dist/pendingStateManager.d.ts.map +1 -1
  64. package/dist/pendingStateManager.js +22 -22
  65. package/dist/pendingStateManager.js.map +1 -1
  66. package/dist/scheduleManager.js +14 -10
  67. package/dist/scheduleManager.js.map +1 -1
  68. package/dist/summary/orderedClientElection.d.ts +2 -1
  69. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  70. package/dist/summary/orderedClientElection.js +17 -18
  71. package/dist/summary/orderedClientElection.js.map +1 -1
  72. package/dist/summary/runningSummarizer.js +32 -38
  73. package/dist/summary/runningSummarizer.js.map +1 -1
  74. package/dist/summary/summarizer.js +4 -7
  75. package/dist/summary/summarizer.js.map +1 -1
  76. package/dist/summary/summarizerClientElection.js +5 -9
  77. package/dist/summary/summarizerClientElection.js.map +1 -1
  78. package/dist/summary/summarizerHeuristics.js +8 -12
  79. package/dist/summary/summarizerHeuristics.js.map +1 -1
  80. package/dist/summary/summarizerNode/summarizerNode.js +22 -15
  81. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  82. package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  83. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  84. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +17 -16
  85. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  86. package/dist/summary/summaryCollection.js +3 -5
  87. package/dist/summary/summaryCollection.js.map +1 -1
  88. package/dist/summary/summaryFormat.js +1 -2
  89. package/dist/summary/summaryFormat.js.map +1 -1
  90. package/dist/summary/summaryGenerator.js +62 -20
  91. package/dist/summary/summaryGenerator.js.map +1 -1
  92. package/dist/summary/summaryManager.js +3 -5
  93. package/dist/summary/summaryManager.js.map +1 -1
  94. package/lib/batchTracker.d.ts +2 -1
  95. package/lib/batchTracker.d.ts.map +1 -1
  96. package/lib/batchTracker.js.map +1 -1
  97. package/lib/blobManager.d.ts +4 -1
  98. package/lib/blobManager.d.ts.map +1 -1
  99. package/lib/blobManager.js +61 -26
  100. package/lib/blobManager.js.map +1 -1
  101. package/lib/connectionTelemetry.js +10 -2
  102. package/lib/connectionTelemetry.js.map +1 -1
  103. package/lib/containerRuntime.d.ts +26 -11
  104. package/lib/containerRuntime.d.ts.map +1 -1
  105. package/lib/containerRuntime.js +177 -123
  106. package/lib/containerRuntime.js.map +1 -1
  107. package/lib/dataStore.js +8 -2
  108. package/lib/dataStore.js.map +1 -1
  109. package/lib/dataStoreContext.js +23 -24
  110. package/lib/dataStoreContext.js.map +1 -1
  111. package/lib/dataStores.d.ts +20 -4
  112. package/lib/dataStores.d.ts.map +1 -1
  113. package/lib/dataStores.js +107 -53
  114. package/lib/dataStores.js.map +1 -1
  115. package/lib/gc/garbageCollection.js +17 -20
  116. package/lib/gc/garbageCollection.js.map +1 -1
  117. package/lib/gc/gcConfigs.js +13 -11
  118. package/lib/gc/gcConfigs.js.map +1 -1
  119. package/lib/gc/gcHelpers.js +4 -6
  120. package/lib/gc/gcHelpers.js.map +1 -1
  121. package/lib/gc/gcSummaryStateTracker.js +4 -6
  122. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  123. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  124. package/lib/gc/gcTelemetry.js +55 -37
  125. package/lib/gc/gcTelemetry.js.map +1 -1
  126. package/lib/id-compressor/idCompressor.js +49 -51
  127. package/lib/id-compressor/idCompressor.js.map +1 -1
  128. package/lib/id-compressor/idRange.js +2 -2
  129. package/lib/id-compressor/idRange.js.map +1 -1
  130. package/lib/id-compressor/sessionIdNormalizer.js +11 -16
  131. package/lib/id-compressor/sessionIdNormalizer.js.map +1 -1
  132. package/lib/index.d.ts +1 -1
  133. package/lib/index.d.ts.map +1 -1
  134. package/lib/index.js.map +1 -1
  135. package/lib/opLifecycle/batchManager.js +10 -6
  136. package/lib/opLifecycle/batchManager.js.map +1 -1
  137. package/lib/opLifecycle/opCompressor.js +6 -1
  138. package/lib/opLifecycle/opCompressor.js.map +1 -1
  139. package/lib/opLifecycle/opDecompressor.js +11 -9
  140. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  141. package/lib/opLifecycle/opGroupingManager.js +13 -5
  142. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  143. package/lib/opLifecycle/opSplitter.js +10 -6
  144. package/lib/opLifecycle/opSplitter.js.map +1 -1
  145. package/lib/opLifecycle/outbox.js +1 -2
  146. package/lib/opLifecycle/outbox.js.map +1 -1
  147. package/lib/opLifecycle/remoteMessageProcessor.js +1 -1
  148. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  149. package/lib/opProperties.js +1 -2
  150. package/lib/opProperties.js.map +1 -1
  151. package/lib/packageVersion.d.ts +1 -1
  152. package/lib/packageVersion.js +1 -1
  153. package/lib/packageVersion.js.map +1 -1
  154. package/lib/pendingStateManager.d.ts +2 -2
  155. package/lib/pendingStateManager.d.ts.map +1 -1
  156. package/lib/pendingStateManager.js +22 -22
  157. package/lib/pendingStateManager.js.map +1 -1
  158. package/lib/scheduleManager.js +14 -10
  159. package/lib/scheduleManager.js.map +1 -1
  160. package/lib/summary/orderedClientElection.d.ts +2 -1
  161. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  162. package/lib/summary/orderedClientElection.js +17 -18
  163. package/lib/summary/orderedClientElection.js.map +1 -1
  164. package/lib/summary/runningSummarizer.js +32 -38
  165. package/lib/summary/runningSummarizer.js.map +1 -1
  166. package/lib/summary/summarizer.js +4 -7
  167. package/lib/summary/summarizer.js.map +1 -1
  168. package/lib/summary/summarizerClientElection.js +5 -9
  169. package/lib/summary/summarizerClientElection.js.map +1 -1
  170. package/lib/summary/summarizerHeuristics.js +8 -12
  171. package/lib/summary/summarizerHeuristics.js.map +1 -1
  172. package/lib/summary/summarizerNode/summarizerNode.js +22 -15
  173. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  174. package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  175. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  176. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +17 -16
  177. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  178. package/lib/summary/summaryCollection.js +3 -5
  179. package/lib/summary/summaryCollection.js.map +1 -1
  180. package/lib/summary/summaryFormat.js +1 -2
  181. package/lib/summary/summaryFormat.js.map +1 -1
  182. package/lib/summary/summaryGenerator.js +62 -20
  183. package/lib/summary/summaryGenerator.js.map +1 -1
  184. package/lib/summary/summaryManager.js +3 -5
  185. package/lib/summary/summaryManager.js.map +1 -1
  186. package/package.json +17 -17
  187. package/src/batchTracker.ts +2 -1
  188. package/src/blobManager.ts +43 -2
  189. package/src/containerRuntime.ts +74 -51
  190. package/src/dataStore.ts +7 -1
  191. package/src/dataStores.ts +95 -55
  192. package/src/gc/gcTelemetry.ts +1 -2
  193. package/src/index.ts +0 -1
  194. package/src/packageVersion.ts +1 -1
  195. package/src/pendingStateManager.ts +12 -15
  196. package/src/summary/orderedClientElection.ts +2 -1
package/src/dataStores.ts CHANGED
@@ -431,8 +431,7 @@ export class DataStores implements IDisposable {
431
431
  ) {
432
432
  const envelope = message.contents as IEnvelope;
433
433
  const transformed = { ...message, contents: envelope.contents };
434
- const request = { url: envelope.address };
435
- this.validateNotDeleted(envelope.address, request);
434
+ this.validateNotDeleted(envelope.address);
436
435
  const context = this.contexts.get(envelope.address);
437
436
  assert(!!context, 0x162 /* "There should be a store context for the op" */);
438
437
  context.process(transformed, local, localMessageMetadata);
@@ -451,104 +450,145 @@ export class DataStores implements IDisposable {
451
450
  requestHeaderData: RuntimeHeaderData,
452
451
  ): Promise<FluidDataStoreContext> {
453
452
  const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
454
- const request = { url: id };
455
-
456
- this.validateNotDeleted(id, request, headerData);
453
+ this.validateNotDeleted(id, headerData);
457
454
 
458
455
  const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
459
456
  if (context === undefined) {
460
457
  // The requested data store does not exits. Throw a 404 response exception.
458
+ const request: IRequest = { url: id };
461
459
  throw responseToException(create404Response(request), request);
462
460
  }
463
461
 
464
- this.validateNotTombstoned(context, request, requestHeaderData);
462
+ this.validateNotTombstoned(context, requestHeaderData);
465
463
 
466
464
  return context;
467
465
  }
468
466
 
469
467
  /**
470
- * Validate that the data store had not been deleted by GC.
471
- *
468
+ * Returns the data store requested with the given id if available. Otherwise, returns undefined.
469
+ */
470
+ public async getDataStoreIfAvailable(
471
+ id: string,
472
+ requestHeaderData: RuntimeHeaderData,
473
+ ): Promise<FluidDataStoreContext | undefined> {
474
+ // If the data store has been deleted, return undefined.
475
+ if (this.checkIfDeleted(id, requestHeaderData)) {
476
+ return undefined;
477
+ }
478
+ const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
479
+ const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
480
+ if (context === undefined) {
481
+ return undefined;
482
+ }
483
+ // Check if the data store is tombstoned. If so, we want to log a telemetry event.
484
+ this.checkIfTombstoned(context, requestHeaderData);
485
+ return context;
486
+ }
487
+
488
+ /**
489
+ * Checks if the data store has been deleted by GC.
472
490
  * @param id - data store id
473
491
  * @param request - the request information to log if the validation detects the data store has been deleted
474
492
  * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted
493
+ * @returns true if the data store is deleted. Otherwise, returns false.
475
494
  */
476
- private validateNotDeleted(
477
- id: string,
478
- request: IRequest,
479
- requestHeaderData?: RuntimeHeaderData,
480
- ) {
495
+ private checkIfDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {
481
496
  const dataStoreNodePath = `/${id}`;
482
- if (this.isDataStoreDeleted(dataStoreNodePath)) {
483
- assert(
484
- !this.contexts.has(id),
485
- 0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */,
486
- );
497
+ if (!this.isDataStoreDeleted(dataStoreNodePath)) {
498
+ return false;
499
+ }
500
+ assert(
501
+ !this.contexts.has(id),
502
+ 0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */,
503
+ );
504
+ sendGCUnexpectedUsageEvent(
505
+ this.mc,
506
+ {
507
+ eventName: "GC_Deleted_DataStore_Requested",
508
+ category: "error",
509
+ isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
510
+ id,
511
+ headers: JSON.stringify(requestHeaderData),
512
+ gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
513
+ },
514
+ undefined /* packagePath */,
515
+ );
516
+ return true;
517
+ }
518
+
519
+ /**
520
+ * Validate that the data store had not been deleted by GC.
521
+ * @param id - data store id
522
+ * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted
523
+ */
524
+ private validateNotDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {
525
+ if (this.checkIfDeleted(id, requestHeaderData)) {
487
526
  // The requested data store is removed by gc. Create a 404 gc response exception.
488
- const error = responseToException(
527
+ const request: IRequest = { url: id };
528
+ throw responseToException(
489
529
  createResponseError(404, "DataStore was deleted", request),
490
530
  request,
491
531
  );
492
- sendGCUnexpectedUsageEvent(
493
- this.mc,
494
- {
495
- eventName: "GC_Deleted_DataStore_Requested",
496
- category: "error",
497
- isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
498
- headers: JSON.stringify(requestHeaderData),
499
- gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
500
- },
501
- undefined /** packagePath */,
502
- error,
503
- );
504
- throw error;
505
532
  }
506
533
  }
507
534
 
535
+ /**
536
+ * Checks if the data store has not been marked as tombstone by GC or not.
537
+ * @param context - the data store context in question
538
+ * @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned
539
+ * @returns true if the data store is tombstoned. Otherwise, returns false.
540
+ */
541
+ private checkIfTombstoned(
542
+ context: FluidDataStoreContext,
543
+ requestHeaderData: RuntimeHeaderData,
544
+ ) {
545
+ if (!context.tombstoned) {
546
+ return false;
547
+ }
548
+ const logErrorEvent = this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone;
549
+ sendGCUnexpectedUsageEvent(
550
+ this.mc,
551
+ {
552
+ eventName: "GC_Tombstone_DataStore_Requested",
553
+ category: logErrorEvent ? "error" : "generic",
554
+ isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
555
+ id: context.id,
556
+ headers: JSON.stringify(requestHeaderData),
557
+ gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
558
+ },
559
+ context.isLoaded ? context.packagePath : undefined,
560
+ );
561
+ return true;
562
+ }
563
+
508
564
  /**
509
565
  * Validates that the data store context requested has not been marked as tombstone by GC.
510
- *
511
566
  * @param context - the data store context in question
512
567
  * @param request - the request information to log if the validation detects the data store has been tombstoned
513
- * @param headerData - the request header information to log if the validation detects the data store has been tombstoned
568
+ * @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned
514
569
  */
515
570
  private validateNotTombstoned(
516
571
  context: FluidDataStoreContext,
517
- request: IRequest,
518
- headerData: RuntimeHeaderData,
572
+ requestHeaderData: RuntimeHeaderData,
519
573
  ) {
520
- if (context.tombstoned) {
521
- const shouldFail = this.throwOnTombstoneLoad && !headerData.allowTombstone;
522
-
574
+ if (this.checkIfTombstoned(context, requestHeaderData)) {
523
575
  // The requested data store is removed by gc. Create a 404 gc response exception.
576
+ const request: IRequest = { url: context.id };
524
577
  const error = responseToException(
525
578
  createResponseError(404, "DataStore was deleted", request, {
526
579
  [TombstoneResponseHeaderKey]: true,
527
580
  }),
528
581
  request,
529
582
  );
530
- sendGCUnexpectedUsageEvent(
531
- this.mc,
532
- {
533
- eventName: "GC_Tombstone_DataStore_Requested",
534
- category: shouldFail ? "error" : "generic",
535
- isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
536
- headers: JSON.stringify(headerData),
537
- gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
538
- },
539
- context.isLoaded ? context.packagePath : undefined,
540
- error,
541
- );
542
-
543
- if (shouldFail) {
583
+ // Throw an error if configured via options and via request headers.
584
+ if (this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone) {
544
585
  throw error;
545
586
  }
546
587
  }
547
588
  }
548
589
 
549
590
  public processSignal(fluidDataStoreId: string, message: IInboundSignalMessage, local: boolean) {
550
- const request = { url: fluidDataStoreId };
551
- this.validateNotDeleted(fluidDataStoreId, request);
591
+ this.validateNotDeleted(fluidDataStoreId);
552
592
  const context = this.contexts.get(fluidDataStoreId);
553
593
  if (!context) {
554
594
  // Attach message may not have been processed yet
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { ITelemetryGenericEvent } from "@fluidframework/core-interfaces";
7
7
  import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
8
- import { packagePathToTelemetryProperty } from "@fluidframework/runtime-utils";
9
8
  import {
10
9
  generateStack,
11
10
  ITelemetryLoggerExt,
@@ -211,7 +210,7 @@ export class GCTelemetryTracker {
211
210
  const { id: taggedId, fromId: taggedFromId, ...otherProps } = eventProps;
212
211
  const event = {
213
212
  eventName: `${state}Object_${nodeUsageProps.usageType}`,
214
- pkg: packagePathToTelemetryProperty(nodeUsageProps.packagePath),
213
+ pkg: tagCodeArtifacts({ pkg: nodeUsageProps.packagePath?.join("/") }).pkg,
215
214
  stack: generateStack(),
216
215
  id: taggedId,
217
216
  fromId: taggedFromId,
package/src/index.ts CHANGED
@@ -12,7 +12,6 @@ export {
12
12
  ISummaryConfigurationDisableSummarizer,
13
13
  ISummaryConfigurationDisableHeuristics,
14
14
  IContainerRuntimeOptions,
15
- IRootSummaryTreeWithStats,
16
15
  isRuntimeMessage,
17
16
  RuntimeMessage,
18
17
  agentSchedulerId,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.0.0-internal.5.4.2";
9
+ export const pkgVersion = "2.0.0-internal.6.0.1";
@@ -16,7 +16,7 @@ import { pkgVersion } from "./packageVersion";
16
16
  import { IBatchMetadata } from "./metadata";
17
17
 
18
18
  /**
19
- * ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew
19
+ * ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew (AB#4763)
20
20
  */
21
21
  export interface IPendingMessageOld {
22
22
  type: "message";
@@ -42,7 +42,7 @@ export interface IPendingMessageNew {
42
42
  }
43
43
 
44
44
  /**
45
- * ! TODO: Remove this type in "2.0.0-internal.7.0.0"
45
+ * ! TODO: Remove this type in "2.0.0-internal.7.0.0" (AB#4763)
46
46
  */
47
47
  export type IPendingState = IPendingMessageOld | IPendingMessageNew;
48
48
 
@@ -115,21 +115,18 @@ export class PendingStateManager implements IDisposable {
115
115
  if (!this.pendingMessages.isEmpty()) {
116
116
  return {
117
117
  pendingStates: this.pendingMessages.toArray().map((message) => {
118
- // ! TODO: Remove conversion to IPendingMessageOld in "2.0.0-internal.6.0.0" AB#3826
119
- const content = JSON.parse(message.content);
118
+ let content = message.content;
119
+ const parsedContent = JSON.parse(content);
120
120
  // IdAllocations need their localOpMetadata stashed in the contents
121
121
  // of the op to correctly resume the session when processing stashed ops
122
- if (content.type === ContainerMessageType.IdAllocation) {
123
- content.contents.stashedState = message.localOpMetadata;
122
+ if (parsedContent.type === ContainerMessageType.IdAllocation) {
123
+ parsedContent.contents.stashedState = message.localOpMetadata;
124
+ content = JSON.stringify(parsedContent);
124
125
  }
125
- return {
126
- ...message,
127
- messageType: content.type,
128
- content: content.contents,
129
- // delete localOpMetadata since it may not be serializable
130
- // and will be regenerated by applyStashedOp()
131
- localOpMetadata: undefined,
132
- };
126
+
127
+ // delete localOpMetadata since it may not be serializable
128
+ // and will be regenerated by applyStashedOp()
129
+ return { ...message, content, localOpMetadata: undefined };
133
130
  }),
134
131
  };
135
132
  }
@@ -142,7 +139,7 @@ export class PendingStateManager implements IDisposable {
142
139
  ) {
143
140
  /**
144
141
  * Convert old local state format to the new format (IPendingMessageOld to IPendingMessageNew)
145
- * ! TODO: Remove this conversion in "2.0.0-internal.7.0.0"
142
+ * ! TODO: Remove this conversion in "2.0.0-internal.7.0.0" (AB#4763)
146
143
  */
147
144
  if (initialLocalState?.pendingStates) {
148
145
  for (const initialState of initialLocalState.pendingStates) {
@@ -9,6 +9,7 @@ import { assert, TypedEventEmitter } from "@fluidframework/common-utils";
9
9
  import { IDeltaManager } from "@fluidframework/container-definitions";
10
10
  import { UsageError } from "@fluidframework/container-utils";
11
11
  import { IClient, IQuorumClients, ISequencedClient } from "@fluidframework/protocol-definitions";
12
+ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
12
13
  import { summarizerClientType } from "./summarizerClientElection";
13
14
 
14
15
  // helper types for recursive readonly.
@@ -101,7 +102,7 @@ export class OrderedClientCollection
101
102
  }
102
103
 
103
104
  constructor(
104
- logger: ITelemetryLoggerExt,
105
+ logger: ITelemetryBaseLogger,
105
106
  deltaManager: Pick<IDeltaManager<unknown, unknown>, "lastSequenceNumber">,
106
107
  quorum: Pick<IQuorumClients, "getMembers" | "on">,
107
108
  ) {