@fluidframework/container-runtime 2.0.0-internal.6.3.3 → 2.0.0-internal.7.0.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 (286) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/dist/blobManager.d.ts +4 -3
  3. package/dist/blobManager.d.ts.map +1 -1
  4. package/dist/blobManager.js +35 -31
  5. package/dist/blobManager.js.map +1 -1
  6. package/dist/containerHandleContext.js +3 -3
  7. package/dist/containerHandleContext.js.map +1 -1
  8. package/dist/containerRuntime.d.ts +21 -78
  9. package/dist/containerRuntime.d.ts.map +1 -1
  10. package/dist/containerRuntime.js +378 -412
  11. package/dist/containerRuntime.js.map +1 -1
  12. package/dist/dataStore.js +9 -9
  13. package/dist/dataStore.js.map +1 -1
  14. package/dist/dataStoreContext.d.ts +1 -3
  15. package/dist/dataStoreContext.d.ts.map +1 -1
  16. package/dist/dataStoreContext.js +54 -56
  17. package/dist/dataStoreContext.js.map +1 -1
  18. package/dist/dataStoreRegistry.js +3 -3
  19. package/dist/dataStoreRegistry.js.map +1 -1
  20. package/dist/dataStores.d.ts +1 -1
  21. package/dist/dataStores.js +3 -3
  22. package/dist/dataStores.js.map +1 -1
  23. package/dist/deltaManagerProxyBase.js +4 -4
  24. package/dist/deltaManagerProxyBase.js.map +1 -1
  25. package/dist/deltaManagerSummarizerProxy.js +6 -6
  26. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  27. package/dist/deltaScheduler.js.map +1 -1
  28. package/dist/gc/garbageCollection.d.ts +6 -3
  29. package/dist/gc/garbageCollection.d.ts.map +1 -1
  30. package/dist/gc/garbageCollection.js +19 -16
  31. package/dist/gc/garbageCollection.js.map +1 -1
  32. package/dist/gc/gcDefinitions.d.ts +17 -17
  33. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  34. package/dist/gc/gcDefinitions.js +14 -15
  35. package/dist/gc/gcDefinitions.js.map +1 -1
  36. package/dist/gc/gcHelpers.d.ts +0 -9
  37. package/dist/gc/gcHelpers.d.ts.map +1 -1
  38. package/dist/gc/gcHelpers.js +1 -13
  39. package/dist/gc/gcHelpers.js.map +1 -1
  40. package/dist/gc/gcTelemetry.d.ts +1 -1
  41. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  42. package/dist/gc/gcTelemetry.js +1 -4
  43. package/dist/gc/gcTelemetry.js.map +1 -1
  44. package/dist/gc/gcUnreferencedStateTracker.js +3 -3
  45. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  46. package/dist/gc/index.d.ts +2 -2
  47. package/dist/gc/index.d.ts.map +1 -1
  48. package/dist/gc/index.js +3 -4
  49. package/dist/gc/index.js.map +1 -1
  50. package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
  51. package/dist/id-compressor/idCompressor.js.map +1 -1
  52. package/dist/id-compressor/identifiers.d.ts +3 -3
  53. package/dist/id-compressor/identifiers.d.ts.map +1 -1
  54. package/dist/index.d.ts +2 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +3 -2
  57. package/dist/index.js.map +1 -1
  58. package/dist/messageTypes.d.ts +134 -0
  59. package/dist/messageTypes.d.ts.map +1 -0
  60. package/dist/messageTypes.js +29 -0
  61. package/dist/messageTypes.js.map +1 -0
  62. package/dist/opLifecycle/batchManager.js +6 -6
  63. package/dist/opLifecycle/batchManager.js.map +1 -1
  64. package/dist/opLifecycle/definitions.d.ts +4 -3
  65. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  66. package/dist/opLifecycle/definitions.js.map +1 -1
  67. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  68. package/dist/opLifecycle/opDecompressor.js +0 -4
  69. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  70. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  71. package/dist/opLifecycle/opGroupingManager.js +4 -2
  72. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  73. package/dist/opLifecycle/opSplitter.js +3 -3
  74. package/dist/opLifecycle/opSplitter.js.map +1 -1
  75. package/dist/opLifecycle/remoteMessageProcessor.d.ts +17 -3
  76. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  77. package/dist/opLifecycle/remoteMessageProcessor.js +38 -25
  78. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  79. package/dist/packageVersion.d.ts +1 -1
  80. package/dist/packageVersion.js +1 -1
  81. package/dist/packageVersion.js.map +1 -1
  82. package/dist/pendingStateManager.d.ts +4 -20
  83. package/dist/pendingStateManager.d.ts.map +1 -1
  84. package/dist/pendingStateManager.js +33 -45
  85. package/dist/pendingStateManager.js.map +1 -1
  86. package/dist/summary/orderedClientElection.d.ts +3 -3
  87. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  88. package/dist/summary/orderedClientElection.js +54 -54
  89. package/dist/summary/orderedClientElection.js.map +1 -1
  90. package/dist/summary/runWhileConnectedCoordinator.js +6 -6
  91. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  92. package/dist/summary/runningSummarizer.d.ts +1 -1
  93. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  94. package/dist/summary/runningSummarizer.js +41 -39
  95. package/dist/summary/runningSummarizer.js.map +1 -1
  96. package/dist/summary/summarizer.d.ts +2 -2
  97. package/dist/summary/summarizer.d.ts.map +1 -1
  98. package/dist/summary/summarizer.js +10 -8
  99. package/dist/summary/summarizer.js.map +1 -1
  100. package/dist/summary/summarizerClientElection.js +6 -6
  101. package/dist/summary/summarizerClientElection.js.map +1 -1
  102. package/dist/summary/summarizerHeuristics.js +9 -9
  103. package/dist/summary/summarizerHeuristics.js.map +1 -1
  104. package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -1
  105. package/dist/summary/summarizerNode/summarizerNode.js +8 -8
  106. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  107. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
  108. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  109. package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
  110. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  111. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
  112. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  113. package/dist/summary/summarizerTypes.d.ts +14 -13
  114. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  115. package/dist/summary/summarizerTypes.js.map +1 -1
  116. package/dist/summary/summaryCollection.d.ts +2 -2
  117. package/dist/summary/summaryCollection.d.ts.map +1 -1
  118. package/dist/summary/summaryCollection.js +21 -21
  119. package/dist/summary/summaryCollection.js.map +1 -1
  120. package/dist/summary/summaryFormat.d.ts +8 -5
  121. package/dist/summary/summaryFormat.d.ts.map +1 -1
  122. package/dist/summary/summaryFormat.js +3 -0
  123. package/dist/summary/summaryFormat.js.map +1 -1
  124. package/dist/summary/summaryGenerator.d.ts +3 -3
  125. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  126. package/dist/summary/summaryManager.js +7 -7
  127. package/dist/summary/summaryManager.js.map +1 -1
  128. package/dist/throttler.js +16 -16
  129. package/dist/throttler.js.map +1 -1
  130. package/dist/tsdoc-metadata.json +1 -1
  131. package/lib/blobManager.d.ts +4 -3
  132. package/lib/blobManager.d.ts.map +1 -1
  133. package/lib/blobManager.js +36 -32
  134. package/lib/blobManager.js.map +1 -1
  135. package/lib/containerHandleContext.js +3 -3
  136. package/lib/containerHandleContext.js.map +1 -1
  137. package/lib/containerRuntime.d.ts +21 -78
  138. package/lib/containerRuntime.d.ts.map +1 -1
  139. package/lib/containerRuntime.js +339 -375
  140. package/lib/containerRuntime.js.map +1 -1
  141. package/lib/dataStore.js +9 -9
  142. package/lib/dataStore.js.map +1 -1
  143. package/lib/dataStoreContext.d.ts +1 -3
  144. package/lib/dataStoreContext.d.ts.map +1 -1
  145. package/lib/dataStoreContext.js +54 -56
  146. package/lib/dataStoreContext.js.map +1 -1
  147. package/lib/dataStoreRegistry.js +3 -3
  148. package/lib/dataStoreRegistry.js.map +1 -1
  149. package/lib/dataStores.d.ts +1 -1
  150. package/lib/dataStores.js +4 -4
  151. package/lib/dataStores.js.map +1 -1
  152. package/lib/deltaManagerProxyBase.js +4 -4
  153. package/lib/deltaManagerProxyBase.js.map +1 -1
  154. package/lib/deltaManagerSummarizerProxy.js +6 -6
  155. package/lib/deltaManagerSummarizerProxy.js.map +1 -1
  156. package/lib/deltaScheduler.js.map +1 -1
  157. package/lib/gc/garbageCollection.d.ts +6 -3
  158. package/lib/gc/garbageCollection.d.ts.map +1 -1
  159. package/lib/gc/garbageCollection.js +19 -16
  160. package/lib/gc/garbageCollection.js.map +1 -1
  161. package/lib/gc/gcDefinitions.d.ts +17 -17
  162. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  163. package/lib/gc/gcDefinitions.js +13 -14
  164. package/lib/gc/gcDefinitions.js.map +1 -1
  165. package/lib/gc/gcHelpers.d.ts +0 -9
  166. package/lib/gc/gcHelpers.d.ts.map +1 -1
  167. package/lib/gc/gcHelpers.js +0 -11
  168. package/lib/gc/gcHelpers.js.map +1 -1
  169. package/lib/gc/gcTelemetry.d.ts +1 -1
  170. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  171. package/lib/gc/gcTelemetry.js +1 -4
  172. package/lib/gc/gcTelemetry.js.map +1 -1
  173. package/lib/gc/gcUnreferencedStateTracker.js +3 -3
  174. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  175. package/lib/gc/index.d.ts +2 -2
  176. package/lib/gc/index.d.ts.map +1 -1
  177. package/lib/gc/index.js +2 -2
  178. package/lib/gc/index.js.map +1 -1
  179. package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
  180. package/lib/id-compressor/idCompressor.js.map +1 -1
  181. package/lib/id-compressor/identifiers.d.ts +3 -3
  182. package/lib/id-compressor/identifiers.d.ts.map +1 -1
  183. package/lib/index.d.ts +2 -1
  184. package/lib/index.d.ts.map +1 -1
  185. package/lib/index.js +2 -1
  186. package/lib/index.js.map +1 -1
  187. package/lib/messageTypes.d.ts +134 -0
  188. package/lib/messageTypes.d.ts.map +1 -0
  189. package/lib/messageTypes.js +26 -0
  190. package/lib/messageTypes.js.map +1 -0
  191. package/lib/opLifecycle/batchManager.js +6 -6
  192. package/lib/opLifecycle/batchManager.js.map +1 -1
  193. package/lib/opLifecycle/definitions.d.ts +4 -3
  194. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  195. package/lib/opLifecycle/definitions.js.map +1 -1
  196. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  197. package/lib/opLifecycle/opDecompressor.js +0 -4
  198. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  199. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  200. package/lib/opLifecycle/opGroupingManager.js +4 -2
  201. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  202. package/lib/opLifecycle/opSplitter.js +1 -1
  203. package/lib/opLifecycle/opSplitter.js.map +1 -1
  204. package/lib/opLifecycle/remoteMessageProcessor.d.ts +17 -3
  205. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  206. package/lib/opLifecycle/remoteMessageProcessor.js +37 -24
  207. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  208. package/lib/packageVersion.d.ts +1 -1
  209. package/lib/packageVersion.js +1 -1
  210. package/lib/packageVersion.js.map +1 -1
  211. package/lib/pendingStateManager.d.ts +4 -20
  212. package/lib/pendingStateManager.d.ts.map +1 -1
  213. package/lib/pendingStateManager.js +32 -44
  214. package/lib/pendingStateManager.js.map +1 -1
  215. package/lib/summary/orderedClientElection.d.ts +3 -3
  216. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  217. package/lib/summary/orderedClientElection.js +54 -54
  218. package/lib/summary/orderedClientElection.js.map +1 -1
  219. package/lib/summary/runWhileConnectedCoordinator.js +6 -6
  220. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  221. package/lib/summary/runningSummarizer.d.ts +1 -1
  222. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  223. package/lib/summary/runningSummarizer.js +41 -39
  224. package/lib/summary/runningSummarizer.js.map +1 -1
  225. package/lib/summary/summarizer.d.ts +2 -2
  226. package/lib/summary/summarizer.d.ts.map +1 -1
  227. package/lib/summary/summarizer.js +10 -8
  228. package/lib/summary/summarizer.js.map +1 -1
  229. package/lib/summary/summarizerClientElection.js +6 -6
  230. package/lib/summary/summarizerClientElection.js.map +1 -1
  231. package/lib/summary/summarizerHeuristics.js +9 -9
  232. package/lib/summary/summarizerHeuristics.js.map +1 -1
  233. package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -1
  234. package/lib/summary/summarizerNode/summarizerNode.js +8 -8
  235. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  236. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
  237. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  238. package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -3
  239. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  240. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
  241. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  242. package/lib/summary/summarizerTypes.d.ts +14 -13
  243. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  244. package/lib/summary/summarizerTypes.js.map +1 -1
  245. package/lib/summary/summaryCollection.d.ts +2 -2
  246. package/lib/summary/summaryCollection.d.ts.map +1 -1
  247. package/lib/summary/summaryCollection.js +21 -21
  248. package/lib/summary/summaryCollection.js.map +1 -1
  249. package/lib/summary/summaryFormat.d.ts +8 -5
  250. package/lib/summary/summaryFormat.d.ts.map +1 -1
  251. package/lib/summary/summaryFormat.js +3 -0
  252. package/lib/summary/summaryFormat.js.map +1 -1
  253. package/lib/summary/summaryGenerator.d.ts +3 -3
  254. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  255. package/lib/summary/summaryManager.js +6 -6
  256. package/lib/summary/summaryManager.js.map +1 -1
  257. package/lib/throttler.js +16 -16
  258. package/lib/throttler.js.map +1 -1
  259. package/package.json +57 -22
  260. package/src/blobManager.ts +38 -28
  261. package/src/containerRuntime.ts +210 -278
  262. package/src/dataStore.ts +1 -1
  263. package/src/dataStoreContext.ts +4 -7
  264. package/src/dataStores.ts +4 -4
  265. package/src/gc/garbageCollection.md +53 -5
  266. package/src/gc/garbageCollection.ts +6 -3
  267. package/src/gc/gcDefinitions.ts +14 -27
  268. package/src/gc/gcEarlyAdoption.md +145 -0
  269. package/src/gc/gcHelpers.ts +0 -12
  270. package/src/gc/gcTelemetry.ts +1 -4
  271. package/src/gc/index.ts +2 -3
  272. package/src/index.ts +7 -4
  273. package/src/messageTypes.ts +225 -0
  274. package/src/opLifecycle/README.md +40 -40
  275. package/src/opLifecycle/definitions.ts +2 -1
  276. package/src/opLifecycle/opDecompressor.ts +0 -8
  277. package/src/opLifecycle/opGroupingManager.ts +7 -6
  278. package/src/opLifecycle/opSplitter.ts +2 -2
  279. package/src/opLifecycle/remoteMessageProcessor.ts +54 -33
  280. package/src/packageVersion.ts +1 -1
  281. package/src/pendingStateManager.ts +30 -52
  282. package/src/summary/runningSummarizer.ts +4 -2
  283. package/src/summary/summarizer.ts +5 -3
  284. package/src/summary/summarizerNode/summarizerNode.ts +1 -1
  285. package/src/summary/summarizerTypes.ts +2 -1
  286. package/src/summary/summaryFormat.ts +3 -0
@@ -11,28 +11,15 @@ import { ICriticalContainerError } from "@fluidframework/container-definitions";
11
11
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
12
12
  import { DataProcessingError, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
13
13
 
14
- import { ContainerMessageType, SequencedContainerRuntimeMessage } from "./containerRuntime";
14
+ import { ContainerMessageType, InboundSequencedContainerRuntimeMessage } from "./messageTypes";
15
15
  import { pkgVersion } from "./packageVersion";
16
16
  import { IBatchMetadata } from "./metadata";
17
17
 
18
- /**
19
- * ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew (AB#4763)
20
- */
21
- export interface IPendingMessageOld {
22
- type: "message";
23
- messageType: ContainerMessageType;
24
- clientSequenceNumber: number;
25
- referenceSequenceNumber: number;
26
- content: any;
27
- localOpMetadata: unknown;
28
- opMetadata: Record<string, unknown> | undefined;
29
- }
30
-
31
18
  /**
32
19
  * This represents a message that has been submitted and is added to the pending queue when `submit` is called on the
33
20
  * ContainerRuntime. This message has either not been ack'd by the server or has not been submitted to the server yet.
34
21
  */
35
- export interface IPendingMessageNew {
22
+ export interface IPendingMessage {
36
23
  type: "message";
37
24
  clientSequenceNumber: number;
38
25
  referenceSequenceNumber: number;
@@ -41,16 +28,11 @@ export interface IPendingMessageNew {
41
28
  opMetadata: Record<string, unknown> | undefined;
42
29
  }
43
30
 
44
- /**
45
- * ! TODO: Remove this type in "2.0.0-internal.7.0.0" (AB#4763)
46
- */
47
- export type IPendingState = IPendingMessageOld | IPendingMessageNew;
48
-
49
31
  export interface IPendingLocalState {
50
32
  /**
51
33
  * list of pending states, including ops and batch information
52
34
  */
53
- pendingStates: IPendingState[];
35
+ pendingStates: IPendingMessage[];
54
36
  }
55
37
 
56
38
  export interface IPendingBatchMessage {
@@ -69,6 +51,26 @@ export interface IRuntimeStateHandler {
69
51
  isActiveConnection: () => boolean;
70
52
  }
71
53
 
54
+ /** Union of keys of T */
55
+ type KeysOfUnion<T extends object> = T extends T ? keyof T : never;
56
+ /** *Partial* type all possible combinations of properties and values of union T.
57
+ * This loosens typing allowing access to all possible properties without
58
+ * narrowing.
59
+ */
60
+ type AnyComboFromUnion<T extends object> = { [P in KeysOfUnion<T>]?: T[P] };
61
+
62
+ function buildPendingMessageContent(
63
+ // AnyComboFromUnion is needed need to gain access to compatDetails that
64
+ // is only defined for some cases.
65
+ message: AnyComboFromUnion<InboundSequencedContainerRuntimeMessage>,
66
+ ): string {
67
+ // IMPORTANT: Order matters here, this must match the order of the properties used
68
+ // when submitting the message.
69
+ const { type, contents, compatDetails } = message;
70
+ // Any properties that are not defined, won't be emitted by stringify.
71
+ return JSON.stringify({ type, contents, compatDetails });
72
+ }
73
+
72
74
  /**
73
75
  * PendingStateManager is responsible for maintaining the messages that have not been sent or have not yet been
74
76
  * acknowledged by the server. It also maintains the batch information for both automatically and manually flushed
@@ -79,13 +81,13 @@ export interface IRuntimeStateHandler {
79
81
  * It verifies that all the ops are acked, are received in the right order and batch information is correct.
80
82
  */
81
83
  export class PendingStateManager implements IDisposable {
82
- private readonly pendingMessages = new Deque<IPendingMessageNew>();
83
- private readonly initialMessages = new Deque<IPendingMessageNew>();
84
+ private readonly pendingMessages = new Deque<IPendingMessage>();
85
+ private readonly initialMessages = new Deque<IPendingMessage>();
84
86
 
85
87
  /**
86
88
  * Sequenced local ops that are saved when stashing since pending ops may depend on them
87
89
  */
88
- private savedOps: IPendingMessageNew[] = [];
90
+ private savedOps: IPendingMessage[] = [];
89
91
 
90
92
  private readonly disposeOnce = new Lazy<void>(() => {
91
93
  this.initialMessages.clear();
@@ -149,29 +151,8 @@ export class PendingStateManager implements IDisposable {
149
151
  initialLocalState: IPendingLocalState | undefined,
150
152
  private readonly logger: ITelemetryLoggerExt | undefined,
151
153
  ) {
152
- /**
153
- * Convert old local state format to the new format (IPendingMessageOld to IPendingMessageNew)
154
- * ! TODO: Remove this conversion in "2.0.0-internal.7.0.0" (AB#4763)
155
- */
156
154
  if (initialLocalState?.pendingStates) {
157
- for (const initialState of initialLocalState.pendingStates) {
158
- let messageContent = initialState.content;
159
- if (
160
- (initialState as IPendingMessageOld).messageType !== undefined &&
161
- typeof initialState.content !== "string"
162
- ) {
163
- // Convert IPendingMessageOld to IPendingMessageNew
164
- messageContent = JSON.stringify({
165
- type: (initialState as IPendingMessageOld).messageType,
166
- contents: initialState.content,
167
- });
168
- }
169
- // Note: this object may contain "messageType" prop, but it should not be easily accesible due to interface being used
170
- this.initialMessages.push({
171
- ...initialState,
172
- content: messageContent,
173
- });
174
- }
155
+ this.initialMessages.push(...initialLocalState.pendingStates);
175
156
  }
176
157
  }
177
158
 
@@ -193,7 +174,7 @@ export class PendingStateManager implements IDisposable {
193
174
  localOpMetadata: unknown,
194
175
  opMetadata: Record<string, unknown> | undefined,
195
176
  ) {
196
- const pendingMessage: IPendingMessageNew = {
177
+ const pendingMessage: IPendingMessage = {
197
178
  type: "message",
198
179
  clientSequenceNumber: -1, // dummy value (not to be used anywhere)
199
180
  referenceSequenceNumber,
@@ -242,7 +223,7 @@ export class PendingStateManager implements IDisposable {
242
223
  * the batch information was preserved for batch messages.
243
224
  * @param message - The message that got ack'd and needs to be processed.
244
225
  */
245
- public processPendingLocalMessage(message: SequencedContainerRuntimeMessage): unknown {
226
+ public processPendingLocalMessage(message: InboundSequencedContainerRuntimeMessage): unknown {
246
227
  // Pre-processing part - This may be the start of a batch.
247
228
  this.maybeProcessBatchBegin(message);
248
229
 
@@ -256,10 +237,7 @@ export class PendingStateManager implements IDisposable {
256
237
 
257
238
  this.pendingMessages.shift();
258
239
 
259
- // IMPORTANT: Order matters here, this must match the order of the properties used
260
- // when submitting the message.
261
- const { type, contents, compatDetails } = message;
262
- const messageContent = JSON.stringify({ type, contents, compatDetails });
240
+ const messageContent = buildPendingMessageContent(message);
263
241
 
264
242
  // Stringified content should match
265
243
  if (pendingMessage.content !== messageContent) {
@@ -308,7 +308,8 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
308
308
  // latest version with which we will refresh the state. However in case of single commit
309
309
  // summary, we might me missing a summary ack, so in that case we are still fine as the
310
310
  // code in `submitSummary` function in container runtime, will refresh the latest state
311
- // by calling `refreshLatestSummaryAckFromServer` and we will be fine.
311
+ // by calling `prefetchLatestSummaryThenClose`. We will load the next summarizer from the
312
+ // updated state and be fine.
312
313
  const isIgnoredError =
313
314
  isFluidError(error) &&
314
315
  error.errorType === DriverErrorTypes.fileNotFoundOrAccessDeniedError;
@@ -407,6 +408,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
407
408
  !this.heuristicRunnerMicroTaskExists
408
409
  ) {
409
410
  this.heuristicRunnerMicroTaskExists = true;
411
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
410
412
  Promise.resolve()
411
413
  .then(() => {
412
414
  this.heuristicRunner?.run();
@@ -519,7 +521,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
519
521
  * @param before - set of instructions to run before running the action.
520
522
  * @param action - action to perform.
521
523
  * @param after - set of instructions to run after running the action.
522
- * @returns - result of action.
524
+ * @returns The result of the action.
523
525
  */
524
526
  private async lockedSummaryAction<T>(
525
527
  before: () => void,
@@ -15,6 +15,7 @@ import {
15
15
  } from "@fluidframework/telemetry-utils";
16
16
  import { ILoader, LoaderHeader } from "@fluidframework/container-definitions";
17
17
  import { DriverHeader } from "@fluidframework/driver-definitions";
18
+ // eslint-disable-next-line import/no-deprecated
18
19
  import { requestFluidObject } from "@fluidframework/runtime-utils";
19
20
  import { FluidObject, IFluidHandleContext, IRequest } from "@fluidframework/core-interfaces";
20
21
  import { ISummaryConfiguration } from "../containerRuntime";
@@ -125,7 +126,8 @@ export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements
125
126
  const resolvedContainer = await loader.resolve(request);
126
127
  const fluidObject: FluidObject<ISummarizer> | undefined = resolvedContainer.getEntryPoint
127
128
  ? await resolvedContainer.getEntryPoint?.()
128
- : await requestFluidObject<FluidObject<ISummarizer>>(resolvedContainer, {
129
+ : // eslint-disable-next-line import/no-deprecated
130
+ await requestFluidObject<FluidObject<ISummarizer>>(resolvedContainer, {
129
131
  url: "_summarizer",
130
132
  });
131
133
  if (fluidObject?.ISummarizer === undefined) {
@@ -216,7 +218,7 @@ export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements
216
218
  * Should we try to run a last summary for the given stop reason?
217
219
  * Currently only allows "parentNotConnected"
218
220
  * @param stopReason - SummarizerStopReason
219
- * @returns - true if the stop reason can run a last summary
221
+ * @returns `true` if the stop reason can run a last summary, otherwise `false`.
220
222
  */
221
223
  public static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean {
222
224
  return stopReason === "parentNotConnected";
@@ -231,7 +233,7 @@ export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements
231
233
  * @param onBehalfOf - ID of the client that requested that the summarizer start
232
234
  * @param runCoordinator - cancellation token
233
235
  * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.
234
- * @returns - Promise that is fulfilled when the RunningSummarizer is ready
236
+ * @returns A promise that is fulfilled when the RunningSummarizer is ready.
235
237
  */
236
238
  private async start(
237
239
  onBehalfOf: string,
@@ -424,7 +424,7 @@ export class SummarizerNode implements IRootSummarizerNode {
424
424
  * Called when we get an ack from the server for a summary we've just sent. Updates the reference state of this node
425
425
  * from the state in the pending summary queue.
426
426
  * @param proposalHandle - Handle for the current proposal.
427
- * @param referenceSequenceNumber - reference sequence number of sent summary.
427
+ * @param referenceSequenceNumber - Reference sequence number of sent summary.
428
428
  */
429
429
  protected refreshLatestSummaryFromPending(
430
430
  proposalHandle: string,
@@ -104,7 +104,8 @@ export interface ISummarizeOptions {
104
104
  /**
105
105
  * True to ask the server what the latest summary is first; defaults to false
106
106
  *
107
- * @deprecated - Summarize will not refresh latest snapshot state anymore.
107
+ * @deprecated - Summarize will not refresh latest snapshot state anymore. Instead it updates the cache and closes
108
+ * It's expected a new summarizer client will be created, likely by the same parent.
108
109
  */
109
110
  readonly refreshLatestAck?: boolean;
110
111
  }
@@ -187,7 +187,9 @@ export const dataStoreAttributesBlobName = ".component";
187
187
  * @param summarizeResult - Summary tree and stats to modify
188
188
  *
189
189
  * @example
190
+ *
190
191
  * Converts from:
192
+ *
191
193
  * ```typescript
192
194
  * {
193
195
  * type: SummaryType.Tree,
@@ -208,6 +210,7 @@ export const dataStoreAttributesBlobName = ".component";
208
210
  * },
209
211
  * }
210
212
  * ```
213
+ *
211
214
  * And adds +1 to treeNodeCount in stats.
212
215
  */
213
216
  export function wrapSummaryInChannelsTree(summarizeResult: ISummaryTreeWithStats): void {