@fluidframework/container-runtime 2.0.0-dev-rc.2.0.0.246488 → 2.0.0-dev-rc.3.0.0.253463

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 (544) hide show
  1. package/api-report/container-runtime.api.md +109 -55
  2. package/dist/batchTracker.d.ts +1 -1
  3. package/dist/batchTracker.d.ts.map +1 -1
  4. package/dist/batchTracker.js +4 -4
  5. package/dist/batchTracker.js.map +1 -1
  6. package/dist/blobManager.d.ts +33 -25
  7. package/dist/blobManager.d.ts.map +1 -1
  8. package/dist/blobManager.js +82 -100
  9. package/dist/blobManager.js.map +1 -1
  10. package/dist/channelCollection.d.ts +7 -6
  11. package/dist/channelCollection.d.ts.map +1 -1
  12. package/dist/channelCollection.js +110 -77
  13. package/dist/channelCollection.js.map +1 -1
  14. package/dist/connectionTelemetry.d.ts +3 -3
  15. package/dist/connectionTelemetry.d.ts.map +1 -1
  16. package/dist/connectionTelemetry.js +17 -17
  17. package/dist/connectionTelemetry.js.map +1 -1
  18. package/dist/container-runtime-alpha.d.ts +263 -41
  19. package/dist/container-runtime-beta.d.ts +44 -30
  20. package/dist/container-runtime-public.d.ts +44 -30
  21. package/dist/container-runtime-untrimmed.d.ts +265 -56
  22. package/dist/containerHandleContext.d.ts.map +1 -1
  23. package/dist/containerHandleContext.js +2 -2
  24. package/dist/containerHandleContext.js.map +1 -1
  25. package/dist/containerRuntime.d.ts +40 -30
  26. package/dist/containerRuntime.d.ts.map +1 -1
  27. package/dist/containerRuntime.js +376 -255
  28. package/dist/containerRuntime.js.map +1 -1
  29. package/dist/dataStore.d.ts +1 -1
  30. package/dist/dataStore.d.ts.map +1 -1
  31. package/dist/dataStore.js +7 -7
  32. package/dist/dataStore.js.map +1 -1
  33. package/dist/dataStoreContext.d.ts +9 -9
  34. package/dist/dataStoreContext.d.ts.map +1 -1
  35. package/dist/dataStoreContext.js +74 -74
  36. package/dist/dataStoreContext.js.map +1 -1
  37. package/dist/dataStoreContexts.d.ts.map +1 -1
  38. package/dist/dataStoreContexts.js +11 -11
  39. package/dist/dataStoreContexts.js.map +1 -1
  40. package/dist/dataStoreRegistry.d.ts +1 -1
  41. package/dist/dataStoreRegistry.d.ts.map +1 -1
  42. package/dist/dataStoreRegistry.js +2 -2
  43. package/dist/dataStoreRegistry.js.map +1 -1
  44. package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
  45. package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
  46. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  47. package/dist/deltaScheduler.d.ts +1 -1
  48. package/dist/deltaScheduler.d.ts.map +1 -1
  49. package/dist/deltaScheduler.js +6 -6
  50. package/dist/deltaScheduler.js.map +1 -1
  51. package/dist/error.d.ts +1 -1
  52. package/dist/error.d.ts.map +1 -1
  53. package/dist/error.js +4 -4
  54. package/dist/error.js.map +1 -1
  55. package/dist/gc/garbageCollection.d.ts +3 -2
  56. package/dist/gc/garbageCollection.d.ts.map +1 -1
  57. package/dist/gc/garbageCollection.js +21 -21
  58. package/dist/gc/garbageCollection.js.map +1 -1
  59. package/dist/gc/gcConfigs.d.ts +2 -2
  60. package/dist/gc/gcConfigs.d.ts.map +1 -1
  61. package/dist/gc/gcConfigs.js +4 -5
  62. package/dist/gc/gcConfigs.js.map +1 -1
  63. package/dist/gc/gcDefinitions.d.ts +4 -3
  64. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  65. package/dist/gc/gcDefinitions.js.map +1 -1
  66. package/dist/gc/gcHelpers.d.ts +5 -1
  67. package/dist/gc/gcHelpers.d.ts.map +1 -1
  68. package/dist/gc/gcHelpers.js +21 -12
  69. package/dist/gc/gcHelpers.js.map +1 -1
  70. package/dist/gc/gcSummaryStateTracker.d.ts +2 -2
  71. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  72. package/dist/gc/gcSummaryStateTracker.js +11 -11
  73. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  74. package/dist/gc/gcTelemetry.d.ts +2 -1
  75. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  76. package/dist/gc/gcTelemetry.js +11 -9
  77. package/dist/gc/gcTelemetry.js.map +1 -1
  78. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  79. package/dist/gc/gcUnreferencedStateTracker.js +6 -6
  80. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  81. package/dist/gc/index.d.ts +1 -1
  82. package/dist/gc/index.d.ts.map +1 -1
  83. package/dist/gc/index.js +2 -1
  84. package/dist/gc/index.js.map +1 -1
  85. package/dist/index.d.ts +2 -2
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +4 -2
  88. package/dist/index.js.map +1 -1
  89. package/dist/messageTypes.d.ts +11 -5
  90. package/dist/messageTypes.d.ts.map +1 -1
  91. package/dist/messageTypes.js +4 -0
  92. package/dist/messageTypes.js.map +1 -1
  93. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  94. package/dist/opLifecycle/batchManager.js.map +1 -1
  95. package/dist/opLifecycle/definitions.d.ts +2 -20
  96. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  97. package/dist/opLifecycle/definitions.js.map +1 -1
  98. package/dist/opLifecycle/index.d.ts +3 -3
  99. package/dist/opLifecycle/index.d.ts.map +1 -1
  100. package/dist/opLifecycle/index.js +3 -1
  101. package/dist/opLifecycle/index.js.map +1 -1
  102. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  103. package/dist/opLifecycle/opCompressor.js +5 -6
  104. package/dist/opLifecycle/opCompressor.js.map +1 -1
  105. package/dist/opLifecycle/opDecompressor.d.ts +15 -4
  106. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  107. package/dist/opLifecycle/opDecompressor.js +62 -63
  108. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  109. package/dist/opLifecycle/opGroupingManager.d.ts +2 -1
  110. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  111. package/dist/opLifecycle/opGroupingManager.js +14 -16
  112. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  113. package/dist/opLifecycle/opSplitter.d.ts +12 -4
  114. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  115. package/dist/opLifecycle/opSplitter.js +63 -53
  116. package/dist/opLifecycle/opSplitter.js.map +1 -1
  117. package/dist/opLifecycle/outbox.d.ts +2 -1
  118. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  119. package/dist/opLifecycle/outbox.js +19 -24
  120. package/dist/opLifecycle/outbox.js.map +1 -1
  121. package/dist/opLifecycle/remoteMessageProcessor.d.ts +8 -0
  122. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  123. package/dist/opLifecycle/remoteMessageProcessor.js +36 -35
  124. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  125. package/dist/packageVersion.d.ts +1 -1
  126. package/dist/packageVersion.js +1 -1
  127. package/dist/packageVersion.js.map +1 -1
  128. package/dist/pendingStateManager.d.ts +1 -1
  129. package/dist/pendingStateManager.d.ts.map +1 -1
  130. package/dist/pendingStateManager.js +18 -18
  131. package/dist/pendingStateManager.js.map +1 -1
  132. package/dist/scheduleManager.d.ts +1 -1
  133. package/dist/scheduleManager.d.ts.map +1 -1
  134. package/dist/scheduleManager.js +24 -24
  135. package/dist/scheduleManager.js.map +1 -1
  136. package/dist/storageServiceWithAttachBlobs.d.ts +2 -2
  137. package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -1
  138. package/dist/storageServiceWithAttachBlobs.js +2 -2
  139. package/dist/storageServiceWithAttachBlobs.js.map +1 -1
  140. package/dist/summary/documentSchema.d.ts +209 -0
  141. package/dist/summary/documentSchema.d.ts.map +1 -0
  142. package/dist/summary/documentSchema.js +382 -0
  143. package/dist/summary/documentSchema.js.map +1 -0
  144. package/dist/summary/index.d.ts +2 -1
  145. package/dist/summary/index.d.ts.map +1 -1
  146. package/dist/summary/index.js +4 -1
  147. package/dist/summary/index.js.map +1 -1
  148. package/dist/summary/orderedClientElection.d.ts +2 -2
  149. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  150. package/dist/summary/orderedClientElection.js +8 -7
  151. package/dist/summary/orderedClientElection.js.map +1 -1
  152. package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -1
  153. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  154. package/dist/summary/runWhileConnectedCoordinator.js +3 -3
  155. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  156. package/dist/summary/runningSummarizer.d.ts +3 -3
  157. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  158. package/dist/summary/runningSummarizer.js +16 -16
  159. package/dist/summary/runningSummarizer.js.map +1 -1
  160. package/dist/summary/summarizer.d.ts +3 -2
  161. package/dist/summary/summarizer.d.ts.map +1 -1
  162. package/dist/summary/summarizer.js +13 -13
  163. package/dist/summary/summarizer.js.map +1 -1
  164. package/dist/summary/summarizerClientElection.d.ts +2 -2
  165. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  166. package/dist/summary/summarizerClientElection.js.map +1 -1
  167. package/dist/summary/summarizerHeuristics.d.ts +1 -1
  168. package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
  169. package/dist/summary/summarizerHeuristics.js +2 -2
  170. package/dist/summary/summarizerHeuristics.js.map +1 -1
  171. package/dist/summary/summarizerNode/summarizerNode.d.ts +3 -2
  172. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  173. package/dist/summary/summarizerNode/summarizerNode.js +28 -28
  174. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  175. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
  176. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  177. package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
  178. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  179. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -1
  180. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  181. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +14 -14
  182. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  183. package/dist/summary/summarizerTypes.d.ts +5 -3
  184. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  185. package/dist/summary/summarizerTypes.js.map +1 -1
  186. package/dist/summary/summaryCollection.d.ts +2 -2
  187. package/dist/summary/summaryCollection.d.ts.map +1 -1
  188. package/dist/summary/summaryCollection.js +7 -7
  189. package/dist/summary/summaryCollection.js.map +1 -1
  190. package/dist/summary/summaryFormat.d.ts +6 -17
  191. package/dist/summary/summaryFormat.d.ts.map +1 -1
  192. package/dist/summary/summaryFormat.js +8 -8
  193. package/dist/summary/summaryFormat.js.map +1 -1
  194. package/dist/summary/summaryGenerator.d.ts +4 -3
  195. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  196. package/dist/summary/summaryGenerator.js +17 -17
  197. package/dist/summary/summaryGenerator.js.map +1 -1
  198. package/dist/summary/summaryManager.d.ts +1 -1
  199. package/dist/summary/summaryManager.d.ts.map +1 -1
  200. package/dist/summary/summaryManager.js +15 -14
  201. package/dist/summary/summaryManager.js.map +1 -1
  202. package/lib/batchTracker.d.ts +1 -1
  203. package/lib/batchTracker.d.ts.map +1 -1
  204. package/lib/batchTracker.js +2 -2
  205. package/lib/batchTracker.js.map +1 -1
  206. package/lib/blobManager.d.ts +33 -25
  207. package/lib/blobManager.d.ts.map +1 -1
  208. package/lib/blobManager.js +48 -66
  209. package/lib/blobManager.js.map +1 -1
  210. package/lib/channelCollection.d.ts +7 -6
  211. package/lib/channelCollection.d.ts.map +1 -1
  212. package/lib/channelCollection.js +47 -14
  213. package/lib/channelCollection.js.map +1 -1
  214. package/lib/connectionTelemetry.d.ts +3 -3
  215. package/lib/connectionTelemetry.d.ts.map +1 -1
  216. package/lib/connectionTelemetry.js +3 -3
  217. package/lib/connectionTelemetry.js.map +1 -1
  218. package/lib/container-runtime-alpha.d.ts +263 -41
  219. package/lib/container-runtime-beta.d.ts +44 -30
  220. package/lib/container-runtime-public.d.ts +44 -30
  221. package/lib/container-runtime-untrimmed.d.ts +265 -56
  222. package/lib/containerHandleContext.d.ts.map +1 -1
  223. package/lib/containerHandleContext.js +1 -1
  224. package/lib/containerHandleContext.js.map +1 -1
  225. package/lib/containerRuntime.d.ts +40 -30
  226. package/lib/containerRuntime.d.ts.map +1 -1
  227. package/lib/containerRuntime.js +224 -101
  228. package/lib/containerRuntime.js.map +1 -1
  229. package/lib/dataStore.d.ts +1 -1
  230. package/lib/dataStore.d.ts.map +1 -1
  231. package/lib/dataStore.js +2 -2
  232. package/lib/dataStore.js.map +1 -1
  233. package/lib/dataStoreContext.d.ts +9 -9
  234. package/lib/dataStoreContext.d.ts.map +1 -1
  235. package/lib/dataStoreContext.js +8 -8
  236. package/lib/dataStoreContext.js.map +1 -1
  237. package/lib/dataStoreContexts.d.ts.map +1 -1
  238. package/lib/dataStoreContexts.js +2 -2
  239. package/lib/dataStoreContexts.js.map +1 -1
  240. package/lib/dataStoreRegistry.d.ts +1 -1
  241. package/lib/dataStoreRegistry.d.ts.map +1 -1
  242. package/lib/dataStoreRegistry.js +1 -1
  243. package/lib/dataStoreRegistry.js.map +1 -1
  244. package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
  245. package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
  246. package/lib/deltaManagerSummarizerProxy.js.map +1 -1
  247. package/lib/deltaScheduler.d.ts +1 -1
  248. package/lib/deltaScheduler.d.ts.map +1 -1
  249. package/lib/deltaScheduler.js +1 -1
  250. package/lib/deltaScheduler.js.map +1 -1
  251. package/lib/error.d.ts +1 -1
  252. package/lib/error.d.ts.map +1 -1
  253. package/lib/error.js +2 -2
  254. package/lib/error.js.map +1 -1
  255. package/lib/gc/garbageCollection.d.ts +3 -2
  256. package/lib/gc/garbageCollection.d.ts.map +1 -1
  257. package/lib/gc/garbageCollection.js +6 -6
  258. package/lib/gc/garbageCollection.js.map +1 -1
  259. package/lib/gc/gcConfigs.d.ts +2 -2
  260. package/lib/gc/gcConfigs.d.ts.map +1 -1
  261. package/lib/gc/gcConfigs.js +4 -5
  262. package/lib/gc/gcConfigs.js.map +1 -1
  263. package/lib/gc/gcDefinitions.d.ts +4 -3
  264. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  265. package/lib/gc/gcDefinitions.js.map +1 -1
  266. package/lib/gc/gcHelpers.d.ts +5 -1
  267. package/lib/gc/gcHelpers.d.ts.map +1 -1
  268. package/lib/gc/gcHelpers.js +10 -2
  269. package/lib/gc/gcHelpers.js.map +1 -1
  270. package/lib/gc/gcSummaryStateTracker.d.ts +2 -2
  271. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  272. package/lib/gc/gcSummaryStateTracker.js +2 -2
  273. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  274. package/lib/gc/gcTelemetry.d.ts +2 -1
  275. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  276. package/lib/gc/gcTelemetry.js +4 -2
  277. package/lib/gc/gcTelemetry.js.map +1 -1
  278. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  279. package/lib/gc/gcUnreferencedStateTracker.js +2 -2
  280. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  281. package/lib/gc/index.d.ts +1 -1
  282. package/lib/gc/index.d.ts.map +1 -1
  283. package/lib/gc/index.js +1 -1
  284. package/lib/gc/index.js.map +1 -1
  285. package/lib/index.d.ts +2 -2
  286. package/lib/index.d.ts.map +1 -1
  287. package/lib/index.js +2 -2
  288. package/lib/index.js.map +1 -1
  289. package/lib/messageTypes.d.ts +11 -5
  290. package/lib/messageTypes.d.ts.map +1 -1
  291. package/lib/messageTypes.js +4 -0
  292. package/lib/messageTypes.js.map +1 -1
  293. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  294. package/lib/opLifecycle/batchManager.js.map +1 -1
  295. package/lib/opLifecycle/definitions.d.ts +2 -20
  296. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  297. package/lib/opLifecycle/definitions.js.map +1 -1
  298. package/lib/opLifecycle/index.d.ts +3 -3
  299. package/lib/opLifecycle/index.d.ts.map +1 -1
  300. package/lib/opLifecycle/index.js +2 -2
  301. package/lib/opLifecycle/index.js.map +1 -1
  302. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  303. package/lib/opLifecycle/opCompressor.js +2 -3
  304. package/lib/opLifecycle/opCompressor.js.map +1 -1
  305. package/lib/opLifecycle/opDecompressor.d.ts +15 -4
  306. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  307. package/lib/opLifecycle/opDecompressor.js +61 -62
  308. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  309. package/lib/opLifecycle/opGroupingManager.d.ts +2 -1
  310. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  311. package/lib/opLifecycle/opGroupingManager.js +9 -12
  312. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  313. package/lib/opLifecycle/opSplitter.d.ts +12 -4
  314. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  315. package/lib/opLifecycle/opSplitter.js +47 -38
  316. package/lib/opLifecycle/opSplitter.js.map +1 -1
  317. package/lib/opLifecycle/outbox.d.ts +2 -1
  318. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  319. package/lib/opLifecycle/outbox.js +8 -13
  320. package/lib/opLifecycle/outbox.js.map +1 -1
  321. package/lib/opLifecycle/remoteMessageProcessor.d.ts +8 -0
  322. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  323. package/lib/opLifecycle/remoteMessageProcessor.js +36 -35
  324. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  325. package/lib/packageVersion.d.ts +1 -1
  326. package/lib/packageVersion.js +1 -1
  327. package/lib/packageVersion.js.map +1 -1
  328. package/lib/pendingStateManager.d.ts +1 -1
  329. package/lib/pendingStateManager.d.ts.map +1 -1
  330. package/lib/pendingStateManager.js +2 -2
  331. package/lib/pendingStateManager.js.map +1 -1
  332. package/lib/scheduleManager.d.ts +1 -1
  333. package/lib/scheduleManager.d.ts.map +1 -1
  334. package/lib/scheduleManager.js +3 -3
  335. package/lib/scheduleManager.js.map +1 -1
  336. package/lib/storageServiceWithAttachBlobs.d.ts +2 -2
  337. package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -1
  338. package/lib/storageServiceWithAttachBlobs.js +1 -1
  339. package/lib/storageServiceWithAttachBlobs.js.map +1 -1
  340. package/lib/summary/documentSchema.d.ts +209 -0
  341. package/lib/summary/documentSchema.d.ts.map +1 -0
  342. package/lib/summary/documentSchema.js +378 -0
  343. package/lib/summary/documentSchema.js.map +1 -0
  344. package/lib/summary/index.d.ts +2 -1
  345. package/lib/summary/index.d.ts.map +1 -1
  346. package/lib/summary/index.js +1 -0
  347. package/lib/summary/index.js.map +1 -1
  348. package/lib/summary/orderedClientElection.d.ts +2 -2
  349. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  350. package/lib/summary/orderedClientElection.js +3 -2
  351. package/lib/summary/orderedClientElection.js.map +1 -1
  352. package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -1
  353. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  354. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  355. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  356. package/lib/summary/runningSummarizer.d.ts +3 -3
  357. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  358. package/lib/summary/runningSummarizer.js +3 -3
  359. package/lib/summary/runningSummarizer.js.map +1 -1
  360. package/lib/summary/summarizer.d.ts +3 -2
  361. package/lib/summary/summarizer.d.ts.map +1 -1
  362. package/lib/summary/summarizer.js +3 -3
  363. package/lib/summary/summarizer.js.map +1 -1
  364. package/lib/summary/summarizerClientElection.d.ts +2 -2
  365. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  366. package/lib/summary/summarizerClientElection.js.map +1 -1
  367. package/lib/summary/summarizerHeuristics.d.ts +1 -1
  368. package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
  369. package/lib/summary/summarizerHeuristics.js +1 -1
  370. package/lib/summary/summarizerHeuristics.js.map +1 -1
  371. package/lib/summary/summarizerNode/summarizerNode.d.ts +3 -2
  372. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  373. package/lib/summary/summarizerNode/summarizerNode.js +5 -5
  374. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  375. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
  376. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  377. package/lib/summary/summarizerNode/summarizerNodeUtils.js +1 -1
  378. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  379. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -1
  380. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  381. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
  382. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  383. package/lib/summary/summarizerTypes.d.ts +5 -3
  384. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  385. package/lib/summary/summarizerTypes.js.map +1 -1
  386. package/lib/summary/summaryCollection.d.ts +2 -2
  387. package/lib/summary/summaryCollection.d.ts.map +1 -1
  388. package/lib/summary/summaryCollection.js +1 -1
  389. package/lib/summary/summaryCollection.js.map +1 -1
  390. package/lib/summary/summaryFormat.d.ts +6 -17
  391. package/lib/summary/summaryFormat.d.ts.map +1 -1
  392. package/lib/summary/summaryFormat.js +3 -3
  393. package/lib/summary/summaryFormat.js.map +1 -1
  394. package/lib/summary/summaryGenerator.d.ts +4 -3
  395. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  396. package/lib/summary/summaryGenerator.js +4 -4
  397. package/lib/summary/summaryGenerator.js.map +1 -1
  398. package/lib/summary/summaryManager.d.ts +1 -1
  399. package/lib/summary/summaryManager.d.ts.map +1 -1
  400. package/lib/summary/summaryManager.js +9 -8
  401. package/lib/summary/summaryManager.js.map +1 -1
  402. package/lib/tsdoc-metadata.json +11 -0
  403. package/package.json +34 -32
  404. package/src/batchTracker.ts +4 -3
  405. package/src/blobManager.ts +100 -69
  406. package/src/channelCollection.ts +86 -43
  407. package/src/connectionTelemetry.ts +12 -12
  408. package/src/containerHandleContext.ts +3 -2
  409. package/src/containerRuntime.ts +419 -232
  410. package/src/dataStore.ts +5 -3
  411. package/src/dataStoreContext.ts +32 -29
  412. package/src/dataStoreContexts.ts +4 -2
  413. package/src/dataStoreRegistry.ts +2 -2
  414. package/src/deltaManagerSummarizerProxy.ts +1 -1
  415. package/src/deltaScheduler.ts +2 -1
  416. package/src/error.ts +2 -2
  417. package/src/gc/garbageCollection.ts +19 -18
  418. package/src/gc/gcConfigs.ts +15 -18
  419. package/src/gc/gcDefinitions.ts +6 -6
  420. package/src/gc/gcHelpers.ts +22 -5
  421. package/src/gc/gcSummaryStateTracker.ts +7 -5
  422. package/src/gc/gcTelemetry.ts +13 -7
  423. package/src/gc/gcUnreferencedStateTracker.ts +3 -2
  424. package/src/gc/index.ts +1 -0
  425. package/src/index.ts +8 -1
  426. package/src/messageTypes.ts +20 -6
  427. package/src/opLifecycle/README.md +89 -0
  428. package/src/opLifecycle/batchManager.ts +1 -0
  429. package/src/opLifecycle/definitions.ts +3 -21
  430. package/src/opLifecycle/index.ts +3 -9
  431. package/src/opLifecycle/opCompressor.ts +6 -5
  432. package/src/opLifecycle/opDecompressor.ts +84 -100
  433. package/src/opLifecycle/opGroupingManager.ts +12 -14
  434. package/src/opLifecycle/opSplitter.ts +76 -48
  435. package/src/opLifecycle/outbox.ts +17 -32
  436. package/src/opLifecycle/remoteMessageProcessor.ts +43 -59
  437. package/src/packageVersion.ts +1 -1
  438. package/src/pendingStateManager.ts +6 -6
  439. package/src/scheduleManager.ts +9 -8
  440. package/src/storageServiceWithAttachBlobs.ts +2 -2
  441. package/src/summary/documentSchema.ts +612 -0
  442. package/src/summary/index.ts +10 -1
  443. package/src/summary/orderedClientElection.ts +6 -7
  444. package/src/summary/runWhileConnectedCoordinator.ts +3 -2
  445. package/src/summary/runningSummarizer.ts +22 -20
  446. package/src/summary/summarizer.ts +17 -15
  447. package/src/summary/summarizerClientElection.ts +3 -2
  448. package/src/summary/summarizerHeuristics.ts +4 -2
  449. package/src/summary/summarizerNode/summarizerNode.ts +20 -18
  450. package/src/summary/summarizerNode/summarizerNodeUtils.ts +3 -2
  451. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +16 -8
  452. package/src/summary/summarizerTypes.ts +7 -3
  453. package/src/summary/summaryCollection.ts +3 -3
  454. package/src/summary/summaryFormat.ts +14 -26
  455. package/src/summary/summaryGenerator.ts +12 -15
  456. package/src/summary/summaryManager.ts +16 -13
  457. package/lib/test/batchTracker.spec.js +0 -88
  458. package/lib/test/batchTracker.spec.js.map +0 -1
  459. package/lib/test/blobManager.spec.js +0 -835
  460. package/lib/test/blobManager.spec.js.map +0 -1
  461. package/lib/test/channelCollection.spec.js +0 -138
  462. package/lib/test/channelCollection.spec.js.map +0 -1
  463. package/lib/test/containerRuntime.spec.js +0 -1748
  464. package/lib/test/containerRuntime.spec.js.map +0 -1
  465. package/lib/test/dataStoreContext.spec.js +0 -771
  466. package/lib/test/dataStoreContext.spec.js.map +0 -1
  467. package/lib/test/dataStoreCreation.spec.js +0 -303
  468. package/lib/test/dataStoreCreation.spec.js.map +0 -1
  469. package/lib/test/dataStoreRegistry.spec.js +0 -26
  470. package/lib/test/dataStoreRegistry.spec.js.map +0 -1
  471. package/lib/test/fuzz/fuzzUtils.js +0 -66
  472. package/lib/test/fuzz/fuzzUtils.js.map +0 -1
  473. package/lib/test/fuzz/summarizer.fuzz.spec.js +0 -31
  474. package/lib/test/fuzz/summarizer.fuzz.spec.js.map +0 -1
  475. package/lib/test/fuzz/summarizerFuzzMocks.js +0 -162
  476. package/lib/test/fuzz/summarizerFuzzMocks.js.map +0 -1
  477. package/lib/test/fuzz/summarizerFuzzSuite.js +0 -106
  478. package/lib/test/fuzz/summarizerFuzzSuite.js.map +0 -1
  479. package/lib/test/gc/garbageCollection.spec.js +0 -1464
  480. package/lib/test/gc/garbageCollection.spec.js.map +0 -1
  481. package/lib/test/gc/gcConfigs.spec.js +0 -689
  482. package/lib/test/gc/gcConfigs.spec.js.map +0 -1
  483. package/lib/test/gc/gcHelpers.spec.js +0 -110
  484. package/lib/test/gc/gcHelpers.spec.js.map +0 -1
  485. package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js +0 -68
  486. package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js.map +0 -1
  487. package/lib/test/gc/gcStats.spec.js +0 -390
  488. package/lib/test/gc/gcStats.spec.js.map +0 -1
  489. package/lib/test/gc/gcSummaryStateTracker.spec.js +0 -228
  490. package/lib/test/gc/gcSummaryStateTracker.spec.js.map +0 -1
  491. package/lib/test/gc/gcTelemetry.spec.js +0 -530
  492. package/lib/test/gc/gcTelemetry.spec.js.map +0 -1
  493. package/lib/test/gc/gcUnitTestHelpers.js +0 -29
  494. package/lib/test/gc/gcUnitTestHelpers.js.map +0 -1
  495. package/lib/test/gc/gcUnreferencedStateTracker.spec.js +0 -192
  496. package/lib/test/gc/gcUnreferencedStateTracker.spec.js.map +0 -1
  497. package/lib/test/getPendingBlobs.spec.js +0 -193
  498. package/lib/test/getPendingBlobs.spec.js.map +0 -1
  499. package/lib/test/hardwareStats.spec.js +0 -93
  500. package/lib/test/hardwareStats.spec.js.map +0 -1
  501. package/lib/test/index.js +0 -6
  502. package/lib/test/index.js.map +0 -1
  503. package/lib/test/opLifecycle/OpGroupingManager.spec.js +0 -225
  504. package/lib/test/opLifecycle/OpGroupingManager.spec.js.map +0 -1
  505. package/lib/test/opLifecycle/batchManager.spec.js +0 -189
  506. package/lib/test/opLifecycle/batchManager.spec.js.map +0 -1
  507. package/lib/test/opLifecycle/opCompressor.spec.js +0 -74
  508. package/lib/test/opLifecycle/opCompressor.spec.js.map +0 -1
  509. package/lib/test/opLifecycle/opDecompressor.spec.js +0 -218
  510. package/lib/test/opLifecycle/opDecompressor.spec.js.map +0 -1
  511. package/lib/test/opLifecycle/opSplitter.spec.js +0 -272
  512. package/lib/test/opLifecycle/opSplitter.spec.js.map +0 -1
  513. package/lib/test/opLifecycle/outbox.spec.js +0 -675
  514. package/lib/test/opLifecycle/outbox.spec.js.map +0 -1
  515. package/lib/test/opLifecycle/remoteMessageProcessor.spec.js +0 -196
  516. package/lib/test/opLifecycle/remoteMessageProcessor.spec.js.map +0 -1
  517. package/lib/test/pendingStateManager.spec.js +0 -329
  518. package/lib/test/pendingStateManager.spec.js.map +0 -1
  519. package/lib/test/scheduleManager.spec.js +0 -270
  520. package/lib/test/scheduleManager.spec.js.map +0 -1
  521. package/lib/test/summarizerNode.spec.js +0 -326
  522. package/lib/test/summarizerNode.spec.js.map +0 -1
  523. package/lib/test/summarizerNodeWithGc.spec.js +0 -318
  524. package/lib/test/summarizerNodeWithGc.spec.js.map +0 -1
  525. package/lib/test/summary/orderedClientElection.spec.js +0 -535
  526. package/lib/test/summary/orderedClientElection.spec.js.map +0 -1
  527. package/lib/test/summary/runningSummarizer.spec.js +0 -1349
  528. package/lib/test/summary/runningSummarizer.spec.js.map +0 -1
  529. package/lib/test/summary/summarizer.spec.js +0 -29
  530. package/lib/test/summary/summarizer.spec.js.map +0 -1
  531. package/lib/test/summary/summarizerClientElection.spec.js +0 -436
  532. package/lib/test/summary/summarizerClientElection.spec.js.map +0 -1
  533. package/lib/test/summary/summarizerHeuristics.spec.js +0 -289
  534. package/lib/test/summary/summarizerHeuristics.spec.js.map +0 -1
  535. package/lib/test/summary/summaryCollection.spec.js +0 -200
  536. package/lib/test/summary/summaryCollection.spec.js.map +0 -1
  537. package/lib/test/summary/summaryManager.spec.js +0 -430
  538. package/lib/test/summary/summaryManager.spec.js.map +0 -1
  539. package/lib/test/summary/testQuorumClients.js +0 -34
  540. package/lib/test/summary/testQuorumClients.js.map +0 -1
  541. package/lib/test/throttler.spec.js +0 -175
  542. package/lib/test/throttler.spec.js.map +0 -1
  543. package/lib/test/types/validateContainerRuntimePrevious.generated.js +0 -180
  544. package/lib/test/types/validateContainerRuntimePrevious.generated.js.map +0 -1
@@ -3,60 +3,56 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils";
6
7
  import {
7
- ITelemetryBaseLogger,
8
- FluidObject,
9
- IFluidHandle,
10
- IFluidHandleContext,
11
- IRequest,
12
- IResponse,
13
- IProvideFluidHandleContext,
14
- ISignalEnvelope,
15
- } from "@fluidframework/core-interfaces";
16
- import {
8
+ AttachState,
17
9
  IAudience,
10
+ ICriticalContainerError,
11
+ IDeltaManager,
12
+ } from "@fluidframework/container-definitions";
13
+ import {
18
14
  IBatchMessage,
19
15
  IContainerContext,
20
- IDeltaManager,
21
- IRuntime,
22
- ICriticalContainerError,
23
- AttachState,
16
+ IGetPendingLocalStateProps,
24
17
  ILoader,
18
+ IRuntime,
25
19
  LoaderHeader,
26
- IGetPendingLocalStateProps,
27
- } from "@fluidframework/container-definitions";
20
+ } from "@fluidframework/container-definitions/internal";
28
21
  import {
29
22
  IContainerRuntime,
30
23
  IContainerRuntimeEvents,
31
- } from "@fluidframework/container-runtime-definitions";
32
- import { assert, Deferred, delay, LazyPromise, PromiseCache } from "@fluidframework/core-utils";
33
- import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils";
24
+ } from "@fluidframework/container-runtime-definitions/internal";
34
25
  import {
35
- createChildLogger,
36
- createChildMonitoringContext,
37
- DataCorruptionError,
38
- DataProcessingError,
39
- GenericError,
40
- raiseConnectedEvent,
41
- PerformanceEvent,
42
- TaggedLoggerAdapter,
43
- MonitoringContext,
44
- wrapError,
45
- ITelemetryLoggerExt,
46
- UsageError,
47
- LoggingError,
48
- createSampledLogger,
49
- IEventSampler,
50
- type ITelemetryGenericEventExt,
51
- loggerToMonitoringContext,
52
- } from "@fluidframework/telemetry-utils";
26
+ FluidObject,
27
+ IFluidHandle,
28
+ IFluidHandleContext,
29
+ IProvideFluidHandleContext,
30
+ IRequest,
31
+ IResponse,
32
+ ITelemetryBaseLogger,
33
+ } from "@fluidframework/core-interfaces";
34
+ import { ISignalEnvelope } from "@fluidframework/core-interfaces/internal";
35
+ import {
36
+ assert,
37
+ Deferred,
38
+ LazyPromise,
39
+ PromiseCache,
40
+ delay,
41
+ } from "@fluidframework/core-utils/internal";
53
42
  import {
54
43
  DriverHeader,
55
44
  FetchSource,
56
45
  IDocumentStorageService,
57
46
  type ISnapshot,
58
- } from "@fluidframework/driver-definitions";
59
- import { readAndParse } from "@fluidframework/driver-utils";
47
+ } from "@fluidframework/driver-definitions/internal";
48
+ import { readAndParse } from "@fluidframework/driver-utils/internal";
49
+ import type { IIdCompressor } from "@fluidframework/id-compressor";
50
+ import type {
51
+ IIdCompressorCore,
52
+ IdCreationRange,
53
+ SerializedIdCompressorWithNoSession,
54
+ SerializedIdCompressorWithOngoingSession,
55
+ } from "@fluidframework/id-compressor/internal";
60
56
  import {
61
57
  IClientDetails,
62
58
  IDocumentMessage,
@@ -70,134 +66,155 @@ import {
70
66
  SummaryType,
71
67
  } from "@fluidframework/protocol-definitions";
72
68
  import {
69
+ IGarbageCollectionData,
70
+ IInboundSignalMessage,
71
+ ISummaryTreeWithStats,
72
+ ITelemetryContext,
73
+ } from "@fluidframework/runtime-definitions";
74
+ import {
75
+ CreateChildSummarizerNodeParam,
73
76
  FlushMode,
74
77
  FlushModeExperimental,
75
- gcTreeKey,
76
- InboundAttachMessage,
78
+ IDataStore,
79
+ IEnvelope,
77
80
  IFluidDataStoreContextDetached,
78
81
  IFluidDataStoreRegistry,
79
- IGarbageCollectionData,
80
- IInboundSignalMessage,
81
- NamedFluidDataStoreRegistryEntries,
82
- ISummaryTreeWithStats,
83
82
  ISummarizeInternalResult,
84
- CreateChildSummarizerNodeParam,
83
+ InboundAttachMessage,
84
+ NamedFluidDataStoreRegistryEntries,
85
85
  SummarizeInternalFn,
86
86
  channelsTreeName,
87
- IDataStore,
88
- ITelemetryContext,
89
- IEnvelope,
90
- } from "@fluidframework/runtime-definitions";
91
- import type {
92
- SerializedIdCompressorWithNoSession,
93
- IIdCompressor,
94
- IIdCompressorCore,
95
- SerializedIdCompressorWithOngoingSession,
96
- IdCreationRange,
97
- } from "@fluidframework/id-compressor";
87
+ gcTreeKey,
88
+ } from "@fluidframework/runtime-definitions/internal";
98
89
  import {
90
+ GCDataBuilder,
91
+ ReadAndParseBlob,
92
+ RequestParser,
93
+ TelemetryContext,
99
94
  addBlobToSummary,
100
95
  addSummarizeResultToSummary,
101
- RequestParser,
96
+ calculateStats,
102
97
  create404Response,
103
98
  exceptionToResponse,
104
- GCDataBuilder,
105
- seqFromTree,
106
- calculateStats,
107
- TelemetryContext,
108
- ReadAndParseBlob,
109
99
  responseToException,
110
- } from "@fluidframework/runtime-utils";
111
- import { v4 as uuid } from "uuid";
112
- import { ContainerFluidHandleContext } from "./containerHandleContext.js";
113
- import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
114
- import { ReportOpPerfTelemetry, IPerfSignalReport } from "./connectionTelemetry.js";
100
+ seqFromTree,
101
+ } from "@fluidframework/runtime-utils/internal";
115
102
  import {
116
- IPendingBatchMessage,
117
- IPendingLocalState,
118
- PendingStateManager,
119
- } from "./pendingStateManager.js";
120
- import { pkgVersion } from "./packageVersion.js";
103
+ type ITelemetryGenericEventExt,
104
+ ITelemetryLoggerExt,
105
+ } from "@fluidframework/telemetry-utils";
106
+ import {
107
+ DataCorruptionError,
108
+ DataProcessingError,
109
+ GenericError,
110
+ IEventSampler,
111
+ LoggingError,
112
+ MonitoringContext,
113
+ PerformanceEvent,
114
+ // eslint-disable-next-line import/no-deprecated
115
+ TaggedLoggerAdapter,
116
+ UsageError,
117
+ createChildLogger,
118
+ createChildMonitoringContext,
119
+ createSampledLogger,
120
+ loggerToMonitoringContext,
121
+ raiseConnectedEvent,
122
+ wrapError,
123
+ } from "@fluidframework/telemetry-utils/internal";
124
+ import { v4 as uuid } from "uuid";
125
+
126
+ import { BindBatchTracker } from "./batchTracker.js";
121
127
  import { BlobManager, IBlobManagerLoadInfo, IPendingBlobs } from "./blobManager.js";
122
128
  import { ChannelCollection, getSummaryForDatastores, wrapContext } from "./channelCollection.js";
129
+ import { IPerfSignalReport, ReportOpPerfTelemetry } from "./connectionTelemetry.js";
130
+ import { ContainerFluidHandleContext } from "./containerHandleContext.js";
131
+ import { channelToDataStore } from "./dataStore.js";
132
+ import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
133
+ import { DeltaManagerSummarizerProxy } from "./deltaManagerSummarizerProxy.js";
123
134
  import {
124
- aliasBlobName,
125
- blobsTreeName,
126
- chunksBlobName,
127
- createRootSummarizerNodeWithGC,
128
- electedSummarizerBlobName,
129
- extractSummaryMetadataMessage,
130
- IContainerRuntimeMetadata,
131
- ICreateContainerMetadata,
132
- idCompressorBlobName,
133
- IRootSummarizerNodeWithGC,
134
- ISummaryMetadataMessage,
135
- metadataBlobName,
136
- Summarizer,
137
- SummaryManager,
138
- wrapSummaryInChannelsTree,
139
- SummaryCollection,
140
- ISerializedElection,
141
- OrderedClientCollection,
142
- OrderedClientElection,
143
- SummarizerClientElection,
144
- summarizerClientType,
145
- SubmitSummaryResult,
146
- IConnectableRuntime,
147
- IGeneratedSummaryStats,
148
- ISubmitSummaryOptions,
149
- ISummarizerInternalsProvider,
150
- ISummarizerRuntime,
151
- IRefreshSummaryAckOptions,
152
- RunWhileConnectedCoordinator,
153
- IGenerateSummaryTreeResult,
154
- RetriableSummaryError,
155
- IOnDemandSummarizeOptions,
156
- ISummarizeResults,
157
- IEnqueueSummarizeOptions,
158
- EnqueueSummarizeResult,
159
- ISummarizerEvents,
160
- IBaseSummarizeResult,
161
- ISummarizer,
162
- rootHasIsolatedChannels,
163
- IdCompressorMode,
164
- } from "./summary/index.js";
165
- import { formExponentialFn, Throttler } from "./throttler.js";
166
- import {
167
- GarbageCollector,
168
135
  GCNodeType,
169
- gcGenerationOptionName,
170
- IGarbageCollector,
136
+ GarbageCollector,
171
137
  IGCRuntimeOptions,
172
138
  IGCStats,
139
+ IGarbageCollector,
140
+ gcGenerationOptionName,
173
141
  } from "./gc/index.js";
174
- import { channelToDataStore } from "./dataStore.js";
175
- import { BindBatchTracker } from "./batchTracker.js";
176
- import { ScheduleManager } from "./scheduleManager.js";
142
+ import {
143
+ ContainerMessageType,
144
+ type ContainerRuntimeDocumentSchemaMessage,
145
+ ContainerRuntimeGCMessage,
146
+ type ContainerRuntimeIdAllocationMessage,
147
+ type InboundSequencedContainerRuntimeMessage,
148
+ type InboundSequencedContainerRuntimeMessageOrSystemMessage,
149
+ type LocalContainerRuntimeMessage,
150
+ type OutboundContainerRuntimeMessage,
151
+ type UnknownContainerRuntimeMessage,
152
+ } from "./messageTypes.js";
153
+ import { IBatchMetadata, IIdAllocationMetadata } from "./metadata.js";
177
154
  import {
178
155
  BatchMessage,
179
156
  IBatch,
180
157
  IBatchCheckpoint,
181
158
  OpCompressor,
182
159
  OpDecompressor,
183
- Outbox,
160
+ OpGroupingManager,
184
161
  OpSplitter,
162
+ Outbox,
185
163
  RemoteMessageProcessor,
186
- OpGroupingManager,
187
164
  getLongStack,
188
165
  } from "./opLifecycle/index.js";
189
- import { DeltaManagerSummarizerProxy } from "./deltaManagerSummarizerProxy.js";
190
- import { IBatchMetadata, IIdAllocationMetadata } from "./metadata.js";
166
+ import { pkgVersion } from "./packageVersion.js";
191
167
  import {
192
- ContainerMessageType,
193
- type InboundSequencedContainerRuntimeMessage,
194
- type InboundSequencedContainerRuntimeMessageOrSystemMessage,
195
- type ContainerRuntimeIdAllocationMessage,
196
- type LocalContainerRuntimeMessage,
197
- type OutboundContainerRuntimeMessage,
198
- type UnknownContainerRuntimeMessage,
199
- ContainerRuntimeGCMessage,
200
- } from "./messageTypes.js";
168
+ IPendingBatchMessage,
169
+ IPendingLocalState,
170
+ PendingStateManager,
171
+ } from "./pendingStateManager.js";
172
+ import { ScheduleManager } from "./scheduleManager.js";
173
+ import {
174
+ DocumentsSchemaController,
175
+ EnqueueSummarizeResult,
176
+ IBaseSummarizeResult,
177
+ IConnectableRuntime,
178
+ IContainerRuntimeMetadata,
179
+ ICreateContainerMetadata,
180
+ type IDocumentSchemaCurrent,
181
+ IEnqueueSummarizeOptions,
182
+ IGenerateSummaryTreeResult,
183
+ IGeneratedSummaryStats,
184
+ IOnDemandSummarizeOptions,
185
+ IRefreshSummaryAckOptions,
186
+ IRootSummarizerNodeWithGC,
187
+ ISerializedElection,
188
+ ISubmitSummaryOptions,
189
+ ISummarizeResults,
190
+ ISummarizer,
191
+ ISummarizerEvents,
192
+ ISummarizerInternalsProvider,
193
+ ISummarizerRuntime,
194
+ ISummaryMetadataMessage,
195
+ IdCompressorMode,
196
+ OrderedClientCollection,
197
+ OrderedClientElection,
198
+ RetriableSummaryError,
199
+ RunWhileConnectedCoordinator,
200
+ SubmitSummaryResult,
201
+ Summarizer,
202
+ SummarizerClientElection,
203
+ SummaryCollection,
204
+ SummaryManager,
205
+ aliasBlobName,
206
+ blobsTreeName,
207
+ chunksBlobName,
208
+ createRootSummarizerNodeWithGC,
209
+ electedSummarizerBlobName,
210
+ extractSummaryMetadataMessage,
211
+ idCompressorBlobName,
212
+ metadataBlobName,
213
+ rootHasIsolatedChannels,
214
+ summarizerClientType,
215
+ wrapSummaryInChannelsTree,
216
+ } from "./summary/index.js";
217
+ import { Throttler, formExponentialFn } from "./throttler.js";
201
218
 
202
219
  /**
203
220
  * Utility to implement compat behaviors given an unknown message type
@@ -416,7 +433,7 @@ export interface IContainerRuntimeOptions {
416
433
  * If specified, when in FlushMode.TurnBased, if the size of the ops between JS turns exceeds this value,
417
434
  * an error will be thrown and the container will close.
418
435
  *
419
- * If unspecified, the limit is 950 * 1024.
436
+ * If unspecified, the limit is 700Kb.
420
437
  *
421
438
  * 'Infinity' will disable any limit.
422
439
  *
@@ -465,6 +482,15 @@ export interface IContainerRuntimeOptions {
465
482
  * @experimental Not ready for use.
466
483
  */
467
484
  readonly enableGroupedBatching?: boolean;
485
+
486
+ /**
487
+ * When this property is set to true, it requires runtime to control is document schema properly through ops
488
+ * The benefit of this mode is that clients who do not understand schema will fail in predictable way, with predictable message,
489
+ * and will not attempt to limp along, which could cause data corruptions and crashes in random places.
490
+ * When this property is not set (or set to false), runtime operates in legacy mode, where new features (modifying document schema)
491
+ * are engaged as they become available, without giving legacy clients any chance to fail predictably.
492
+ */
493
+ readonly explicitSchemaControl?: boolean;
468
494
  }
469
495
 
470
496
  /**
@@ -505,6 +531,12 @@ export enum CompressionAlgorithms {
505
531
  lz4 = "lz4",
506
532
  }
507
533
 
534
+ /** @alpha */
535
+ export const disabledCompressionConfig: ICompressionRuntimeOptions = {
536
+ minimumBatchSizeInBytes: Infinity,
537
+ compressionAlgorithm: CompressionAlgorithms.lz4,
538
+ };
539
+
508
540
  /**
509
541
  * @deprecated
510
542
  * Untagged logger is unsupported going forward. There are old loaders with old ContainerContexts that only
@@ -571,26 +603,12 @@ export const defaultPendingOpsRetryDelayMs = 1000;
571
603
  */
572
604
  const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
573
605
 
574
- /**
575
- * @deprecated use ContainerRuntimeMessageType instead
576
- * @internal
577
- */
578
- export enum RuntimeMessage {
579
- FluidDataStoreOp = "component",
580
- Attach = "attach",
581
- ChunkedOp = "chunkedOp",
582
- BlobAttach = "blobAttach",
583
- Rejoin = "rejoin",
584
- Alias = "alias",
585
- Operation = "op",
586
- }
587
-
588
606
  /**
589
607
  * @deprecated please use version in driver-utils
590
608
  * @internal
591
609
  */
592
610
  export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean {
593
- return (Object.values(RuntimeMessage) as string[]).includes(message.type);
611
+ return (Object.values(ContainerMessageType) as string[]).includes(message.type);
594
612
  }
595
613
 
596
614
  /**
@@ -697,6 +715,18 @@ async function createSummarizer(loader: ILoader, url: string): Promise<ISummariz
697
715
  return fluidObject.ISummarizer;
698
716
  }
699
717
 
718
+ /**
719
+ * Extract last message from the snapshot metadata.
720
+ * Uses legacy property if not using explicit schema control, otherwise uses the new property.
721
+ * This allows new runtime to make documents not openable for old runtimes, one explicit document schema control is enabled.
722
+ * Please see addMetadataToSummary() as well
723
+ */
724
+ function lastMessageFromMetadata(metadata: IContainerRuntimeMetadata | undefined) {
725
+ return metadata?.documentSchema?.runtime?.explicitSchemaControl
726
+ ? metadata?.lastMessage
727
+ : metadata?.message;
728
+ }
729
+
700
730
  /**
701
731
  * Represents the runtime of the container. Contains helper functions/state of the container.
702
732
  * It will define the store level mappings.
@@ -743,7 +773,7 @@ export class ContainerRuntime
743
773
  existing,
744
774
  requestHandler,
745
775
  provideEntryPoint,
746
- runtimeOptions = {},
776
+ runtimeOptions = {} satisfies IContainerRuntimeOptions,
747
777
  containerScope = {},
748
778
  containerRuntimeCtor = ContainerRuntime,
749
779
  } = params;
@@ -753,6 +783,7 @@ export class ContainerRuntime
753
783
  const backCompatContext: IContainerContext | OldContainerContextWithLogger = context;
754
784
  const passLogger =
755
785
  backCompatContext.taggedLogger ??
786
+ // eslint-disable-next-line import/no-deprecated
756
787
  new TaggedLoggerAdapter((backCompatContext as OldContainerContextWithLogger).logger);
757
788
  const logger = createChildLogger({
758
789
  logger: passLogger,
@@ -772,10 +803,11 @@ export class ContainerRuntime
772
803
  flushMode = defaultFlushMode,
773
804
  compressionOptions = defaultCompressionConfig,
774
805
  maxBatchSizeInBytes = defaultMaxBatchSizeInBytes,
775
- enableRuntimeIdCompressor = "off",
806
+ enableRuntimeIdCompressor,
776
807
  chunkSizeInBytes = defaultChunkSizeInBytes,
777
808
  enableOpReentryCheck = false,
778
809
  enableGroupedBatching = false,
810
+ explicitSchemaControl = false,
779
811
  } = runtimeOptions;
780
812
 
781
813
  const registry = new FluidDataStoreRegistry(registryEntries);
@@ -816,8 +848,10 @@ export class ContainerRuntime
816
848
  },
817
849
  );
818
850
 
851
+ const messageAtLastSummary = lastMessageFromMetadata(metadata);
852
+
819
853
  // Verify summary runtime sequence number matches protocol sequence number.
820
- const runtimeSequenceNumber = metadata?.message?.sequenceNumber;
854
+ const runtimeSequenceNumber = messageAtLastSummary?.sequenceNumber;
821
855
  // When we load with pending state, we reuse an old snapshot so we don't expect these numbers to match
822
856
  if (!context.pendingLocalState && runtimeSequenceNumber !== undefined) {
823
857
  const protocolSequenceNumber = context.deltaManager.initialSequenceNumber;
@@ -826,6 +860,13 @@ export class ContainerRuntime
826
860
  loadSequenceNumberVerification !== "bypass" &&
827
861
  runtimeSequenceNumber !== protocolSequenceNumber
828
862
  ) {
863
+ // Message to OCEs:
864
+ // You can hit this error with runtimeSequenceNumber === -1 in < 2.0 RC3 builds.
865
+ // This would indicate that explicit schema control is enabled in current (2.0 RC3+) builds and it
866
+ // results in addMetadataToSummary() creating a poison pill for older runtimes in the form of a -1 sequence number.
867
+ // Older runtimes do not understand new schema, and thus could corrupt document if they proceed, thus we are using
868
+ // this poison pill to prevent them from proceeding.
869
+
829
870
  // "Load from summary, runtime metadata sequenceNumber !== initialSequenceNumber"
830
871
  const error = new DataCorruptionError(
831
872
  // pre-0.58 error message: SummaryMetadataMismatch
@@ -842,7 +883,7 @@ export class ContainerRuntime
842
883
  }
843
884
 
844
885
  // Enabling the IdCompressor is a one-way operation and we only want to
845
- // allow new containers to turn it on
886
+ // allow new containers to turn it on.
846
887
  let idCompressorMode: IdCompressorMode;
847
888
  if (existing) {
848
889
  // This setting has to be sticky for correctness:
@@ -851,19 +892,19 @@ export class ContainerRuntime
851
892
  // 2) if it's ON, then all sessions should load compressor right away
852
893
  // 3) Same logic applies for "delayed" mode
853
894
  // Maybe in the future we will need to enabled (and figure how to do it safely) "delayed" -> "on" change.
854
- // We could do "off" -> "on" transtition too, if all clients start loading compressor (but not using it initially) and do so for a while -
855
- // this will allow clients to eventually to disregard "off" setting (when it's safe so) and start using compressor in future sessions.
895
+ // We could do "off" -> "on" transition too, if all clients start loading compressor (but not using it initially) and
896
+ // do so for a while - this will allow clients to eventually to disregard "off" setting (when it's safe so) and start
897
+ // using compressor in future sessions.
856
898
  // Everyting is possible, but it needs to be designed and executed carefully, when such need arises.
857
- idCompressorMode = metadata?.idCompressorMode ?? "off";
899
+ idCompressorMode = metadata?.documentSchema?.runtime
900
+ ?.idCompressorMode as IdCompressorMode;
858
901
  } else {
859
- // FG overwrite
860
- const enabled = mc.config.getBoolean("Fluid.ContainerRuntime.IdCompressorEnabled");
861
- switch (enabled) {
902
+ switch (mc.config.getBoolean("Fluid.ContainerRuntime.IdCompressorEnabled")) {
862
903
  case true:
863
904
  idCompressorMode = "on";
864
905
  break;
865
906
  case false:
866
- idCompressorMode = "off";
907
+ idCompressorMode = undefined;
867
908
  break;
868
909
  default:
869
910
  idCompressorMode = enableRuntimeIdCompressor;
@@ -873,7 +914,7 @@ export class ContainerRuntime
873
914
 
874
915
  const createIdCompressorFn = async () => {
875
916
  const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import(
876
- "@fluidframework/id-compressor"
917
+ "@fluidframework/id-compressor/internal"
877
918
  );
878
919
 
879
920
  /**
@@ -908,6 +949,39 @@ export class ContainerRuntime
908
949
  }
909
950
  };
910
951
 
952
+ const disableGroupedBatching = mc.config.getBoolean(
953
+ "Fluid.ContainerRuntime.DisableGroupedBatching",
954
+ );
955
+ const disableCompression = mc.config.getBoolean(
956
+ "Fluid.ContainerRuntime.CompressionDisabled",
957
+ );
958
+ const compressionLz4 =
959
+ disableCompression !== true &&
960
+ compressionOptions.minimumBatchSizeInBytes !== Infinity &&
961
+ compressionOptions.compressionAlgorithm === "lz4";
962
+
963
+ const opGroupingEnabled = disableGroupedBatching !== true && enableGroupedBatching;
964
+
965
+ const documentSchemaController = new DocumentsSchemaController(
966
+ existing,
967
+ metadata?.documentSchema,
968
+ {
969
+ explicitSchemaControl,
970
+ compressionLz4,
971
+ idCompressorMode,
972
+ opGroupingEnabled,
973
+ disallowedVersions: [],
974
+ },
975
+ (schema) => {
976
+ runtime.onSchemaChange(schema);
977
+ },
978
+ );
979
+
980
+ const featureGatesForTelemetry: Record<string, boolean | number | undefined> = {
981
+ disableGroupedBatching,
982
+ disableCompression,
983
+ };
984
+
911
985
  const runtime = new containerRuntimeCtor(
912
986
  context,
913
987
  registry,
@@ -923,9 +997,11 @@ export class ContainerRuntime
923
997
  compressionOptions,
924
998
  maxBatchSizeInBytes,
925
999
  chunkSizeInBytes,
926
- enableRuntimeIdCompressor,
1000
+ // Requires<> drops undefined from IdCompressorType
1001
+ enableRuntimeIdCompressor: enableRuntimeIdCompressor as "on" | "delayed",
927
1002
  enableOpReentryCheck,
928
1003
  enableGroupedBatching,
1004
+ explicitSchemaControl,
929
1005
  },
930
1006
  containerScope,
931
1007
  logger,
@@ -933,12 +1009,24 @@ export class ContainerRuntime
933
1009
  blobManagerSnapshot,
934
1010
  context.storage,
935
1011
  createIdCompressorFn,
936
- idCompressorMode,
1012
+ documentSchemaController,
1013
+ featureGatesForTelemetry,
937
1014
  provideEntryPoint,
938
1015
  requestHandler,
939
1016
  undefined, // summaryConfiguration
940
1017
  );
941
1018
 
1019
+ runtime.blobManager.trackPendingStashedUploads().then(
1020
+ () => {
1021
+ // make sure we didn't reconnect before the promise resolved
1022
+ if (runtime.delayConnectClientId !== undefined && !runtime.disposed) {
1023
+ runtime.delayConnectClientId = undefined;
1024
+ runtime.setConnectionStateCore(true, runtime.delayConnectClientId);
1025
+ }
1026
+ },
1027
+ (error) => runtime.closeFn(error),
1028
+ );
1029
+
942
1030
  // Apply stashed ops with a reference sequence number equal to the sequence number of the snapshot,
943
1031
  // or zero. This must be done before Container replays saved ops.
944
1032
  await runtime.pendingStateManager.applyStashedOpsAt(runtimeSequenceNumber ?? 0);
@@ -983,7 +1071,7 @@ export class ContainerRuntime
983
1071
  summaryOp: ISummaryContent,
984
1072
  referenceSequenceNumber?: number,
985
1073
  ) => number;
986
- private readonly submitSignalFn: (content: any, targetClientId?: string) => void;
1074
+ private readonly submitSignalFn: (content: ISignalEnvelope, targetClientId?: string) => void;
987
1075
  public readonly disposeFn: (error?: ICriticalContainerError) => void;
988
1076
  public readonly closeFn: (error?: ICriticalContainerError) => void;
989
1077
 
@@ -1004,6 +1092,10 @@ export class ContainerRuntime
1004
1092
  return this._getAttachState();
1005
1093
  }
1006
1094
 
1095
+ public get documentSchema() {
1096
+ return this.documentsSchemaController.sessionSchema.runtime;
1097
+ }
1098
+
1007
1099
  private _idCompressor: (IIdCompressor & IIdCompressorCore) | undefined;
1008
1100
 
1009
1101
  // We accumulate Id compressor Ops while Id compressor is not loaded yet (only for "delayed" mode)
@@ -1016,6 +1108,9 @@ export class ContainerRuntime
1016
1108
  // In such case we have to process all ops, including those marked with saveOp === true.
1017
1109
  private readonly skipSavedCompressorOps: boolean;
1018
1110
 
1111
+ public get idCompressorMode() {
1112
+ return this.documentSchema.idCompressorMode;
1113
+ }
1019
1114
  /**
1020
1115
  * See IContainerRuntimeBase.idCompressor() for details.
1021
1116
  */
@@ -1037,7 +1132,7 @@ export class ContainerRuntime
1037
1132
  * True if we have ID compressor loading in-flight (async operation). Useful only for
1038
1133
  * this.idCompressorMode === "delayed" mode
1039
1134
  */
1040
- protected compressorLoadInitiated = false;
1135
+ protected _loadIdCompressor: Promise<void> | undefined;
1041
1136
 
1042
1137
  /**
1043
1138
  * See IContainerRuntimeBase.generateDocumentUniqueId() for details.
@@ -1259,7 +1354,8 @@ export class ContainerRuntime
1259
1354
  blobManagerSnapshot: IBlobManagerLoadInfo,
1260
1355
  private readonly _storage: IDocumentStorageService,
1261
1356
  private readonly createIdCompressor: () => Promise<IIdCompressor & IIdCompressorCore>,
1262
- private readonly idCompressorMode: IdCompressorMode,
1357
+ private readonly documentsSchemaController: DocumentsSchemaController,
1358
+ featureGatesForTelemetry: Record<string, boolean | number | undefined>,
1263
1359
  provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>,
1264
1360
  private readonly requestHandler?: (
1265
1361
  request: IRequest,
@@ -1293,6 +1389,22 @@ export class ContainerRuntime
1293
1389
  supportedFeatures,
1294
1390
  } = context;
1295
1391
 
1392
+ this.mc = createChildMonitoringContext({
1393
+ logger: this.logger,
1394
+ namespace: "ContainerRuntime",
1395
+ });
1396
+
1397
+ // If we support multiple algorithms in the future, then we would need to manage it here carefully.
1398
+ // We can use runtimeOptions.compressionOptions.compressionAlgorithm, but only if it's in the schema list!
1399
+ // If it's not in the list, then we will need to either use no compression, or fallback to some other (supported by format)
1400
+ // compression.
1401
+ const compressionOptions: ICompressionRuntimeOptions = {
1402
+ minimumBatchSizeInBytes: this.documentSchema.compressionLz4
1403
+ ? runtimeOptions.compressionOptions.minimumBatchSizeInBytes
1404
+ : Number.POSITIVE_INFINITY,
1405
+ compressionAlgorithm: CompressionAlgorithms.lz4,
1406
+ };
1407
+
1296
1408
  this.innerDeltaManager = deltaManager;
1297
1409
  this.deltaManager = new DeltaManagerSummarizerProxy(this.innerDeltaManager);
1298
1410
 
@@ -1330,11 +1442,6 @@ export class ContainerRuntime
1330
1442
  // In cases of summarizer, we want to dispose instead since consumer doesn't interact with this container
1331
1443
  this.closeFn = this.isSummarizerClient ? this.disposeFn : closeFn;
1332
1444
 
1333
- this.mc = createChildMonitoringContext({
1334
- logger: this.logger,
1335
- namespace: "ContainerRuntime",
1336
- });
1337
-
1338
1445
  let loadSummaryNumber: number;
1339
1446
  // Get the container creation metadata. For new container, we initialize these. For existing containers,
1340
1447
  // get the values from the metadata blob.
@@ -1355,7 +1462,7 @@ export class ContainerRuntime
1355
1462
  }
1356
1463
  this.nextSummaryNumber = loadSummaryNumber + 1;
1357
1464
 
1358
- this.messageAtLastSummary = metadata?.message;
1465
+ this.messageAtLastSummary = lastMessageFromMetadata(metadata);
1359
1466
 
1360
1467
  // Note that we only need to pull the *initial* connected state from the context.
1361
1468
  // Later updates come through calls to setConnectionState.
@@ -1500,7 +1607,7 @@ export class ContainerRuntime
1500
1607
  // Due to a mismatch between different layers in terms of
1501
1608
  // what is the interface of passing signals, we need the
1502
1609
  // downstream stores to wrap the signal.
1503
- parentContext.submitSignal = (type: string, content: any, targetClientId?: string) => {
1610
+ parentContext.submitSignal = (type: string, content: unknown, targetClientId?: string) => {
1504
1611
  const envelope1 = content as IEnvelope;
1505
1612
  const envelope2 = this.createNewSignalEnvelope(
1506
1613
  envelope1.address,
@@ -1535,11 +1642,11 @@ export class ContainerRuntime
1535
1642
  async (runtime: ChannelCollection) => provideEntryPoint,
1536
1643
  );
1537
1644
 
1538
- this.blobManager = new BlobManager(
1539
- this.handleContext,
1540
- blobManagerSnapshot,
1541
- () => this.storage,
1542
- (localId: string, blobId?: string) => {
1645
+ this.blobManager = new BlobManager({
1646
+ routeContext: this.handleContext,
1647
+ snapshot: blobManagerSnapshot,
1648
+ getStorage: () => this.storage,
1649
+ sendBlobAttachOp: (localId: string, blobId?: string) => {
1543
1650
  if (!this.disposed) {
1544
1651
  this.submit(
1545
1652
  { type: ContainerMessageType.BlobAttach, contents: undefined },
@@ -1551,12 +1658,13 @@ export class ContainerRuntime
1551
1658
  );
1552
1659
  }
1553
1660
  },
1554
- (blobPath: string) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"),
1555
- (blobPath: string) => this.garbageCollector.isNodeDeleted(blobPath),
1556
- this,
1557
- pendingRuntimeState?.pendingAttachmentBlobs,
1558
- (error?: ICriticalContainerError) => this.closeFn(error),
1559
- );
1661
+ blobRequested: (blobPath: string) =>
1662
+ this.garbageCollector.nodeUpdated(blobPath, "Loaded"),
1663
+ isBlobDeleted: (blobPath: string) => this.garbageCollector.isNodeDeleted(blobPath),
1664
+ runtime: this,
1665
+ stashedBlobs: pendingRuntimeState?.pendingAttachmentBlobs,
1666
+ closeContainer: (error?: ICriticalContainerError) => this.closeFn(error),
1667
+ });
1560
1668
 
1561
1669
  this.scheduleManager = new ScheduleManager(
1562
1670
  this.innerDeltaManager,
@@ -1583,17 +1691,6 @@ export class ContainerRuntime
1583
1691
  this.logger,
1584
1692
  );
1585
1693
 
1586
- const disableCompression = this.mc.config.getBoolean(
1587
- "Fluid.ContainerRuntime.CompressionDisabled",
1588
- );
1589
- const compressionOptions =
1590
- disableCompression === true
1591
- ? {
1592
- minimumBatchSizeInBytes: Number.POSITIVE_INFINITY,
1593
- compressionAlgorithm: CompressionAlgorithms.lz4,
1594
- }
1595
- : runtimeOptions.compressionOptions;
1596
-
1597
1694
  const disablePartialFlush = this.mc.config.getBoolean(
1598
1695
  "Fluid.ContainerRuntime.DisablePartialFlush",
1599
1696
  );
@@ -1747,10 +1844,10 @@ export class ContainerRuntime
1747
1844
  disableIsolatedChannels: metadata?.disableIsolatedChannels,
1748
1845
  gcVersion: metadata?.gcFeature,
1749
1846
  options: JSON.stringify(runtimeOptions),
1750
- idCompressorModeMetadata: metadata?.idCompressorMode,
1847
+ idCompressorModeMetadata: metadata?.documentSchema?.runtime?.idCompressorMode,
1751
1848
  idCompressorMode: this.idCompressorMode,
1752
1849
  featureGates: JSON.stringify({
1753
- disableCompression,
1850
+ ...featureGatesForTelemetry,
1754
1851
  disableOpReentryCheck,
1755
1852
  disableChunking,
1756
1853
  disableAttachReorder: this.disableAttachReorder,
@@ -1780,6 +1877,21 @@ export class ContainerRuntime
1780
1877
  this.skipSavedCompressorOps = pendingRuntimeState?.pendingIdCompressorState !== undefined;
1781
1878
  }
1782
1879
 
1880
+ public onSchemaChange(schema: IDocumentSchemaCurrent) {
1881
+ // Most of the settings will be picked up only by new sessions (i.e. after reload).
1882
+ // We can make it better in the future (i.e. start to use op compression right away), but for simplicity
1883
+ // this is not done.
1884
+ // But ID compressor is special. It's possible, that in future, we will remove "stickiness" of ID compressor setting
1885
+ // and will allow to start using it. If that were to happen, we want to ensure that we do not break eventual consistency
1886
+ // promises. To do so, we need to initialize id compressor right away.
1887
+ // As it's implemented right now (with async initialization), this will only work for "off" -> "delayed" transitions.
1888
+ // Anything else is too risky, and requires ability to initialize ID compressor synchronously!
1889
+ if (schema.runtime.idCompressorMode !== undefined) {
1890
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
1891
+ this.loadIdCompressor();
1892
+ }
1893
+ }
1894
+
1783
1895
  public getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam) {
1784
1896
  return (
1785
1897
  summarizeInternal: SummarizeInternalFn,
@@ -2062,20 +2174,38 @@ export class ContainerRuntime
2062
2174
 
2063
2175
  /** Adds the container's metadata to the given summary tree. */
2064
2176
  private addMetadataToSummary(summaryTree: ISummaryTreeWithStats) {
2177
+ // The last message processed at the time of summary. If there are no new messages, use the message from the
2178
+ // last summary.
2179
+ const message =
2180
+ extractSummaryMetadataMessage(this.deltaManager.lastMessage) ??
2181
+ this.messageAtLastSummary;
2182
+
2183
+ const documentSchema = this.documentsSchemaController.summarizeDocumentSchema(
2184
+ this.deltaManager.lastSequenceNumber,
2185
+ );
2186
+
2187
+ // Is document schema explicit control on?
2188
+ const explitiSchemaControl = documentSchema?.runtime.explicitSchemaControl;
2189
+
2065
2190
  const metadata: IContainerRuntimeMetadata = {
2066
2191
  ...this.createContainerMetadata,
2067
2192
  // Increment the summary number for the next summary that will be generated.
2068
2193
  summaryNumber: this.nextSummaryNumber++,
2069
2194
  summaryFormatVersion: 1,
2070
2195
  ...this.garbageCollector.getMetadata(),
2071
- // The last message processed at the time of summary. If there are no new messages, use the message from the
2072
- // last summary.
2073
- message:
2074
- extractSummaryMetadataMessage(this.deltaManager.lastMessage) ??
2075
- this.messageAtLastSummary,
2076
2196
  telemetryDocumentId: this.telemetryDocumentId,
2077
- idCompressorMode: this.idCompressorMode,
2197
+ // If explicit document schema control is not on, use legacy way to supply last message (using 'message' property).
2198
+ // Otherwise use new 'lastMessage' property, but also put content into the 'message' property that cases old
2199
+ // runtimes (that preceed document schema control capabilities) to close container on load due to mismatch in
2200
+ // last message's sequence number.
2201
+ // See also lastMessageFromMetadata()
2202
+ message: explitiSchemaControl
2203
+ ? ({ sequenceNumber: -1 } as any as ISummaryMetadataMessage)
2204
+ : message,
2205
+ lastMessage: explitiSchemaControl ? message : undefined,
2206
+ documentSchema,
2078
2207
  };
2208
+
2079
2209
  addBlobToSummary(summaryTree, metadataBlobName, JSON.stringify(metadata));
2080
2210
  }
2081
2211
 
@@ -2211,7 +2341,21 @@ export class ContainerRuntime
2211
2341
  case ContainerMessageType.Alias:
2212
2342
  return this.channelCollection.applyStashedOp(opContents);
2213
2343
  case ContainerMessageType.IdAllocation:
2214
- assert(this.idCompressorMode !== "off", 0x8f1 /* ID compressor should be in use */);
2344
+ // IDs allocation ops in stashed state are ignored because the tip state of the compressor
2345
+ // is serialized into the pending state. This is done because generation of new IDs during
2346
+ // stashed op application (or, later, resubmit) must generate new IDs and if the compressor
2347
+ // was loaded from a state serialized at the same time as the summary tree in the stashed state
2348
+ // then it would generate IDs that collide with any in later stashed ops.
2349
+ // In the future, IdCompressor could be extended to have an "applyStashedOp" or similar method
2350
+ // and the runtime could filter out all ID allocation ops from the stashed state and apply them
2351
+ // before applying the rest of the stashed ops. This would accomplish the same thing but with
2352
+ // better performance in future incremental stashed state creation.
2353
+ assert(
2354
+ this.idCompressorMode !== undefined,
2355
+ 0x8f1 /* ID compressor should be in use */,
2356
+ );
2357
+ return;
2358
+ case ContainerMessageType.DocumentSchemaChange:
2215
2359
  return;
2216
2360
  case ContainerMessageType.BlobAttach:
2217
2361
  return;
@@ -2248,12 +2392,16 @@ export class ContainerRuntime
2248
2392
  }
2249
2393
  }
2250
2394
 
2251
- public setConnectionState(connected: boolean, clientId?: string) {
2252
- if (connected && this.idCompressorMode === "delayed" && !this.compressorLoadInitiated) {
2253
- this.compressorLoadInitiated = true;
2254
- this.createIdCompressor()
2395
+ private async loadIdCompressor() {
2396
+ if (
2397
+ this._idCompressor === undefined &&
2398
+ this.idCompressorMode !== undefined &&
2399
+ this._loadIdCompressor === undefined
2400
+ ) {
2401
+ this._loadIdCompressor = this.createIdCompressor()
2255
2402
  .then((compressor) => {
2256
2403
  this._idCompressor = compressor;
2404
+ // Finalize any ranges we received while the compressor was turned off.
2257
2405
  for (const range of this.pendingIdCompressorOps) {
2258
2406
  this._idCompressor.finalizeCreationRange(range);
2259
2407
  }
@@ -2261,8 +2409,17 @@ export class ContainerRuntime
2261
2409
  })
2262
2410
  .catch((error) => {
2263
2411
  this.logger.sendErrorEvent({ eventName: "IdCompressorDelayedLoad" }, error);
2412
+ throw error;
2264
2413
  });
2265
2414
  }
2415
+ return this._loadIdCompressor;
2416
+ }
2417
+
2418
+ public setConnectionState(connected: boolean, clientId?: string) {
2419
+ if (connected && this.idCompressorMode === "delayed") {
2420
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
2421
+ this.loadIdCompressor();
2422
+ }
2266
2423
  if (connected === false && this.delayConnectClientId !== undefined) {
2267
2424
  this.delayConnectClientId = undefined;
2268
2425
  this.mc.logger.sendTelemetryEvent({
@@ -2272,27 +2429,21 @@ export class ContainerRuntime
2272
2429
  return;
2273
2430
  }
2274
2431
 
2432
+ if (!connected) {
2433
+ this.documentsSchemaController.onDisconnect();
2434
+ }
2435
+
2275
2436
  // If there are stashed blobs in the pending state, we need to delay
2276
2437
  // propagation of the "connected" event until we have uploaded them to
2277
2438
  // ensure we don't submit ops referencing a blob that has not been uploaded
2278
2439
  const connecting = connected && !this._connected;
2279
- if (connecting && this.blobManager.hasPendingStashedBlobs()) {
2440
+ if (connecting && this.blobManager.hasPendingStashedUploads()) {
2280
2441
  assert(
2281
2442
  !this.delayConnectClientId,
2282
2443
  0x791 /* Connect event delay must be canceled before subsequent connect event */,
2283
2444
  );
2284
2445
  assert(!!clientId, 0x792 /* Must have clientId when connecting */);
2285
2446
  this.delayConnectClientId = clientId;
2286
- this.blobManager.processStashedChanges().then(
2287
- () => {
2288
- // make sure we didn't reconnect before the promise resolved
2289
- if (this.delayConnectClientId === clientId && !this.disposed) {
2290
- this.delayConnectClientId = undefined;
2291
- this.setConnectionStateCore(connected, clientId);
2292
- }
2293
- },
2294
- (error) => this.closeFn(error),
2295
- );
2296
2447
  return;
2297
2448
  }
2298
2449
 
@@ -2488,6 +2639,8 @@ export class ContainerRuntime
2488
2639
  )
2489
2640
  ) {
2490
2641
  const range = messageWithContext.message.contents;
2642
+ // Some other client turned on the id compressor. If we have not turned it on,
2643
+ // put it in a pending queue and delay finalization.
2491
2644
  if (this._idCompressor === undefined) {
2492
2645
  this.pendingIdCompressorOps.push(range);
2493
2646
  } else {
@@ -2504,6 +2657,13 @@ export class ContainerRuntime
2504
2657
  assert(false, "should not even get here");
2505
2658
  case ContainerMessageType.Rejoin:
2506
2659
  break;
2660
+ case ContainerMessageType.DocumentSchemaChange:
2661
+ this.documentsSchemaController.processDocumentSchemaOp(
2662
+ messageWithContext.message.contents,
2663
+ messageWithContext.local,
2664
+ messageWithContext.message.sequenceNumber,
2665
+ );
2666
+ break;
2507
2667
  default: {
2508
2668
  // If we didn't necessarily expect a runtime message type, then no worries - just return
2509
2669
  // e.g. this case applies to system ops, or legacy ops that would have fallen into the above cases anyway.
@@ -2823,6 +2983,7 @@ export class ContainerRuntime
2823
2983
  break;
2824
2984
  }
2825
2985
  case ContainerMessageType.IdAllocation:
2986
+ case ContainerMessageType.DocumentSchemaChange:
2826
2987
  case ContainerMessageType.GC: {
2827
2988
  return false;
2828
2989
  }
@@ -2859,10 +3020,10 @@ export class ContainerRuntime
2859
3020
  /**
2860
3021
  * Submits the signal to be sent to other clients.
2861
3022
  * @param type - Type of the signal.
2862
- * @param content - Content of the signal.
3023
+ * @param content - Content of the signal. Should be a JSON serializable object or primitive.
2863
3024
  * @param targetClientId - When specified, the signal is only sent to the provided client id.
2864
3025
  */
2865
- public submitSignal(type: string, content: any, targetClientId?: string) {
3026
+ public submitSignal(type: string, content: unknown, targetClientId?: string) {
2866
3027
  this.verifyNotClosed();
2867
3028
  const envelope = this.createNewSignalEnvelope(undefined /* address */, type, content);
2868
3029
  return this.submitSignalFn(envelope, targetClientId);
@@ -2907,6 +3068,10 @@ export class ContainerRuntime
2907
3068
  // We can finalize any allocated IDs since we're the only client
2908
3069
  const idRange = this._idCompressor?.takeNextCreationRange();
2909
3070
  if (idRange !== undefined) {
3071
+ assert(
3072
+ idRange.ids === undefined || idRange.ids.firstGenCount === 1,
3073
+ "No other ranges should be taken while container is detached.",
3074
+ );
2910
3075
  this._idCompressor?.finalizeCreationRange(idRange);
2911
3076
  }
2912
3077
 
@@ -2940,6 +3105,9 @@ export class ContainerRuntime
2940
3105
  wrapSummaryInChannelsTree(summarizeResult);
2941
3106
  const pathPartsForChildren = [channelsTreeName];
2942
3107
 
3108
+ // Ensure that ID compressor had a chance to load, if we are using delayed mode.
3109
+ await this.loadIdCompressor();
3110
+
2943
3111
  this.addContainerStateToSummary(summarizeResult, fullTree, trackState, telemetryContext);
2944
3112
  return {
2945
3113
  ...summarizeResult,
@@ -3673,9 +3841,6 @@ export class ContainerRuntime
3673
3841
  const idAllocationBatchMessage: BatchMessage = {
3674
3842
  contents: JSON.stringify(idAllocationMessage),
3675
3843
  referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
3676
- metadata: undefined,
3677
- localOpMetadata: undefined,
3678
- type: ContainerMessageType.IdAllocation,
3679
3844
  };
3680
3845
  this.outbox.submitIdAllocation(idAllocationBatchMessage);
3681
3846
  }
@@ -3685,7 +3850,7 @@ export class ContainerRuntime
3685
3850
  private submit(
3686
3851
  containerRuntimeMessage: OutboundContainerRuntimeMessage,
3687
3852
  localOpMetadata: unknown = undefined,
3688
- metadata: Record<string, unknown> | undefined = undefined,
3853
+ metadata?: { localId: string; blobId?: string },
3689
3854
  ): void {
3690
3855
  this.verifyNotClosed();
3691
3856
  this.verifyCanSubmitOps();
@@ -3696,6 +3861,12 @@ export class ContainerRuntime
3696
3861
  0x132 /* "sending ops in detached container" */,
3697
3862
  );
3698
3863
 
3864
+ assert(
3865
+ metadata === undefined ||
3866
+ containerRuntimeMessage.type === ContainerMessageType.BlobAttach,
3867
+ "metadata",
3868
+ );
3869
+
3699
3870
  const serializedContent = JSON.stringify(containerRuntimeMessage);
3700
3871
 
3701
3872
  // Note that the real (non-proxy) delta manager is used here to get the readonly info. This is because
@@ -3710,7 +3881,6 @@ export class ContainerRuntime
3710
3881
  const type = containerRuntimeMessage.type;
3711
3882
  const message: BatchMessage = {
3712
3883
  contents: serializedContent,
3713
- type,
3714
3884
  metadata,
3715
3885
  localOpMetadata,
3716
3886
  referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
@@ -3726,6 +3896,21 @@ export class ContainerRuntime
3726
3896
  } else {
3727
3897
  this.submitIdAllocationOpIfNeeded();
3728
3898
 
3899
+ // Allow document schema controller to send a message if it needs to propose change in document schema.
3900
+ // If it needs to send a message, it will call provided callback with payload of such message and rely
3901
+ // on this callback to do actual sending.
3902
+ const contents = this.documentsSchemaController.maybeSendSchemaMessage();
3903
+ if (contents) {
3904
+ const msg: ContainerRuntimeDocumentSchemaMessage = {
3905
+ type: ContainerMessageType.DocumentSchemaChange,
3906
+ contents,
3907
+ };
3908
+ this.outbox.submit({
3909
+ contents: JSON.stringify(msg),
3910
+ referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
3911
+ });
3912
+ }
3913
+
3729
3914
  // If this is attach message for new data store, and we are in a batch, send this op out of order
3730
3915
  // Is it safe:
3731
3916
  // Yes, this should be safe reordering. Newly created data stores are not visible through API surface.
@@ -3926,6 +4111,11 @@ export class ContainerRuntime
3926
4111
  case ContainerMessageType.GC:
3927
4112
  this.submit(message);
3928
4113
  break;
4114
+ case ContainerMessageType.DocumentSchemaChange:
4115
+ // There is no need to resend this message. Document schema controller will properly resend it again (if needed)
4116
+ // on a first occasion (any ops sent after reconnect). There is a good chance, though, that it will not want to
4117
+ // send any ops, as some other client already changed schema.
4118
+ break;
3929
4119
  default: {
3930
4120
  // This case should be very rare - it would imply an op was stashed from a
3931
4121
  // future version of runtime code and now is being applied on an older version.
@@ -4215,9 +4405,6 @@ export class ContainerRuntime
4215
4405
  }
4216
4406
 
4217
4407
  private get groupedBatchingEnabled(): boolean {
4218
- const killSwitch = this.mc.config.getBoolean(
4219
- "Fluid.ContainerRuntime.DisableGroupedBatching",
4220
- );
4221
- return killSwitch !== true && this.runtimeOptions.enableGroupedBatching;
4408
+ return this.documentSchema.opGroupingEnabled === true;
4222
4409
  }
4223
4410
  }