@fluidframework/container-runtime 2.12.0 → 2.20.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 (440) hide show
  1. package/.eslintrc.cjs +36 -0
  2. package/CHANGELOG.md +50 -0
  3. package/api-report/container-runtime.legacy.alpha.api.md +9 -203
  4. package/container-runtime.test-files.tar +0 -0
  5. package/dist/batchTracker.d.ts.map +1 -1
  6. package/dist/batchTracker.js.map +1 -1
  7. package/dist/blobManager/blobManager.d.ts +5 -1
  8. package/dist/blobManager/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager/blobManager.js +16 -2
  10. package/dist/blobManager/blobManager.js.map +1 -1
  11. package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
  12. package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
  13. package/dist/channelCollection.d.ts +23 -12
  14. package/dist/channelCollection.d.ts.map +1 -1
  15. package/dist/channelCollection.js +22 -12
  16. package/dist/channelCollection.js.map +1 -1
  17. package/dist/connectionTelemetry.d.ts.map +1 -1
  18. package/dist/connectionTelemetry.js +6 -2
  19. package/dist/connectionTelemetry.js.map +1 -1
  20. package/dist/containerHandleContext.d.ts +1 -1
  21. package/dist/containerHandleContext.d.ts.map +1 -1
  22. package/dist/containerHandleContext.js.map +1 -1
  23. package/dist/containerRuntime.d.ts +74 -65
  24. package/dist/containerRuntime.d.ts.map +1 -1
  25. package/dist/containerRuntime.js +53 -37
  26. package/dist/containerRuntime.js.map +1 -1
  27. package/dist/dataStore.d.ts +7 -3
  28. package/dist/dataStore.d.ts.map +1 -1
  29. package/dist/dataStore.js +2 -1
  30. package/dist/dataStore.js.map +1 -1
  31. package/dist/dataStoreContext.d.ts +41 -25
  32. package/dist/dataStoreContext.d.ts.map +1 -1
  33. package/dist/dataStoreContext.js +31 -18
  34. package/dist/dataStoreContext.js.map +1 -1
  35. package/dist/dataStoreContexts.d.ts +6 -2
  36. package/dist/dataStoreContexts.d.ts.map +1 -1
  37. package/dist/dataStoreContexts.js +6 -2
  38. package/dist/dataStoreContexts.js.map +1 -1
  39. package/dist/dataStoreRegistry.d.ts +1 -1
  40. package/dist/dataStoreRegistry.d.ts.map +1 -1
  41. package/dist/dataStoreRegistry.js.map +1 -1
  42. package/dist/deltaManagerProxies.d.ts +1 -17
  43. package/dist/deltaManagerProxies.d.ts.map +1 -1
  44. package/dist/deltaManagerProxies.js.map +1 -1
  45. package/dist/deltaScheduler.d.ts +9 -6
  46. package/dist/deltaScheduler.d.ts.map +1 -1
  47. package/dist/deltaScheduler.js +95 -89
  48. package/dist/deltaScheduler.js.map +1 -1
  49. package/dist/gc/garbageCollection.d.ts +21 -7
  50. package/dist/gc/garbageCollection.d.ts.map +1 -1
  51. package/dist/gc/garbageCollection.js +12 -5
  52. package/dist/gc/garbageCollection.js.map +1 -1
  53. package/dist/gc/gcConfigs.d.ts +11 -0
  54. package/dist/gc/gcConfigs.d.ts.map +1 -1
  55. package/dist/gc/gcConfigs.js +2 -1
  56. package/dist/gc/gcConfigs.js.map +1 -1
  57. package/dist/gc/gcDefinitions.d.ts +210 -70
  58. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  59. package/dist/gc/gcDefinitions.js +39 -13
  60. package/dist/gc/gcDefinitions.js.map +1 -1
  61. package/dist/gc/gcHelpers.d.ts +6 -2
  62. package/dist/gc/gcHelpers.d.ts.map +1 -1
  63. package/dist/gc/gcHelpers.js +6 -2
  64. package/dist/gc/gcHelpers.js.map +1 -1
  65. package/dist/gc/gcSummaryDefinitions.d.ts +18 -6
  66. package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
  67. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  68. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  69. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  70. package/dist/gc/gcTelemetry.d.ts +33 -11
  71. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  72. package/dist/gc/gcTelemetry.js +6 -2
  73. package/dist/gc/gcTelemetry.js.map +1 -1
  74. package/dist/gc/gcUnreferencedStateTracker.d.ts +42 -13
  75. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  76. package/dist/gc/gcUnreferencedStateTracker.js +27 -9
  77. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  78. package/dist/gc/index.d.ts +1 -0
  79. package/dist/gc/index.d.ts.map +1 -1
  80. package/dist/gc/index.js +3 -1
  81. package/dist/gc/index.js.map +1 -1
  82. package/dist/inboundBatchAggregator.d.ts +34 -0
  83. package/dist/inboundBatchAggregator.d.ts.map +1 -0
  84. package/dist/inboundBatchAggregator.js +185 -0
  85. package/dist/inboundBatchAggregator.js.map +1 -0
  86. package/dist/index.d.ts +1 -1
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js.map +1 -1
  89. package/dist/legacy.d.ts +0 -4
  90. package/dist/messageTypes.d.ts +14 -5
  91. package/dist/messageTypes.d.ts.map +1 -1
  92. package/dist/messageTypes.js.map +1 -1
  93. package/dist/metadata.d.ts +12 -4
  94. package/dist/metadata.d.ts.map +1 -1
  95. package/dist/metadata.js +6 -2
  96. package/dist/metadata.js.map +1 -1
  97. package/dist/opLifecycle/batchManager.d.ts +9 -3
  98. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  99. package/dist/opLifecycle/batchManager.js +3 -1
  100. package/dist/opLifecycle/batchManager.js.map +1 -1
  101. package/dist/opLifecycle/duplicateBatchDetector.d.ts +9 -3
  102. package/dist/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
  103. package/dist/opLifecycle/duplicateBatchDetector.js +9 -3
  104. package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
  105. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  106. package/dist/opLifecycle/opCompressor.js.map +1 -1
  107. package/dist/opLifecycle/opDecompressor.d.ts +3 -1
  108. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  109. package/dist/opLifecycle/opDecompressor.js +12 -8
  110. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  111. package/dist/opLifecycle/opGroupingManager.d.ts +0 -1
  112. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  113. package/dist/opLifecycle/opGroupingManager.js +5 -4
  114. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  115. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  116. package/dist/opLifecycle/opSplitter.js +2 -1
  117. package/dist/opLifecycle/opSplitter.js.map +1 -1
  118. package/dist/opLifecycle/outbox.d.ts +1 -1
  119. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  120. package/dist/opLifecycle/outbox.js +6 -1
  121. package/dist/opLifecycle/outbox.js.map +1 -1
  122. package/dist/opLifecycle/remoteMessageProcessor.d.ts +9 -3
  123. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  124. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  125. package/dist/package.json +2 -1
  126. package/dist/packageVersion.d.ts +1 -1
  127. package/dist/packageVersion.js +1 -1
  128. package/dist/packageVersion.js.map +1 -1
  129. package/dist/pendingStateManager.d.ts +22 -6
  130. package/dist/pendingStateManager.d.ts.map +1 -1
  131. package/dist/pendingStateManager.js +43 -5
  132. package/dist/pendingStateManager.js.map +1 -1
  133. package/dist/summary/documentSchema.d.ts.map +1 -1
  134. package/dist/summary/documentSchema.js +2 -0
  135. package/dist/summary/documentSchema.js.map +1 -1
  136. package/dist/summary/index.d.ts +1 -1
  137. package/dist/summary/index.d.ts.map +1 -1
  138. package/dist/summary/index.js.map +1 -1
  139. package/dist/summary/orderedClientElection.d.ts +93 -31
  140. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  141. package/dist/summary/orderedClientElection.js +15 -5
  142. package/dist/summary/orderedClientElection.js.map +1 -1
  143. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  144. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  145. package/dist/summary/runningSummarizer.d.ts +17 -6
  146. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  147. package/dist/summary/runningSummarizer.js +12 -4
  148. package/dist/summary/runningSummarizer.js.map +1 -1
  149. package/dist/summary/summarizer.d.ts +9 -5
  150. package/dist/summary/summarizer.d.ts.map +1 -1
  151. package/dist/summary/summarizer.js +9 -3
  152. package/dist/summary/summarizer.js.map +1 -1
  153. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  154. package/dist/summary/summarizerClientElection.js.map +1 -1
  155. package/dist/summary/summarizerHeuristics.d.ts +6 -2
  156. package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
  157. package/dist/summary/summarizerHeuristics.js +12 -4
  158. package/dist/summary/summarizerHeuristics.js.map +1 -1
  159. package/dist/summary/summarizerNode/summarizerNode.d.ts +24 -8
  160. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  161. package/dist/summary/summarizerNode/summarizerNode.js +15 -5
  162. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  163. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +48 -16
  164. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  165. package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -1
  166. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  167. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +12 -4
  168. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  169. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +12 -4
  170. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  171. package/dist/summary/summarizerTypes.d.ts +246 -135
  172. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  173. package/dist/summary/summarizerTypes.js.map +1 -1
  174. package/dist/summary/summaryCollection.d.ts.map +1 -1
  175. package/dist/summary/summaryCollection.js +1 -4
  176. package/dist/summary/summaryCollection.js.map +1 -1
  177. package/dist/summary/summaryFormat.d.ts +24 -8
  178. package/dist/summary/summaryFormat.d.ts.map +1 -1
  179. package/dist/summary/summaryFormat.js.map +1 -1
  180. package/dist/summary/summaryGenerator.d.ts +9 -3
  181. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  182. package/dist/summary/summaryGenerator.js +3 -1
  183. package/dist/summary/summaryGenerator.js.map +1 -1
  184. package/dist/summary/summaryManager.d.ts +8 -4
  185. package/dist/summary/summaryManager.d.ts.map +1 -1
  186. package/dist/summary/summaryManager.js +12 -4
  187. package/dist/summary/summaryManager.js.map +1 -1
  188. package/dist/throttler.d.ts +26 -10
  189. package/dist/throttler.d.ts.map +1 -1
  190. package/dist/throttler.js +12 -4
  191. package/dist/throttler.js.map +1 -1
  192. package/lib/batchTracker.d.ts.map +1 -1
  193. package/lib/batchTracker.js.map +1 -1
  194. package/lib/blobManager/blobManager.d.ts +5 -1
  195. package/lib/blobManager/blobManager.d.ts.map +1 -1
  196. package/lib/blobManager/blobManager.js +16 -2
  197. package/lib/blobManager/blobManager.js.map +1 -1
  198. package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
  199. package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
  200. package/lib/channelCollection.d.ts +23 -12
  201. package/lib/channelCollection.d.ts.map +1 -1
  202. package/lib/channelCollection.js +22 -12
  203. package/lib/channelCollection.js.map +1 -1
  204. package/lib/connectionTelemetry.d.ts.map +1 -1
  205. package/lib/connectionTelemetry.js +6 -2
  206. package/lib/connectionTelemetry.js.map +1 -1
  207. package/lib/containerHandleContext.d.ts +1 -1
  208. package/lib/containerHandleContext.d.ts.map +1 -1
  209. package/lib/containerHandleContext.js.map +1 -1
  210. package/lib/containerRuntime.d.ts +74 -65
  211. package/lib/containerRuntime.d.ts.map +1 -1
  212. package/lib/containerRuntime.js +53 -37
  213. package/lib/containerRuntime.js.map +1 -1
  214. package/lib/dataStore.d.ts +7 -3
  215. package/lib/dataStore.d.ts.map +1 -1
  216. package/lib/dataStore.js +2 -1
  217. package/lib/dataStore.js.map +1 -1
  218. package/lib/dataStoreContext.d.ts +41 -25
  219. package/lib/dataStoreContext.d.ts.map +1 -1
  220. package/lib/dataStoreContext.js +31 -18
  221. package/lib/dataStoreContext.js.map +1 -1
  222. package/lib/dataStoreContexts.d.ts +6 -2
  223. package/lib/dataStoreContexts.d.ts.map +1 -1
  224. package/lib/dataStoreContexts.js +6 -2
  225. package/lib/dataStoreContexts.js.map +1 -1
  226. package/lib/dataStoreRegistry.d.ts +1 -1
  227. package/lib/dataStoreRegistry.d.ts.map +1 -1
  228. package/lib/dataStoreRegistry.js.map +1 -1
  229. package/lib/deltaManagerProxies.d.ts +1 -17
  230. package/lib/deltaManagerProxies.d.ts.map +1 -1
  231. package/lib/deltaManagerProxies.js.map +1 -1
  232. package/lib/deltaScheduler.d.ts +9 -6
  233. package/lib/deltaScheduler.d.ts.map +1 -1
  234. package/lib/deltaScheduler.js +95 -89
  235. package/lib/deltaScheduler.js.map +1 -1
  236. package/lib/gc/garbageCollection.d.ts +21 -7
  237. package/lib/gc/garbageCollection.d.ts.map +1 -1
  238. package/lib/gc/garbageCollection.js +12 -5
  239. package/lib/gc/garbageCollection.js.map +1 -1
  240. package/lib/gc/gcConfigs.d.ts +11 -0
  241. package/lib/gc/gcConfigs.d.ts.map +1 -1
  242. package/lib/gc/gcConfigs.js +1 -1
  243. package/lib/gc/gcConfigs.js.map +1 -1
  244. package/lib/gc/gcDefinitions.d.ts +210 -70
  245. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  246. package/lib/gc/gcDefinitions.js +39 -13
  247. package/lib/gc/gcDefinitions.js.map +1 -1
  248. package/lib/gc/gcHelpers.d.ts +6 -2
  249. package/lib/gc/gcHelpers.d.ts.map +1 -1
  250. package/lib/gc/gcHelpers.js +6 -2
  251. package/lib/gc/gcHelpers.js.map +1 -1
  252. package/lib/gc/gcSummaryDefinitions.d.ts +18 -6
  253. package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
  254. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  255. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  256. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  257. package/lib/gc/gcTelemetry.d.ts +33 -11
  258. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  259. package/lib/gc/gcTelemetry.js +6 -2
  260. package/lib/gc/gcTelemetry.js.map +1 -1
  261. package/lib/gc/gcUnreferencedStateTracker.d.ts +42 -13
  262. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  263. package/lib/gc/gcUnreferencedStateTracker.js +27 -9
  264. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  265. package/lib/gc/index.d.ts +1 -0
  266. package/lib/gc/index.d.ts.map +1 -1
  267. package/lib/gc/index.js +1 -0
  268. package/lib/gc/index.js.map +1 -1
  269. package/lib/inboundBatchAggregator.d.ts +34 -0
  270. package/lib/inboundBatchAggregator.d.ts.map +1 -0
  271. package/lib/inboundBatchAggregator.js +181 -0
  272. package/lib/inboundBatchAggregator.js.map +1 -0
  273. package/lib/index.d.ts +1 -1
  274. package/lib/index.d.ts.map +1 -1
  275. package/lib/index.js.map +1 -1
  276. package/lib/legacy.d.ts +0 -4
  277. package/lib/messageTypes.d.ts +14 -5
  278. package/lib/messageTypes.d.ts.map +1 -1
  279. package/lib/messageTypes.js.map +1 -1
  280. package/lib/metadata.d.ts +12 -4
  281. package/lib/metadata.d.ts.map +1 -1
  282. package/lib/metadata.js +6 -2
  283. package/lib/metadata.js.map +1 -1
  284. package/lib/opLifecycle/batchManager.d.ts +9 -3
  285. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  286. package/lib/opLifecycle/batchManager.js +3 -1
  287. package/lib/opLifecycle/batchManager.js.map +1 -1
  288. package/lib/opLifecycle/duplicateBatchDetector.d.ts +9 -3
  289. package/lib/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
  290. package/lib/opLifecycle/duplicateBatchDetector.js +9 -3
  291. package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
  292. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  293. package/lib/opLifecycle/opCompressor.js +1 -1
  294. package/lib/opLifecycle/opCompressor.js.map +1 -1
  295. package/lib/opLifecycle/opDecompressor.d.ts +3 -1
  296. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  297. package/lib/opLifecycle/opDecompressor.js +13 -9
  298. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  299. package/lib/opLifecycle/opGroupingManager.d.ts +0 -1
  300. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  301. package/lib/opLifecycle/opGroupingManager.js +6 -5
  302. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  303. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  304. package/lib/opLifecycle/opSplitter.js +2 -1
  305. package/lib/opLifecycle/opSplitter.js.map +1 -1
  306. package/lib/opLifecycle/outbox.d.ts +1 -1
  307. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  308. package/lib/opLifecycle/outbox.js +6 -1
  309. package/lib/opLifecycle/outbox.js.map +1 -1
  310. package/lib/opLifecycle/remoteMessageProcessor.d.ts +9 -3
  311. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  312. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  313. package/lib/packageVersion.d.ts +1 -1
  314. package/lib/packageVersion.js +1 -1
  315. package/lib/packageVersion.js.map +1 -1
  316. package/lib/pendingStateManager.d.ts +22 -6
  317. package/lib/pendingStateManager.d.ts.map +1 -1
  318. package/lib/pendingStateManager.js +41 -4
  319. package/lib/pendingStateManager.js.map +1 -1
  320. package/lib/summary/documentSchema.d.ts.map +1 -1
  321. package/lib/summary/documentSchema.js +2 -0
  322. package/lib/summary/documentSchema.js.map +1 -1
  323. package/lib/summary/index.d.ts +1 -1
  324. package/lib/summary/index.d.ts.map +1 -1
  325. package/lib/summary/index.js.map +1 -1
  326. package/lib/summary/orderedClientElection.d.ts +93 -31
  327. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  328. package/lib/summary/orderedClientElection.js +15 -5
  329. package/lib/summary/orderedClientElection.js.map +1 -1
  330. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  331. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  332. package/lib/summary/runningSummarizer.d.ts +17 -6
  333. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  334. package/lib/summary/runningSummarizer.js +12 -4
  335. package/lib/summary/runningSummarizer.js.map +1 -1
  336. package/lib/summary/summarizer.d.ts +9 -5
  337. package/lib/summary/summarizer.d.ts.map +1 -1
  338. package/lib/summary/summarizer.js +9 -3
  339. package/lib/summary/summarizer.js.map +1 -1
  340. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  341. package/lib/summary/summarizerClientElection.js.map +1 -1
  342. package/lib/summary/summarizerHeuristics.d.ts +6 -2
  343. package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
  344. package/lib/summary/summarizerHeuristics.js +12 -4
  345. package/lib/summary/summarizerHeuristics.js.map +1 -1
  346. package/lib/summary/summarizerNode/summarizerNode.d.ts +24 -8
  347. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  348. package/lib/summary/summarizerNode/summarizerNode.js +15 -5
  349. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  350. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +48 -16
  351. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  352. package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -1
  353. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  354. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +12 -4
  355. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  356. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +12 -4
  357. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  358. package/lib/summary/summarizerTypes.d.ts +246 -135
  359. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  360. package/lib/summary/summarizerTypes.js.map +1 -1
  361. package/lib/summary/summaryCollection.d.ts.map +1 -1
  362. package/lib/summary/summaryCollection.js +1 -4
  363. package/lib/summary/summaryCollection.js.map +1 -1
  364. package/lib/summary/summaryFormat.d.ts +24 -8
  365. package/lib/summary/summaryFormat.d.ts.map +1 -1
  366. package/lib/summary/summaryFormat.js.map +1 -1
  367. package/lib/summary/summaryGenerator.d.ts +9 -3
  368. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  369. package/lib/summary/summaryGenerator.js +3 -1
  370. package/lib/summary/summaryGenerator.js.map +1 -1
  371. package/lib/summary/summaryManager.d.ts +8 -4
  372. package/lib/summary/summaryManager.d.ts.map +1 -1
  373. package/lib/summary/summaryManager.js +12 -4
  374. package/lib/summary/summaryManager.js.map +1 -1
  375. package/lib/throttler.d.ts +26 -10
  376. package/lib/throttler.d.ts.map +1 -1
  377. package/lib/throttler.js +12 -4
  378. package/lib/throttler.js.map +1 -1
  379. package/package.json +44 -31
  380. package/src/batchTracker.ts +31 -33
  381. package/src/blobManager/blobManager.ts +38 -19
  382. package/src/blobManager/blobManagerSnapSum.ts +1 -1
  383. package/src/channelCollection.ts +44 -37
  384. package/src/connectionTelemetry.ts +31 -13
  385. package/src/containerHandleContext.ts +2 -2
  386. package/src/containerRuntime.ts +198 -140
  387. package/src/dataStore.ts +11 -6
  388. package/src/dataStoreContext.ts +80 -59
  389. package/src/dataStoreContexts.ts +16 -12
  390. package/src/dataStoreRegistry.ts +1 -1
  391. package/src/deltaManagerProxies.ts +5 -5
  392. package/src/deltaScheduler.ts +19 -13
  393. package/src/gc/garbageCollection.ts +41 -18
  394. package/src/gc/gcConfigs.ts +4 -4
  395. package/src/gc/gcDefinitions.ts +212 -70
  396. package/src/gc/gcHelpers.ts +11 -5
  397. package/src/gc/gcSummaryDefinitions.ts +18 -6
  398. package/src/gc/gcSummaryStateTracker.ts +4 -2
  399. package/src/gc/gcTelemetry.ts +47 -19
  400. package/src/gc/gcUnreferencedStateTracker.ts +40 -16
  401. package/src/gc/index.ts +1 -0
  402. package/src/{scheduleManager.ts → inboundBatchAggregator.ts} +54 -121
  403. package/src/index.ts +0 -3
  404. package/src/messageTypes.ts +14 -5
  405. package/src/metadata.ts +12 -4
  406. package/src/opLifecycle/batchManager.ts +12 -6
  407. package/src/opLifecycle/duplicateBatchDetector.ts +10 -4
  408. package/src/opLifecycle/opCompressor.ts +8 -4
  409. package/src/opLifecycle/opDecompressor.ts +20 -11
  410. package/src/opLifecycle/opGroupingManager.ts +12 -8
  411. package/src/opLifecycle/opSplitter.ts +11 -8
  412. package/src/opLifecycle/outbox.ts +22 -13
  413. package/src/opLifecycle/remoteMessageProcessor.ts +10 -4
  414. package/src/packageVersion.ts +1 -1
  415. package/src/pendingStateManager.ts +71 -15
  416. package/src/summary/documentSchema.ts +30 -18
  417. package/src/summary/index.ts +0 -3
  418. package/src/summary/orderedClientElection.ts +100 -38
  419. package/src/summary/runWhileConnectedCoordinator.ts +6 -3
  420. package/src/summary/runningSummarizer.ts +38 -19
  421. package/src/summary/summarizer.ts +29 -16
  422. package/src/summary/summarizerClientElection.ts +2 -2
  423. package/src/summary/summarizerHeuristics.ts +22 -11
  424. package/src/summary/summarizerNode/summarizerNode.ts +22 -12
  425. package/src/summary/summarizerNode/summarizerNodeUtils.ts +48 -16
  426. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +21 -11
  427. package/src/summary/summarizerTypes.ts +246 -139
  428. package/src/summary/summaryCollection.ts +24 -25
  429. package/src/summary/summaryFormat.ts +24 -8
  430. package/src/summary/summaryGenerator.ts +14 -8
  431. package/src/summary/summaryManager.ts +28 -18
  432. package/src/throttler.ts +23 -11
  433. package/dist/scheduleManager.d.ts +0 -28
  434. package/dist/scheduleManager.d.ts.map +0 -1
  435. package/dist/scheduleManager.js +0 -235
  436. package/dist/scheduleManager.js.map +0 -1
  437. package/lib/scheduleManager.d.ts +0 -28
  438. package/lib/scheduleManager.d.ts.map +0 -1
  439. package/lib/scheduleManager.js +0 -231
  440. package/lib/scheduleManager.js.map +0 -1
@@ -92,6 +92,7 @@ import {
92
92
  gcTreeKey,
93
93
  IInboundSignalMessage,
94
94
  type IRuntimeMessagesContent,
95
+ type ISummarizerNodeWithGC,
95
96
  } from "@fluidframework/runtime-definitions/internal";
96
97
  import {
97
98
  GCDataBuilder,
@@ -156,6 +157,7 @@ import {
156
157
  DeltaManagerPendingOpsProxy,
157
158
  DeltaManagerSummarizerProxy,
158
159
  } from "./deltaManagerProxies.js";
160
+ import { DeltaScheduler } from "./deltaScheduler.js";
159
161
  import {
160
162
  GCNodeType,
161
163
  GarbageCollector,
@@ -165,6 +167,7 @@ import {
165
167
  gcGenerationOptionName,
166
168
  type GarbageCollectionMessage,
167
169
  } from "./gc/index.js";
170
+ import { InboundBatchAggregator } from "./inboundBatchAggregator.js";
168
171
  import {
169
172
  ContainerMessageType,
170
173
  type ContainerRuntimeDocumentSchemaMessage,
@@ -198,7 +201,6 @@ import {
198
201
  IPendingLocalState,
199
202
  PendingStateManager,
200
203
  } from "./pendingStateManager.js";
201
- import { ScheduleManager } from "./scheduleManager.js";
202
204
  import {
203
205
  DocumentsSchemaController,
204
206
  EnqueueSummarizeResult,
@@ -242,6 +244,7 @@ import {
242
244
  rootHasIsolatedChannels,
243
245
  summarizerClientType,
244
246
  wrapSummaryInChannelsTree,
247
+ type IDocumentSchemaFeatures,
245
248
  } from "./summary/index.js";
246
249
  import { Throttler, formExponentialFn } from "./throttler.js";
247
250
 
@@ -421,7 +424,9 @@ export const DefaultSummaryConfiguration: ISummaryConfiguration = {
421
424
  * @alpha
422
425
  */
423
426
  export interface ISummaryRuntimeOptions {
424
- /** Override summary configurations set by the server. */
427
+ /**
428
+ * Override summary configurations set by the server.
429
+ */
425
430
  summaryConfigOverrides?: ISummaryConfiguration;
426
431
 
427
432
  /**
@@ -469,15 +474,7 @@ export interface IContainerRuntimeOptions {
469
474
  * 3. "bypass" will skip the check entirely. This is not recommended.
470
475
  */
471
476
  readonly loadSequenceNumberVerification?: "close" | "log" | "bypass";
472
- /**
473
- * Sets the flush mode for the runtime. In Immediate flush mode the runtime will immediately
474
- * send all operations to the driver layer, while in TurnBased the operations will be buffered
475
- * and then sent them as a single batch at the end of the turn.
476
- * By default, flush mode is TurnBased.
477
- *
478
- * @deprecated Only the default value TurnBased is supported. This option will be removed in the future.
479
- */
480
- readonly flushMode?: FlushMode;
477
+
481
478
  /**
482
479
  * Enables the runtime to compress ops. See {@link ICompressionRuntimeOptions}.
483
480
  */
@@ -519,8 +516,8 @@ export interface IContainerRuntimeOptions {
519
516
  * message to be sent to the service.
520
517
  * The grouping and ungrouping of such messages is handled by the "OpGroupingManager".
521
518
  *
522
- * By default, the feature is enabled.
523
- * @deprecated The ability to disable Grouped Batching is deprecated and will be removed in v2.20.0. This feature is required for the proper functioning of the Fluid Framework.
519
+ * By default, the feature is enabled. This feature can only be disabled when compression is also disabled.
520
+ * @deprecated The ability to disable Grouped Batching is deprecated and will be removed in a future release. This feature is required for the proper functioning of the Fluid Framework.
524
521
  */
525
522
  readonly enableGroupedBatching?: boolean;
526
523
 
@@ -591,7 +588,9 @@ export interface RuntimeHeaderData {
591
588
  allowTombstone?: boolean;
592
589
  }
593
590
 
594
- /** Default values for Runtime Headers */
591
+ /**
592
+ * Default values for Runtime Headers
593
+ */
595
594
  export const defaultRuntimeHeaderData: Required<RuntimeHeaderData> = {
596
595
  wait: true,
597
596
  viaHandle: false,
@@ -670,9 +669,13 @@ const defaultCompressionConfig = {
670
669
 
671
670
  const defaultChunkSizeInBytes = 204800;
672
671
 
673
- /** The default time to wait for pending ops to be processed during summarization */
672
+ /**
673
+ * The default time to wait for pending ops to be processed during summarization
674
+ */
674
675
  export const defaultPendingOpsWaitTimeoutMs = 1000;
675
- /** The default time to delay a summarization retry attempt when there are pending ops */
676
+ /**
677
+ * The default time to delay a summarization retry attempt when there are pending ops
678
+ */
676
679
  export const defaultPendingOpsRetryDelayMs = 1000;
677
680
 
678
681
  /**
@@ -698,10 +701,14 @@ export function isUnpackedRuntimeMessage(message: ISequencedDocumentMessage): bo
698
701
  export const agentSchedulerId = "_scheduler";
699
702
 
700
703
  // safely check navigator and get the hardware spec value
701
- export function getDeviceSpec() {
704
+ export function getDeviceSpec(): {
705
+ deviceMemory?: number | undefined;
706
+ hardwareConcurrency?: number | undefined;
707
+ } {
702
708
  try {
703
709
  if (typeof navigator === "object" && navigator !== null) {
704
710
  return {
711
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
705
712
  deviceMemory: (navigator as any).deviceMemory,
706
713
  hardwareConcurrency: navigator.hardwareConcurrency,
707
714
  };
@@ -717,10 +724,15 @@ export function getDeviceSpec() {
717
724
  */
718
725
  export const makeLegacySendBatchFn =
719
726
  (
720
- submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number,
727
+ submitFn: (
728
+ type: MessageType,
729
+ contents: unknown,
730
+ batch: boolean,
731
+ appData?: unknown,
732
+ ) => number,
721
733
  deltaManager: Pick<IDeltaManager<unknown, unknown>, "flush">,
722
734
  ) =>
723
- (batch: IBatch) => {
735
+ (batch: IBatch): number => {
724
736
  // Default to negative one to match Container.submitBatch behavior
725
737
  let clientSequenceNumber: number = -1;
726
738
  for (const message of batch.messages) {
@@ -765,12 +777,15 @@ async function createSummarizer(loader: ILoader, url: string): Promise<ISummariz
765
777
  if (resolvedContainer.getEntryPoint !== undefined) {
766
778
  fluidObject = await resolvedContainer.getEntryPoint();
767
779
  } else {
780
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
768
781
  const response = await (resolvedContainer as any).request({
769
782
  url: `/${summarizerRequestUrl}`,
770
783
  });
784
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
771
785
  if (response.status !== 200 || response.mimeType !== "fluid/object") {
772
786
  throw responseToException(response, request);
773
787
  }
788
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
774
789
  fluidObject = response.value;
775
790
  }
776
791
 
@@ -786,7 +801,9 @@ async function createSummarizer(loader: ILoader, url: string): Promise<ISummariz
786
801
  * This allows new runtime to make documents not openable for old runtimes, one explicit document schema control is enabled.
787
802
  * Please see addMetadataToSummary() as well
788
803
  */
789
- function lastMessageFromMetadata(metadata: IContainerRuntimeMetadata | undefined) {
804
+ function lastMessageFromMetadata(
805
+ metadata: IContainerRuntimeMetadata | undefined,
806
+ ): ISummaryMetadataMessage | undefined {
790
807
  return metadata?.documentSchema?.runtime?.explicitSchemaControl
791
808
  ? metadata?.lastMessage
792
809
  : metadata?.message;
@@ -798,7 +815,7 @@ function lastMessageFromMetadata(metadata: IContainerRuntimeMetadata | undefined
798
815
  * We only want to log this once, to avoid spamming telemetry if we are wrong and these cases are hit commonly.
799
816
  */
800
817
  export let getSingleUseLegacyLogCallback = (logger: ITelemetryLoggerExt, type: string) => {
801
- return (codePath: string) => {
818
+ return (codePath: string): void => {
802
819
  logger.sendTelemetryEvent({
803
820
  eventName: "LegacyMessageFormat",
804
821
  details: { codePath, type },
@@ -864,11 +881,7 @@ export async function loadContainerRuntime(
864
881
  * Represents the runtime of the container. Contains helper functions/state of the container.
865
882
  * It will define the store level mappings.
866
883
  *
867
- * @deprecated To be removed from the Legacy-Alpha API in version 2.20.0.
868
- * Use the loadContainerRuntime function and interfaces IContainerRuntime / IRuntime instead.
869
- *
870
- * @legacy
871
- * @alpha
884
+ * @internal
872
885
  */
873
886
  export class ContainerRuntime
874
887
  extends TypedEventEmitter<IContainerRuntimeEvents>
@@ -901,7 +914,9 @@ export class ContainerRuntime
901
914
  runtimeOptions?: IContainerRuntimeOptions; // May also include options from IContainerRuntimeOptionsInternal
902
915
  containerScope?: FluidObject;
903
916
  containerRuntimeCtor?: typeof ContainerRuntime;
904
- /** @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md */
917
+ /**
918
+ * @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
919
+ */
905
920
  requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
906
921
  provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>;
907
922
  }): Promise<ContainerRuntime> {
@@ -939,7 +954,9 @@ export class ContainerRuntime
939
954
  gcOptions = {},
940
955
  loadSequenceNumberVerification = "close",
941
956
  flushMode = defaultFlushMode,
942
- compressionOptions = defaultCompressionConfig,
957
+ compressionOptions = runtimeOptions.enableGroupedBatching === false
958
+ ? disabledCompressionConfig // Compression must be disabled if Grouping is disabled
959
+ : defaultCompressionConfig,
943
960
  maxBatchSizeInBytes = defaultMaxBatchSizeInBytes,
944
961
  enableRuntimeIdCompressor,
945
962
  chunkSizeInBytes = defaultChunkSizeInBytes,
@@ -1065,7 +1082,7 @@ export class ContainerRuntime
1065
1082
  idCompressorMode = desiredIdCompressorMode;
1066
1083
  }
1067
1084
 
1068
- const createIdCompressorFn = async () => {
1085
+ const createIdCompressorFn = async (): Promise<IIdCompressor & IIdCompressorCore> => {
1069
1086
  const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import(
1070
1087
  "@fluidframework/id-compressor/internal"
1071
1088
  );
@@ -1122,6 +1139,10 @@ export class ContainerRuntime
1122
1139
  },
1123
1140
  );
1124
1141
 
1142
+ if (compressionLz4 && !enableGroupedBatching) {
1143
+ throw new UsageError("If compression is enabled, op grouping must be enabled too");
1144
+ }
1145
+
1125
1146
  const featureGatesForTelemetry: Record<string, boolean | number | undefined> = {};
1126
1147
 
1127
1148
  // Make sure we've got all the options including internal ones
@@ -1182,7 +1203,7 @@ export class ContainerRuntime
1182
1203
  return runtime;
1183
1204
  }
1184
1205
 
1185
- public readonly options: Record<string | number, any>;
1206
+ public readonly options: Record<string | number, unknown>;
1186
1207
  private imminentClosure: boolean = false;
1187
1208
 
1188
1209
  private readonly _getClientId: () => string | undefined;
@@ -1196,15 +1217,15 @@ export class ContainerRuntime
1196
1217
  return this._storage;
1197
1218
  }
1198
1219
 
1199
- public get containerRuntime() {
1220
+ public get containerRuntime(): ContainerRuntime {
1200
1221
  return this;
1201
1222
  }
1202
1223
 
1203
1224
  private readonly submitFn: (
1204
1225
  type: MessageType,
1205
- contents: any,
1226
+ contents: unknown,
1206
1227
  batch: boolean,
1207
- appData?: any,
1228
+ appData?: unknown,
1208
1229
  ) => number;
1209
1230
  /**
1210
1231
  * Although current IContainerContext guarantees submitBatchFn, it is not available on older loaders.
@@ -1248,9 +1269,13 @@ export class ContainerRuntime
1248
1269
  * has to deal with compressed ops as other clients might send them.
1249
1270
  * And in reverse, session schema can have compression Off, but feature gates / runtime options want it On.
1250
1271
  * In such case it will be off in session schema, however this client will propose change to schema, and once / if
1251
- * this op rountrips, compression will be On. Client can't send compressed ops until it's change in schema.
1272
+ * this op roundtrips, compression will be On. Client can't send compressed ops until it's change in schema.
1252
1273
  */
1253
- public get sessionSchema() {
1274
+ public get sessionSchema(): {
1275
+ [P in keyof IDocumentSchemaFeatures]?: IDocumentSchemaFeatures[P] extends boolean
1276
+ ? true
1277
+ : IDocumentSchemaFeatures[P];
1278
+ } {
1254
1279
  return this.documentsSchemaController.sessionSchema.runtime;
1255
1280
  }
1256
1281
 
@@ -1266,13 +1291,13 @@ export class ContainerRuntime
1266
1291
  // In such case we have to process all ops, including those marked with savedOp === true.
1267
1292
  private readonly skipSavedCompressorOps: boolean;
1268
1293
 
1269
- public get idCompressorMode() {
1294
+ public get idCompressorMode(): IdCompressorMode {
1270
1295
  return this.sessionSchema.idCompressorMode;
1271
1296
  }
1272
1297
  /**
1273
- * See IContainerRuntimeBase.idCompressor() for details.
1298
+ * {@inheritDoc @fluidframework/runtime-definitions#IContainerRuntimeBase.idCompressor}
1274
1299
  */
1275
- public get idCompressor() {
1300
+ public get idCompressor(): (IIdCompressor & IIdCompressorCore) | undefined {
1276
1301
  // Expose ID Compressor only if it's On from the start.
1277
1302
  // If container uses delayed mode, then we can only expose generateDocumentUniqueId() and nothing else.
1278
1303
  // That's because any other usage will require immidiate loading of ID Compressor in next sessions in order
@@ -1290,9 +1315,9 @@ export class ContainerRuntime
1290
1315
  protected _loadIdCompressor: Promise<void> | undefined;
1291
1316
 
1292
1317
  /**
1293
- * See IContainerRuntimeBase.generateDocumentUniqueId() for details.
1318
+ * {@inheritDoc @fluidframework/runtime-definitions#IContainerRuntimeBase.generateDocumentUniqueId}
1294
1319
  */
1295
- public generateDocumentUniqueId() {
1320
+ public generateDocumentUniqueId(): string | number {
1296
1321
  return this._idCompressor?.generateDocumentUniqueId() ?? uuid();
1297
1322
  }
1298
1323
 
@@ -1376,13 +1401,15 @@ export class ContainerRuntime
1376
1401
  return this._connected;
1377
1402
  }
1378
1403
 
1379
- /** clientId of parent (non-summarizing) container that owns summarizer container */
1404
+ /**
1405
+ * clientId of parent (non-summarizing) container that owns summarizer container
1406
+ */
1380
1407
  public get summarizerClientId(): string | undefined {
1381
1408
  return this.summarizerClientElection?.electedClientId;
1382
1409
  }
1383
1410
 
1384
1411
  private _disposed = false;
1385
- public get disposed() {
1412
+ public get disposed(): boolean {
1386
1413
  return this._disposed;
1387
1414
  }
1388
1415
 
@@ -1410,7 +1437,8 @@ export class ContainerRuntime
1410
1437
  * It is created only by summarizing container (i.e. one with clientType === "summarizer")
1411
1438
  */
1412
1439
  private readonly _summarizer?: Summarizer;
1413
- private readonly scheduleManager: ScheduleManager;
1440
+ private readonly deltaScheduler: DeltaScheduler;
1441
+ private readonly inboundBatchAggregator: InboundBatchAggregator;
1414
1442
  private readonly blobManager: BlobManager;
1415
1443
  private readonly pendingStateManager: PendingStateManager;
1416
1444
  private readonly duplicateBatchDetector: DuplicateBatchDetector | undefined;
@@ -1420,7 +1448,9 @@ export class ContainerRuntime
1420
1448
  private readonly channelCollection: ChannelCollection;
1421
1449
  private readonly remoteMessageProcessor: RemoteMessageProcessor;
1422
1450
 
1423
- /** The last message processed at the time of the last summary. */
1451
+ /**
1452
+ * The last message processed at the time of the last summary.
1453
+ */
1424
1454
  private messageAtLastSummary: ISummaryMetadataMessage | undefined;
1425
1455
 
1426
1456
  private get summarizer(): Summarizer {
@@ -1521,10 +1551,7 @@ export class ContainerRuntime
1521
1551
  electedSummarizerData: ISerializedElection | undefined,
1522
1552
  chunks: [string, string[]][],
1523
1553
  dataStoreAliasMap: [string, string][],
1524
- runtimeOptions: Readonly<
1525
- Required<Omit<IContainerRuntimeOptions, "flushMode" | "enableGroupedBatching">> &
1526
- IContainerRuntimeOptions // Let flushMode and enabledGroupedBatching be optional now since they're soon to be removed
1527
- >,
1554
+ runtimeOptions: Readonly<Required<IContainerRuntimeOptions>>,
1528
1555
  private readonly containerScope: FluidObject,
1529
1556
  // Create a custom ITelemetryBaseLogger to output telemetry events.
1530
1557
  public readonly baseLogger: ITelemetryBaseLogger,
@@ -1572,7 +1599,6 @@ export class ContainerRuntime
1572
1599
  // Backfill in defaults for the internal runtimeOptions, since they may not be present on the provided runtimeOptions object
1573
1600
  this.runtimeOptions = {
1574
1601
  flushMode: defaultFlushMode,
1575
- enableGroupedBatching: true,
1576
1602
  ...runtimeOptions,
1577
1603
  };
1578
1604
  this.logger = createChildLogger({ logger: this.baseLogger });
@@ -1659,6 +1685,7 @@ export class ContainerRuntime
1659
1685
  eventName: "GCFeatureMatrix",
1660
1686
  metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
1661
1687
  inputs: JSON.stringify({
1688
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1662
1689
  gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gcGenerationOptionName],
1663
1690
  }),
1664
1691
  });
@@ -1674,9 +1701,6 @@ export class ContainerRuntime
1674
1701
  groupedBatchingEnabled: this.groupedBatchingEnabled,
1675
1702
  opCountThreshold:
1676
1703
  this.mc.config.getNumber("Fluid.ContainerRuntime.GroupedBatchingOpCount") ?? 2,
1677
- reentrantBatchGroupingEnabled:
1678
- this.mc.config.getBoolean("Fluid.ContainerRuntime.GroupedBatchingReentrancy") ??
1679
- true,
1680
1704
  },
1681
1705
  this.mc.logger,
1682
1706
  );
@@ -1901,11 +1925,16 @@ export class ContainerRuntime
1901
1925
  closeContainer: (error?: ICriticalContainerError) => this.closeFn(error),
1902
1926
  });
1903
1927
 
1904
- this.scheduleManager = new ScheduleManager(
1928
+ this.deltaScheduler = new DeltaScheduler(
1905
1929
  this.innerDeltaManager,
1906
1930
  this,
1931
+ createChildLogger({ logger: this.logger, namespace: "DeltaScheduler" }),
1932
+ );
1933
+
1934
+ this.inboundBatchAggregator = new InboundBatchAggregator(
1935
+ this.innerDeltaManager,
1907
1936
  () => this.clientId,
1908
- createChildLogger({ logger: this.logger, namespace: "ScheduleManager" }),
1937
+ createChildLogger({ logger: this.logger, namespace: "InboundBatchAggregator" }),
1909
1938
  );
1910
1939
 
1911
1940
  const disablePartialFlush = this.mc.config.getBoolean(
@@ -2027,7 +2056,7 @@ export class ContainerRuntime
2027
2056
  } else if (SummarizerClientElection.clientDetailsPermitElection(this.clientDetails)) {
2028
2057
  // Only create a SummaryManager and SummarizerClientElection
2029
2058
  // if summaries are enabled and we are not the summarizer client.
2030
- const defaultAction = () => {
2059
+ const defaultAction = (): void => {
2031
2060
  if (this.summaryCollection.opsSinceLastAck > this.maxOpsSinceLastSummary) {
2032
2061
  this.mc.logger.sendTelemetryEvent({ eventName: "SummaryStatus:Behind" });
2033
2062
  // unregister default to no log on every op after falling behind
@@ -2129,7 +2158,7 @@ export class ContainerRuntime
2129
2158
  this.skipSavedCompressorOps = pendingRuntimeState?.pendingIdCompressorState !== undefined;
2130
2159
  }
2131
2160
 
2132
- public onSchemaChange(schema: IDocumentSchemaCurrent) {
2161
+ public onSchemaChange(schema: IDocumentSchemaCurrent): void {
2133
2162
  this.logger.sendTelemetryEvent({
2134
2163
  eventName: "SchemaChangeAccept",
2135
2164
  sessionRuntimeSchema: JSON.stringify(schema),
@@ -2156,7 +2185,7 @@ export class ContainerRuntime
2156
2185
  return (
2157
2186
  summarizeInternal: SummarizeInternalFn,
2158
2187
  getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
2159
- ) =>
2188
+ ): ISummarizerNodeWithGC =>
2160
2189
  this.summarizerNode.createChild(
2161
2190
  summarizeInternal,
2162
2191
  id,
@@ -2166,19 +2195,22 @@ export class ContainerRuntime
2166
2195
  );
2167
2196
  }
2168
2197
 
2169
- public deleteChildSummarizerNode(id: string) {
2198
+ public deleteChildSummarizerNode(id: string): void {
2170
2199
  return this.summarizerNode.deleteChild(id);
2171
2200
  }
2172
2201
 
2173
- /* IFluidParentContext APIs that should not be called on Root */
2174
- public makeLocallyVisible() {
2202
+ // #region `IFluidParentContext` APIs that should not be called on Root
2203
+
2204
+ public makeLocallyVisible(): void {
2175
2205
  assert(false, 0x8eb /* should not be called */);
2176
2206
  }
2177
2207
 
2178
- public setChannelDirty(address: string) {
2208
+ public setChannelDirty(address: string): void {
2179
2209
  assert(false, 0x909 /* should not be called */);
2180
2210
  }
2181
2211
 
2212
+ // #endregion
2213
+
2182
2214
  /**
2183
2215
  * Initializes the state from the base snapshot this container runtime loaded from.
2184
2216
  */
@@ -2218,6 +2250,8 @@ export class ContainerRuntime
2218
2250
  this._summarizer?.dispose();
2219
2251
  this.channelCollection.dispose();
2220
2252
  this.pendingStateManager.dispose();
2253
+ this.inboundBatchAggregator.dispose();
2254
+ this.deltaScheduler.dispose();
2221
2255
  this.emit("dispose");
2222
2256
  this.removeAllListeners();
2223
2257
  }
@@ -2430,8 +2464,10 @@ export class ContainerRuntime
2430
2464
  return this.channelCollection.internalId(maybeAlias);
2431
2465
  }
2432
2466
 
2433
- /** Adds the container's metadata to the given summary tree. */
2434
- private addMetadataToSummary(summaryTree: ISummaryTreeWithStats) {
2467
+ /**
2468
+ * Adds the container's metadata to the given summary tree.
2469
+ */
2470
+ private addMetadataToSummary(summaryTree: ISummaryTreeWithStats): void {
2435
2471
  // The last message processed at the time of summary. If there are no new messages, use the message from the
2436
2472
  // last summary.
2437
2473
  const message =
@@ -2458,7 +2494,7 @@ export class ContainerRuntime
2458
2494
  // last message's sequence number.
2459
2495
  // See also lastMessageFromMetadata()
2460
2496
  message: explicitSchemaControl
2461
- ? ({ sequenceNumber: -1 } as any as ISummaryMetadataMessage)
2497
+ ? ({ sequenceNumber: -1 } as unknown as ISummaryMetadataMessage)
2462
2498
  : message,
2463
2499
  lastMessage: explicitSchemaControl ? message : undefined,
2464
2500
  documentSchema,
@@ -2472,7 +2508,7 @@ export class ContainerRuntime
2472
2508
  fullTree: boolean,
2473
2509
  trackState: boolean,
2474
2510
  telemetryContext?: ITelemetryContext,
2475
- ) {
2511
+ ): void {
2476
2512
  this.addMetadataToSummary(summaryTree);
2477
2513
 
2478
2514
  if (this._idCompressor) {
@@ -2548,11 +2584,11 @@ export class ContainerRuntime
2548
2584
  return this.consecutiveReconnects < this.maxConsecutiveReconnects;
2549
2585
  }
2550
2586
 
2551
- private resetReconnectCount() {
2587
+ private resetReconnectCount(): void {
2552
2588
  this.consecutiveReconnects = 0;
2553
2589
  }
2554
2590
 
2555
- private replayPendingStates() {
2591
+ private replayPendingStates(): void {
2556
2592
  // We need to be able to send ops to replay states
2557
2593
  if (!this.canSendOps()) {
2558
2594
  return;
@@ -2592,7 +2628,7 @@ export class ContainerRuntime
2592
2628
  // TODO: markfields: confirm Local- versus Outbound- ContainerRuntimeMessage typing
2593
2629
  private parseLocalOpContent(serializedContents?: string): LocalContainerRuntimeMessage {
2594
2630
  assert(serializedContents !== undefined, 0x6d5 /* content must be defined */);
2595
- const message: LocalContainerRuntimeMessage = JSON.parse(serializedContents);
2631
+ const message = JSON.parse(serializedContents) as LocalContainerRuntimeMessage;
2596
2632
  assert(message.type !== undefined, 0x6d6 /* incorrect op content format */);
2597
2633
  return message;
2598
2634
  }
@@ -2640,7 +2676,7 @@ export class ContainerRuntime
2640
2676
  }
2641
2677
  }
2642
2678
 
2643
- private async loadIdCompressor() {
2679
+ private async loadIdCompressor(): Promise<void | undefined> {
2644
2680
  if (
2645
2681
  this._idCompressor === undefined &&
2646
2682
  this.idCompressorMode !== undefined &&
@@ -2665,7 +2701,7 @@ export class ContainerRuntime
2665
2701
  return this._loadIdCompressor;
2666
2702
  }
2667
2703
 
2668
- public setConnectionState(connected: boolean, clientId?: string) {
2704
+ public setConnectionState(connected: boolean, clientId?: string): void {
2669
2705
  // Validate we have consistent state
2670
2706
  const currentClientId = this._audience.getSelf()?.clientId;
2671
2707
  assert(clientId === currentClientId, 0x977 /* input clientId does not match Audience */);
@@ -2708,7 +2744,7 @@ export class ContainerRuntime
2708
2744
  this.setConnectionStateCore(connected, clientId);
2709
2745
  }
2710
2746
 
2711
- private setConnectionStateCore(connected: boolean, clientId?: string) {
2747
+ private setConnectionStateCore(connected: boolean, clientId?: string): void {
2712
2748
  assert(
2713
2749
  !this.delayConnectClientId,
2714
2750
  0x394 /* connect event delay must be cleared before propagating connect event */,
@@ -2776,7 +2812,7 @@ export class ContainerRuntime
2776
2812
  raiseConnectedEvent(this.mc.logger, this, connected, clientId);
2777
2813
  }
2778
2814
 
2779
- public async notifyOpReplay(message: ISequencedDocumentMessage) {
2815
+ public async notifyOpReplay(message: ISequencedDocumentMessage): Promise<void> {
2780
2816
  await this.pendingStateManager.applyStashedOpsAt(message.sequenceNumber);
2781
2817
  }
2782
2818
 
@@ -2785,7 +2821,7 @@ export class ContainerRuntime
2785
2821
  * @param messageCopy - Sequenced message for a distributed document.
2786
2822
  * @param local - true if the message was originally generated by the client receiving it.
2787
2823
  */
2788
- public process({ ...messageCopy }: ISequencedDocumentMessage, local: boolean) {
2824
+ public process({ ...messageCopy }: ISequencedDocumentMessage, local: boolean): void {
2789
2825
  // spread operator above ensure we make a shallow copy of message, as the processing flow will modify it.
2790
2826
  // There might be multiple container instances receiving the same message.
2791
2827
 
@@ -2923,7 +2959,7 @@ export class ContainerRuntime
2923
2959
  private _processedClientSequenceNumber: number | undefined;
2924
2960
 
2925
2961
  /**
2926
- * Processes inbound message(s). It calls schedule manager according to the messages' location in the batch.
2962
+ * Processes inbound message(s). It calls delta scheduler according to the messages' location in the batch.
2927
2963
  * @param messagesWithMetadata - messages to process along with their metadata.
2928
2964
  * @param locationInBatch - Are we processing the start and/or end of a batch?
2929
2965
  * @param local - true if the messages were originally generated by the client receiving it.
@@ -2941,11 +2977,11 @@ export class ContainerRuntime
2941
2977
  savedOp: boolean | undefined,
2942
2978
  runtimeBatch: boolean,
2943
2979
  groupedBatch: boolean,
2944
- ) {
2980
+ ): void {
2945
2981
  if (locationInBatch.batchStart) {
2946
2982
  const firstMessage = messagesWithMetadata[0]?.message;
2947
2983
  assert(firstMessage !== undefined, 0xa31 /* Batch must have at least one message */);
2948
- this.scheduleManager.batchBegin(firstMessage);
2984
+ this.emit("batchBegin", firstMessage);
2949
2985
  }
2950
2986
 
2951
2987
  let error: unknown;
@@ -2959,9 +2995,11 @@ export class ContainerRuntime
2959
2995
  return;
2960
2996
  }
2961
2997
 
2962
- // Helper that updates a message's minimum sequence number to the minimum sequence number that container
2998
+ // Updates a message's minimum sequence number to the minimum sequence number that container
2963
2999
  // runtime is tracking and sets _processedClientSequenceNumber. It returns the updated message.
2964
- const updateSequenceNumbers = (message: ISequencedDocumentMessage) => {
3000
+ const updateSequenceNumbers = (
3001
+ message: ISequencedDocumentMessage,
3002
+ ): InboundSequencedContainerRuntimeMessage => {
2965
3003
  // Set the minimum sequence number to the containerRuntime's understanding of minimum sequence number.
2966
3004
  message.minimumSequenceNumber =
2967
3005
  this.useDeltaManagerOpsProxy &&
@@ -2998,8 +3036,8 @@ export class ContainerRuntime
2998
3036
  let bunchedMessagesContent: IRuntimeMessagesContent[] = [];
2999
3037
  let previousMessage: InboundSequencedContainerRuntimeMessage | undefined;
3000
3038
 
3001
- // Helper that processes the previous bunch of messages.
3002
- const sendBunchedMessages = () => {
3039
+ // Process the previous bunch of messages.
3040
+ const sendBunchedMessages = (): void => {
3003
3041
  assert(previousMessage !== undefined, 0xa67 /* previous message must exist */);
3004
3042
  this.ensureNoDataModelChanges(() => {
3005
3043
  this.validateAndProcessRuntimeMessages(
@@ -3045,7 +3083,7 @@ export class ContainerRuntime
3045
3083
  if (locationInBatch.batchEnd) {
3046
3084
  const lastMessage = messagesWithMetadata[messagesWithMetadata.length - 1]?.message;
3047
3085
  assert(lastMessage !== undefined, 0xa32 /* Batch must have at least one message */);
3048
- this.scheduleManager.batchEnd(error, lastMessage);
3086
+ this.emit("batchEnd", error, lastMessage);
3049
3087
  }
3050
3088
  }
3051
3089
  }
@@ -3054,7 +3092,7 @@ export class ContainerRuntime
3054
3092
  * Observes messages that are not intended for the runtime layer, updating/notifying Runtime systems as needed.
3055
3093
  * @param message - non-runtime message to process.
3056
3094
  */
3057
- private observeNonRuntimeMessage(message: ISequencedDocumentMessage) {
3095
+ private observeNonRuntimeMessage(message: ISequencedDocumentMessage): void {
3058
3096
  // Set the minimum sequence number to the containerRuntime's understanding of minimum sequence number.
3059
3097
  if (this.deltaManager.minimumSequenceNumber < message.minimumSequenceNumber) {
3060
3098
  message.minimumSequenceNumber = this.deltaManager.minimumSequenceNumber;
@@ -3154,7 +3192,10 @@ export class ContainerRuntime
3154
3192
  }
3155
3193
  }
3156
3194
 
3157
- private processIdCompressorMessages(messageContents: IdCreationRange[], savedOp?: boolean) {
3195
+ private processIdCompressorMessages(
3196
+ messageContents: IdCreationRange[],
3197
+ savedOp?: boolean,
3198
+ ): void {
3158
3199
  for (const range of messageContents) {
3159
3200
  // Don't re-finalize the range if we're processing a "savedOp" in
3160
3201
  // stashed ops flow. The compressor is stashed with these ops already processed.
@@ -3183,7 +3224,7 @@ export class ContainerRuntime
3183
3224
  /**
3184
3225
  * Emits the Signal event and update the perf signal data.
3185
3226
  */
3186
- private sendSignalTelemetryEvent() {
3227
+ private sendSignalTelemetryEvent(): void {
3187
3228
  const duration = Date.now() - this._signalTracking.signalTimestamp;
3188
3229
  this.mc.logger.sendPerformanceEvent({
3189
3230
  eventName: "SignalLatency",
@@ -3277,7 +3318,7 @@ export class ContainerRuntime
3277
3318
  }
3278
3319
  }
3279
3320
 
3280
- public processSignal(message: ISignalMessage, local: boolean) {
3321
+ public processSignal(message: ISignalMessage, local: boolean): void {
3281
3322
  const envelope = message.content as ISignalEnvelope;
3282
3323
  const transformed: IInboundSignalMessage = {
3283
3324
  clientId: message.clientId,
@@ -3439,7 +3480,6 @@ export class ContainerRuntime
3439
3480
  ): Promise<IDataStore> {
3440
3481
  const context = this.channelCollection.createDataStoreContext(
3441
3482
  Array.isArray(pkg) ? pkg : [pkg],
3442
- undefined, // props
3443
3483
  loadingGroupId,
3444
3484
  );
3445
3485
  return channelToDataStore(
@@ -3450,26 +3490,7 @@ export class ContainerRuntime
3450
3490
  );
3451
3491
  }
3452
3492
 
3453
- /**
3454
- * @deprecated 0.16 Issue #1537, #3631
3455
- */
3456
- public async _createDataStoreWithProps(
3457
- pkg: Readonly<string | string[]>,
3458
- props?: any,
3459
- ): Promise<IDataStore> {
3460
- const context = this.channelCollection.createDataStoreContext(
3461
- Array.isArray(pkg) ? pkg : [pkg],
3462
- props,
3463
- );
3464
- return channelToDataStore(
3465
- await context.realize(),
3466
- context.id,
3467
- this.channelCollection,
3468
- this.mc.logger,
3469
- );
3470
- }
3471
-
3472
- private canSendOps() {
3493
+ private canSendOps(): boolean {
3473
3494
  // Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
3474
3495
  // container runtime's ability to send ops depend on the actual readonly state of the delta manager.
3475
3496
  return (
@@ -3480,7 +3501,7 @@ export class ContainerRuntime
3480
3501
  /**
3481
3502
  * Typically ops are batched and later flushed together, but in some cases we want to flush immediately.
3482
3503
  */
3483
- private currentlyBatching() {
3504
+ private currentlyBatching(): boolean {
3484
3505
  return this.flushMode !== FlushMode.Immediate || this._orderSequentiallyCalls !== 0;
3485
3506
  }
3486
3507
 
@@ -3502,7 +3523,10 @@ export class ContainerRuntime
3502
3523
  return this.dirtyContainer;
3503
3524
  }
3504
3525
 
3505
- private isContainerMessageDirtyable({ type, contents }: OutboundContainerRuntimeMessage) {
3526
+ private isContainerMessageDirtyable({
3527
+ type,
3528
+ contents,
3529
+ }: OutboundContainerRuntimeMessage): boolean {
3506
3530
  // Certain container runtime messages should not mark the container dirty such as the old built-in
3507
3531
  // AgentScheduler and Garbage collector messages.
3508
3532
  switch (type) {
@@ -3534,7 +3558,7 @@ export class ContainerRuntime
3534
3558
  private createNewSignalEnvelope(
3535
3559
  address: string | undefined,
3536
3560
  type: string,
3537
- content: any,
3561
+ content: unknown,
3538
3562
  ): Omit<ISignalEnvelope, "broadcastSignalSequenceNumber"> {
3539
3563
  const newEnvelope: Omit<ISignalEnvelope, "broadcastSignalSequenceNumber"> = {
3540
3564
  address,
@@ -3544,7 +3568,7 @@ export class ContainerRuntime
3544
3568
  return newEnvelope;
3545
3569
  }
3546
3570
 
3547
- private submitEnvelopedSignal(envelope: ISignalEnvelope, targetClientId?: string) {
3571
+ private submitEnvelopedSignal(envelope: ISignalEnvelope, targetClientId?: string): void {
3548
3572
  const isBroadcastSignal = targetClientId === undefined;
3549
3573
 
3550
3574
  if (isBroadcastSignal) {
@@ -3596,7 +3620,7 @@ export class ContainerRuntime
3596
3620
  * Support for this option at container runtime is planned to be deprecated in the future.
3597
3621
  *
3598
3622
  */
3599
- public submitSignal(type: string, content: unknown, targetClientId?: string) {
3623
+ public submitSignal(type: string, content: unknown, targetClientId?: string): void {
3600
3624
  this.verifyNotClosed();
3601
3625
  const envelope = this.createNewSignalEnvelope(undefined /* address */, type, content);
3602
3626
  return this.submitEnvelopedSignal(envelope, targetClientId);
@@ -3693,17 +3717,29 @@ export class ContainerRuntime
3693
3717
  * Returns a summary of the runtime at the current sequence number.
3694
3718
  */
3695
3719
  public async summarize(options: {
3696
- /** True to generate the full tree with no handle reuse optimizations; defaults to false */
3720
+ /**
3721
+ * True to generate the full tree with no handle reuse optimizations; defaults to false
3722
+ */
3697
3723
  fullTree?: boolean;
3698
- /** True to track the state for this summary in the SummarizerNodes; defaults to true */
3724
+ /**
3725
+ * True to track the state for this summary in the SummarizerNodes; defaults to true
3726
+ */
3699
3727
  trackState?: boolean;
3700
- /** Logger to use for correlated summary events */
3728
+ /**
3729
+ * Logger to use for correlated summary events
3730
+ */
3701
3731
  summaryLogger?: ITelemetryLoggerExt;
3702
- /** True to run garbage collection before summarizing; defaults to true */
3732
+ /**
3733
+ * True to run garbage collection before summarizing; defaults to true
3734
+ */
3703
3735
  runGC?: boolean;
3704
- /** True to generate full GC data */
3736
+ /**
3737
+ * True to generate full GC data
3738
+ */
3705
3739
  fullGC?: boolean;
3706
- /** True to run GC sweep phase after the mark phase */
3740
+ /**
3741
+ * True to run GC sweep phase after the mark phase
3742
+ */
3707
3743
  runSweep?: boolean;
3708
3744
  }): Promise<ISummaryTreeWithStats> {
3709
3745
  this.verifyNotClosed();
@@ -3779,7 +3815,7 @@ export class ContainerRuntime
3779
3815
  * @param usedRoutes - The routes that are used in all nodes in this Container.
3780
3816
  * @see IGarbageCollectionRuntime.updateUsedRoutes
3781
3817
  */
3782
- public updateUsedRoutes(usedRoutes: readonly string[]) {
3818
+ public updateUsedRoutes(usedRoutes: readonly string[]): void {
3783
3819
  // Update our summarizer node's used routes. Updating used routes in summarizer node before
3784
3820
  // summarizing is required and asserted by the the summarizer node. We are the root and are
3785
3821
  // always referenced, so the used routes is only self-route (empty string).
@@ -3810,7 +3846,7 @@ export class ContainerRuntime
3810
3846
  *
3811
3847
  * @param tombstonedRoutes - Data store and attachment blob routes that are tombstones in this Container.
3812
3848
  */
3813
- public updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {
3849
+ public updateTombstonedRoutes(tombstonedRoutes: readonly string[]): void {
3814
3850
  const { dataStoreRoutes } = this.getDataStoreAndBlobManagerRoutes(tombstonedRoutes);
3815
3851
  this.channelCollection.updateTombstonedRoutes(dataStoreRoutes);
3816
3852
  }
@@ -3863,7 +3899,10 @@ export class ContainerRuntime
3863
3899
  * @returns Two route lists - One that contains routes for blob manager and another one that contains routes
3864
3900
  * for data stores.
3865
3901
  */
3866
- private getDataStoreAndBlobManagerRoutes(routes: readonly string[]) {
3902
+ private getDataStoreAndBlobManagerRoutes(routes: readonly string[]): {
3903
+ blobManagerRoutes: string[];
3904
+ dataStoreRoutes: string[];
3905
+ } {
3867
3906
  const blobManagerRoutes: string[] = [];
3868
3907
  const dataStoreRoutes: string[] = [];
3869
3908
  for (const route of routes) {
@@ -3882,11 +3921,17 @@ export class ContainerRuntime
3882
3921
  */
3883
3922
  public async collectGarbage(
3884
3923
  options: {
3885
- /** Logger to use for logging GC events */
3924
+ /**
3925
+ * Logger to use for logging GC events
3926
+ */
3886
3927
  logger?: ITelemetryLoggerExt;
3887
- /** True to run GC sweep phase after the mark phase */
3928
+ /**
3929
+ * True to run GC sweep phase after the mark phase
3930
+ */
3888
3931
  runSweep?: boolean;
3889
- /** True to generate full GC data */
3932
+ /**
3933
+ * True to generate full GC data
3934
+ */
3890
3935
  fullGC?: boolean;
3891
3936
  },
3892
3937
  telemetryContext?: ITelemetryContext,
@@ -3901,7 +3946,11 @@ export class ContainerRuntime
3901
3946
  * @param toPath - The absolute path of the outbound node that is referenced.
3902
3947
  * @param messageTimestampMs - The timestamp of the message that added the reference.
3903
3948
  */
3904
- public addedGCOutboundRoute(fromPath: string, toPath: string, messageTimestampMs?: number) {
3949
+ public addedGCOutboundRoute(
3950
+ fromPath: string,
3951
+ toPath: string,
3952
+ messageTimestampMs?: number,
3953
+ ): void {
3905
3954
  // This is always called when processing an op so messageTimestampMs should exist. Due to back-compat
3906
3955
  // across the data store runtime / container runtime boundary, this may be undefined and if so, get
3907
3956
  // the timestamp from the last processed message which should exist.
@@ -4362,11 +4411,11 @@ export class ContainerRuntime
4362
4411
  return this.pendingStateManager.pendingMessagesCount + this.outbox.messageCount;
4363
4412
  }
4364
4413
 
4365
- private hasPendingMessages() {
4414
+ private hasPendingMessages(): boolean {
4366
4415
  return this.pendingMessagesCount !== 0;
4367
4416
  }
4368
4417
 
4369
- private updateDocumentDirtyState(dirty: boolean) {
4418
+ private updateDocumentDirtyState(dirty: boolean): void {
4370
4419
  if (this.attachState !== AttachState.Attached) {
4371
4420
  assert(dirty, 0x3d2 /* Non-attached container is dirty */);
4372
4421
  } else {
@@ -4392,9 +4441,12 @@ export class ContainerRuntime
4392
4441
  | ContainerMessageType.FluidDataStoreOp
4393
4442
  | ContainerMessageType.Alias
4394
4443
  | ContainerMessageType.Attach,
4444
+ // TODO: better typing
4445
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
4395
4446
  contents: any,
4396
4447
  localOpMetadata: unknown = undefined,
4397
4448
  ): void {
4449
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
4398
4450
  this.submit({ type, contents }, localOpMetadata);
4399
4451
  }
4400
4452
 
@@ -4516,13 +4568,13 @@ export class ContainerRuntime
4516
4568
  }
4517
4569
  }
4518
4570
 
4519
- private scheduleFlush() {
4571
+ private scheduleFlush(): void {
4520
4572
  if (this.flushTaskExists) {
4521
4573
  return;
4522
4574
  }
4523
4575
 
4524
4576
  this.flushTaskExists = true;
4525
- const flush = () => {
4577
+ const flush = (): void => {
4526
4578
  this.flushTaskExists = false;
4527
4579
  try {
4528
4580
  this.flush();
@@ -4556,7 +4608,10 @@ export class ContainerRuntime
4556
4608
  }
4557
4609
  }
4558
4610
 
4559
- private submitSummaryMessage(contents: ISummaryContent, referenceSequenceNumber: number) {
4611
+ private submitSummaryMessage(
4612
+ contents: ISummaryContent,
4613
+ referenceSequenceNumber: number,
4614
+ ): number {
4560
4615
  this.verifyNotClosed();
4561
4616
  assert(
4562
4617
  this.connected,
@@ -4576,7 +4631,7 @@ export class ContainerRuntime
4576
4631
  * Throw an error if the runtime is closed. Methods that are expected to potentially
4577
4632
  * be called after dispose due to asynchrony should not call this.
4578
4633
  */
4579
- private verifyNotClosed() {
4634
+ private verifyNotClosed(): void {
4580
4635
  if (this._disposed) {
4581
4636
  throw new Error("Runtime is closed");
4582
4637
  }
@@ -4588,7 +4643,7 @@ export class ContainerRuntime
4588
4643
  * @remarks - If the "Offline Load" feature is enabled, the batchId is included in the resubmitted messages,
4589
4644
  * for correlation to detect container forking.
4590
4645
  */
4591
- private reSubmitBatch(batch: PendingMessageResubmitData[], batchId: BatchId) {
4646
+ private reSubmitBatch(batch: PendingMessageResubmitData[], batchId: BatchId): void {
4592
4647
  this.orderSequentially(() => {
4593
4648
  for (const message of batch) {
4594
4649
  this.reSubmit(message);
@@ -4600,7 +4655,7 @@ export class ContainerRuntime
4600
4655
  this.flush(this.offlineEnabled ? batchId : undefined);
4601
4656
  }
4602
4657
 
4603
- private reSubmit(message: PendingMessageResubmitData) {
4658
+ private reSubmit(message: PendingMessageResubmitData): void {
4604
4659
  // Need to parse from string for back-compat
4605
4660
  const containerRuntimeMessage = this.parseLocalOpContent(message.content);
4606
4661
  this.reSubmitCore(containerRuntimeMessage, message.localOpMetadata, message.opMetadata);
@@ -4617,7 +4672,7 @@ export class ContainerRuntime
4617
4672
  message: LocalContainerRuntimeMessage,
4618
4673
  localOpMetadata: unknown,
4619
4674
  opMetadata: Record<string, unknown> | undefined,
4620
- ) {
4675
+ ): void {
4621
4676
  assert(
4622
4677
  !this.isSummarizerClient,
4623
4678
  0x8f2 /* Summarizer never reconnects so should never resubmit */,
@@ -4662,7 +4717,7 @@ export class ContainerRuntime
4662
4717
  }
4663
4718
  }
4664
4719
 
4665
- private rollback(content: string | undefined, localOpMetadata: unknown) {
4720
+ private rollback(content: string | undefined, localOpMetadata: unknown): void {
4666
4721
  // Need to parse from string for back-compat
4667
4722
  const { type, contents } = this.parseLocalOpContent(content);
4668
4723
  switch (type) {
@@ -4676,8 +4731,10 @@ export class ContainerRuntime
4676
4731
  }
4677
4732
  }
4678
4733
 
4679
- /** Implementation of ISummarizerInternalsProvider.refreshLatestSummaryAck */
4680
- public async refreshLatestSummaryAck(options: IRefreshSummaryAckOptions) {
4734
+ /**
4735
+ * Implementation of ISummarizerInternalsProvider.refreshLatestSummaryAck
4736
+ */
4737
+ public async refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void> {
4681
4738
  const { proposalHandle, ackHandle, summaryRefSeq, summaryLogger } = options;
4682
4739
  // proposalHandle is always passed from RunningSummarizer.
4683
4740
  assert(proposalHandle !== undefined, 0x766 /* proposalHandle should be available */);
@@ -4734,7 +4791,7 @@ export class ContainerRuntime
4734
4791
  targetRefSeq: number,
4735
4792
  targetAckHandle: string,
4736
4793
  logger: ITelemetryLoggerExt,
4737
- ) {
4794
+ ): Promise<void> {
4738
4795
  const fetchedSnapshotRefSeq = await PerformanceEvent.timedExecAsync(
4739
4796
  logger,
4740
4797
  { eventName: "RefreshLatestSummaryAckFetch" },
@@ -4798,7 +4855,8 @@ export class ContainerRuntime
4798
4855
  }
4799
4856
 
4800
4857
  props.getSnapshotDuration = trace.trace().duration;
4801
- const readAndParseBlob = async <T>(id: string) => readAndParse<T>(this.storage, id);
4858
+ const readAndParseBlob = async <T>(id: string): Promise<T> =>
4859
+ readAndParse<T>(this.storage, id);
4802
4860
  const snapshotRefSeq = await seqFromTree(snapshotTree, readAndParseBlob);
4803
4861
  props.snapshotRefSeq = snapshotRefSeq;
4804
4862
  props.newerSnapshotPresent = snapshotRefSeq >= targetRefSeq;
@@ -4851,7 +4909,7 @@ export class ContainerRuntime
4851
4909
  const logAndReturnPendingState = (
4852
4910
  event: PerformanceEvent,
4853
4911
  pendingState?: IPendingRuntimeState,
4854
- ) => {
4912
+ ): IPendingRuntimeState | undefined => {
4855
4913
  event.end({
4856
4914
  attachmentBlobsSize: Object.keys(pendingState?.pendingAttachmentBlobs ?? {}).length,
4857
4915
  pendingOpsSize: pendingState?.pending?.pendingStates.length,
@@ -4915,7 +4973,7 @@ export class ContainerRuntime
4915
4973
 
4916
4974
  private validateSummaryHeuristicConfiguration(
4917
4975
  configuration: ISummaryConfigurationHeuristics,
4918
- ) {
4976
+ ): void {
4919
4977
  // eslint-disable-next-line no-restricted-syntax
4920
4978
  for (const prop in configuration) {
4921
4979
  if (typeof configuration[prop] === "number" && configuration[prop] < 0) {