@fluidframework/container-runtime 2.0.0-dev.5.2.0.169897 → 2.0.0-dev.6.4.0.191258

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 (561) hide show
  1. package/CHANGELOG.md +147 -0
  2. package/README.md +4 -3
  3. package/dist/batchTracker.d.ts +3 -2
  4. package/dist/batchTracker.d.ts.map +1 -1
  5. package/dist/batchTracker.js +6 -5
  6. package/dist/batchTracker.js.map +1 -1
  7. package/dist/blobManager.d.ts +15 -18
  8. package/dist/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager.js +212 -171
  10. package/dist/blobManager.js.map +1 -1
  11. package/dist/connectionTelemetry.d.ts.map +1 -1
  12. package/dist/connectionTelemetry.js +33 -17
  13. package/dist/connectionTelemetry.js.map +1 -1
  14. package/dist/containerRuntime.d.ts +172 -35
  15. package/dist/containerRuntime.d.ts.map +1 -1
  16. package/dist/containerRuntime.js +722 -425
  17. package/dist/containerRuntime.js.map +1 -1
  18. package/dist/dataStore.d.ts.map +1 -1
  19. package/dist/dataStore.js +15 -7
  20. package/dist/dataStore.js.map +1 -1
  21. package/dist/dataStoreContext.d.ts +4 -4
  22. package/dist/dataStoreContext.d.ts.map +1 -1
  23. package/dist/dataStoreContext.js +87 -90
  24. package/dist/dataStoreContext.js.map +1 -1
  25. package/dist/dataStoreContexts.d.ts +1 -1
  26. package/dist/dataStoreContexts.d.ts.map +1 -1
  27. package/dist/dataStoreContexts.js +10 -10
  28. package/dist/dataStoreContexts.js.map +1 -1
  29. package/dist/dataStoreRegistry.js +2 -2
  30. package/dist/dataStoreRegistry.js.map +1 -1
  31. package/dist/dataStores.d.ts +23 -7
  32. package/dist/dataStores.d.ts.map +1 -1
  33. package/dist/dataStores.js +125 -82
  34. package/dist/dataStores.js.map +1 -1
  35. package/dist/deltaManagerProxyBase.d.ts +35 -0
  36. package/dist/deltaManagerProxyBase.d.ts.map +1 -0
  37. package/dist/deltaManagerProxyBase.js +77 -0
  38. package/dist/deltaManagerProxyBase.js.map +1 -0
  39. package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
  40. package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
  41. package/dist/deltaManagerSummarizerProxy.js +4 -2
  42. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  43. package/dist/deltaScheduler.d.ts.map +1 -1
  44. package/dist/deltaScheduler.js +10 -10
  45. package/dist/deltaScheduler.js.map +1 -1
  46. package/dist/error.d.ts +14 -0
  47. package/dist/error.d.ts.map +1 -0
  48. package/dist/error.js +21 -0
  49. package/dist/error.js.map +1 -0
  50. package/dist/gc/garbageCollection.d.ts +10 -9
  51. package/dist/gc/garbageCollection.d.ts.map +1 -1
  52. package/dist/gc/garbageCollection.js +65 -56
  53. package/dist/gc/garbageCollection.js.map +1 -1
  54. package/dist/gc/gcConfigs.d.ts.map +1 -1
  55. package/dist/gc/gcConfigs.js +18 -14
  56. package/dist/gc/gcConfigs.js.map +1 -1
  57. package/dist/gc/gcDefinitions.d.ts +17 -5
  58. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  59. package/dist/gc/gcDefinitions.js +14 -15
  60. package/dist/gc/gcDefinitions.js.map +1 -1
  61. package/dist/gc/gcHelpers.d.ts +0 -8
  62. package/dist/gc/gcHelpers.d.ts.map +1 -1
  63. package/dist/gc/gcHelpers.js +11 -24
  64. package/dist/gc/gcHelpers.js.map +1 -1
  65. package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
  66. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  67. package/dist/gc/gcSummaryStateTracker.js +19 -58
  68. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  69. package/dist/gc/gcTelemetry.d.ts +1 -1
  70. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  71. package/dist/gc/gcTelemetry.js +45 -35
  72. package/dist/gc/gcTelemetry.js.map +1 -1
  73. package/dist/gc/gcUnreferencedStateTracker.js +4 -4
  74. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  75. package/dist/gc/index.d.ts +2 -2
  76. package/dist/gc/index.d.ts.map +1 -1
  77. package/dist/gc/index.js +3 -5
  78. package/dist/gc/index.js.map +1 -1
  79. package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
  80. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  81. package/dist/id-compressor/appendOnlySortedMap.js +26 -68
  82. package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
  83. package/dist/id-compressor/finalSpace.d.ts +29 -0
  84. package/dist/id-compressor/finalSpace.d.ts.map +1 -0
  85. package/dist/id-compressor/finalSpace.js +62 -0
  86. package/dist/id-compressor/finalSpace.js.map +1 -0
  87. package/dist/id-compressor/idCompressor.d.ts +25 -250
  88. package/dist/id-compressor/idCompressor.d.ts.map +1 -1
  89. package/dist/id-compressor/idCompressor.js +390 -1153
  90. package/dist/id-compressor/idCompressor.js.map +1 -1
  91. package/dist/id-compressor/identifiers.d.ts +32 -0
  92. package/dist/id-compressor/identifiers.d.ts.map +1 -0
  93. package/dist/id-compressor/identifiers.js +15 -0
  94. package/dist/id-compressor/identifiers.js.map +1 -0
  95. package/dist/id-compressor/index.d.ts +5 -6
  96. package/dist/id-compressor/index.d.ts.map +1 -1
  97. package/dist/id-compressor/index.js +20 -26
  98. package/dist/id-compressor/index.js.map +1 -1
  99. package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
  100. package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
  101. package/dist/id-compressor/persistanceUtilities.js +43 -0
  102. package/dist/id-compressor/persistanceUtilities.js.map +1 -0
  103. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  104. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  105. package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
  106. package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  107. package/dist/id-compressor/sessions.d.ts +115 -0
  108. package/dist/id-compressor/sessions.d.ts.map +1 -0
  109. package/dist/id-compressor/sessions.js +305 -0
  110. package/dist/id-compressor/sessions.js.map +1 -0
  111. package/dist/id-compressor/utilities.d.ts +49 -0
  112. package/dist/id-compressor/utilities.d.ts.map +1 -0
  113. package/dist/id-compressor/utilities.js +166 -0
  114. package/dist/id-compressor/utilities.js.map +1 -0
  115. package/dist/index.d.ts +3 -3
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +6 -4
  118. package/dist/index.js.map +1 -1
  119. package/dist/metadata.d.ts +18 -0
  120. package/dist/metadata.d.ts.map +1 -0
  121. package/dist/metadata.js +7 -0
  122. package/dist/metadata.js.map +1 -0
  123. package/dist/opLifecycle/batchManager.d.ts +2 -1
  124. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  125. package/dist/opLifecycle/batchManager.js +15 -7
  126. package/dist/opLifecycle/batchManager.js.map +1 -1
  127. package/dist/opLifecycle/definitions.d.ts +11 -0
  128. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  129. package/dist/opLifecycle/definitions.js.map +1 -1
  130. package/dist/opLifecycle/index.d.ts +1 -1
  131. package/dist/opLifecycle/index.d.ts.map +1 -1
  132. package/dist/opLifecycle/index.js +2 -1
  133. package/dist/opLifecycle/index.js.map +1 -1
  134. package/dist/opLifecycle/opCompressor.d.ts +2 -2
  135. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  136. package/dist/opLifecycle/opCompressor.js +12 -7
  137. package/dist/opLifecycle/opCompressor.js.map +1 -1
  138. package/dist/opLifecycle/opDecompressor.d.ts +2 -2
  139. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  140. package/dist/opLifecycle/opDecompressor.js +30 -21
  141. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  142. package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
  143. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  144. package/dist/opLifecycle/opGroupingManager.js +19 -13
  145. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  146. package/dist/opLifecycle/opSplitter.d.ts +2 -2
  147. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  148. package/dist/opLifecycle/opSplitter.js +24 -19
  149. package/dist/opLifecycle/opSplitter.js.map +1 -1
  150. package/dist/opLifecycle/outbox.d.ts +39 -6
  151. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  152. package/dist/opLifecycle/outbox.js +138 -61
  153. package/dist/opLifecycle/outbox.js.map +1 -1
  154. package/dist/opLifecycle/remoteMessageProcessor.d.ts +6 -1
  155. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  156. package/dist/opLifecycle/remoteMessageProcessor.js +22 -8
  157. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  158. package/dist/opProperties.js +1 -2
  159. package/dist/opProperties.js.map +1 -1
  160. package/dist/packageVersion.d.ts +1 -1
  161. package/dist/packageVersion.js +1 -1
  162. package/dist/packageVersion.js.map +1 -1
  163. package/dist/pendingStateManager.d.ts +25 -10
  164. package/dist/pendingStateManager.d.ts.map +1 -1
  165. package/dist/pendingStateManager.js +101 -64
  166. package/dist/pendingStateManager.js.map +1 -1
  167. package/dist/scheduleManager.d.ts.map +1 -1
  168. package/dist/scheduleManager.js +43 -33
  169. package/dist/scheduleManager.js.map +1 -1
  170. package/dist/summary/index.d.ts +4 -4
  171. package/dist/summary/index.d.ts.map +1 -1
  172. package/dist/summary/index.js +3 -1
  173. package/dist/summary/index.js.map +1 -1
  174. package/dist/summary/orderedClientElection.d.ts +3 -3
  175. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  176. package/dist/summary/orderedClientElection.js +26 -27
  177. package/dist/summary/orderedClientElection.js.map +1 -1
  178. package/dist/summary/runWhileConnectedCoordinator.js +3 -3
  179. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  180. package/dist/summary/runningSummarizer.d.ts +31 -10
  181. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  182. package/dist/summary/runningSummarizer.js +271 -139
  183. package/dist/summary/runningSummarizer.js.map +1 -1
  184. package/dist/summary/summarizer.d.ts +8 -7
  185. package/dist/summary/summarizer.d.ts.map +1 -1
  186. package/dist/summary/summarizer.js +79 -78
  187. package/dist/summary/summarizer.js.map +1 -1
  188. package/dist/summary/summarizerClientElection.d.ts +2 -2
  189. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  190. package/dist/summary/summarizerClientElection.js +7 -11
  191. package/dist/summary/summarizerClientElection.js.map +1 -1
  192. package/dist/summary/summarizerHeuristics.js +10 -14
  193. package/dist/summary/summarizerHeuristics.js.map +1 -1
  194. package/dist/summary/summarizerNode/index.d.ts +1 -1
  195. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  196. package/dist/summary/summarizerNode/index.js.map +1 -1
  197. package/dist/summary/summarizerNode/summarizerNode.d.ts +40 -23
  198. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  199. package/dist/summary/summarizerNode/summarizerNode.js +144 -149
  200. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  201. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +25 -29
  202. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  203. package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  204. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  205. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +21 -16
  206. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  207. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +74 -123
  208. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  209. package/dist/summary/summarizerTypes.d.ts +44 -24
  210. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  211. package/dist/summary/summarizerTypes.js.map +1 -1
  212. package/dist/summary/summaryCollection.d.ts +2 -2
  213. package/dist/summary/summaryCollection.d.ts.map +1 -1
  214. package/dist/summary/summaryCollection.js +16 -13
  215. package/dist/summary/summaryCollection.js.map +1 -1
  216. package/dist/summary/summaryFormat.d.ts +4 -0
  217. package/dist/summary/summaryFormat.d.ts.map +1 -1
  218. package/dist/summary/summaryFormat.js +8 -5
  219. package/dist/summary/summaryFormat.js.map +1 -1
  220. package/dist/summary/summaryGenerator.d.ts +21 -6
  221. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  222. package/dist/summary/summaryGenerator.js +117 -54
  223. package/dist/summary/summaryGenerator.js.map +1 -1
  224. package/dist/summary/summaryManager.d.ts +8 -7
  225. package/dist/summary/summaryManager.d.ts.map +1 -1
  226. package/dist/summary/summaryManager.js +38 -28
  227. package/dist/summary/summaryManager.js.map +1 -1
  228. package/lib/batchTracker.d.ts +3 -2
  229. package/lib/batchTracker.d.ts.map +1 -1
  230. package/lib/batchTracker.js +5 -4
  231. package/lib/batchTracker.js.map +1 -1
  232. package/lib/blobManager.d.ts +15 -18
  233. package/lib/blobManager.d.ts.map +1 -1
  234. package/lib/blobManager.js +187 -146
  235. package/lib/blobManager.js.map +1 -1
  236. package/lib/connectionTelemetry.d.ts.map +1 -1
  237. package/lib/connectionTelemetry.js +23 -7
  238. package/lib/connectionTelemetry.js.map +1 -1
  239. package/lib/containerRuntime.d.ts +172 -35
  240. package/lib/containerRuntime.d.ts.map +1 -1
  241. package/lib/containerRuntime.js +678 -380
  242. package/lib/containerRuntime.js.map +1 -1
  243. package/lib/dataStore.d.ts.map +1 -1
  244. package/lib/dataStore.js +13 -5
  245. package/lib/dataStore.js.map +1 -1
  246. package/lib/dataStoreContext.d.ts +4 -4
  247. package/lib/dataStoreContext.d.ts.map +1 -1
  248. package/lib/dataStoreContext.js +49 -52
  249. package/lib/dataStoreContext.js.map +1 -1
  250. package/lib/dataStoreContexts.d.ts +1 -1
  251. package/lib/dataStoreContexts.d.ts.map +1 -1
  252. package/lib/dataStoreContexts.js +3 -3
  253. package/lib/dataStoreContexts.js.map +1 -1
  254. package/lib/dataStoreRegistry.js +1 -1
  255. package/lib/dataStoreRegistry.js.map +1 -1
  256. package/lib/dataStores.d.ts +23 -7
  257. package/lib/dataStores.d.ts.map +1 -1
  258. package/lib/dataStores.js +107 -64
  259. package/lib/dataStores.js.map +1 -1
  260. package/lib/deltaManagerProxyBase.d.ts +35 -0
  261. package/lib/deltaManagerProxyBase.d.ts.map +1 -0
  262. package/lib/deltaManagerProxyBase.js +73 -0
  263. package/lib/deltaManagerProxyBase.js.map +1 -0
  264. package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
  265. package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
  266. package/lib/deltaManagerSummarizerProxy.js +3 -1
  267. package/lib/deltaManagerSummarizerProxy.js.map +1 -1
  268. package/lib/deltaScheduler.d.ts.map +1 -1
  269. package/lib/deltaScheduler.js +7 -7
  270. package/lib/deltaScheduler.js.map +1 -1
  271. package/lib/error.d.ts +14 -0
  272. package/lib/error.d.ts.map +1 -0
  273. package/lib/error.js +17 -0
  274. package/lib/error.js.map +1 -0
  275. package/lib/gc/garbageCollection.d.ts +10 -9
  276. package/lib/gc/garbageCollection.d.ts.map +1 -1
  277. package/lib/gc/garbageCollection.js +61 -52
  278. package/lib/gc/garbageCollection.js.map +1 -1
  279. package/lib/gc/gcConfigs.d.ts.map +1 -1
  280. package/lib/gc/gcConfigs.js +16 -12
  281. package/lib/gc/gcConfigs.js.map +1 -1
  282. package/lib/gc/gcDefinitions.d.ts +17 -5
  283. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  284. package/lib/gc/gcDefinitions.js +13 -14
  285. package/lib/gc/gcDefinitions.js.map +1 -1
  286. package/lib/gc/gcHelpers.d.ts +0 -8
  287. package/lib/gc/gcHelpers.d.ts.map +1 -1
  288. package/lib/gc/gcHelpers.js +5 -17
  289. package/lib/gc/gcHelpers.js.map +1 -1
  290. package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
  291. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  292. package/lib/gc/gcSummaryStateTracker.js +20 -59
  293. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  294. package/lib/gc/gcTelemetry.d.ts +1 -1
  295. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  296. package/lib/gc/gcTelemetry.js +46 -36
  297. package/lib/gc/gcTelemetry.js.map +1 -1
  298. package/lib/gc/gcUnreferencedStateTracker.js +1 -1
  299. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  300. package/lib/gc/index.d.ts +2 -2
  301. package/lib/gc/index.d.ts.map +1 -1
  302. package/lib/gc/index.js +2 -2
  303. package/lib/gc/index.js.map +1 -1
  304. package/lib/id-compressor/appendOnlySortedMap.d.ts +8 -30
  305. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  306. package/lib/id-compressor/appendOnlySortedMap.js +25 -66
  307. package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
  308. package/lib/id-compressor/finalSpace.d.ts +29 -0
  309. package/lib/id-compressor/finalSpace.d.ts.map +1 -0
  310. package/lib/id-compressor/finalSpace.js +58 -0
  311. package/lib/id-compressor/finalSpace.js.map +1 -0
  312. package/lib/id-compressor/idCompressor.d.ts +25 -250
  313. package/lib/id-compressor/idCompressor.d.ts.map +1 -1
  314. package/lib/id-compressor/idCompressor.js +385 -1142
  315. package/lib/id-compressor/idCompressor.js.map +1 -1
  316. package/lib/id-compressor/identifiers.d.ts +32 -0
  317. package/lib/id-compressor/identifiers.d.ts.map +1 -0
  318. package/lib/id-compressor/identifiers.js +11 -0
  319. package/lib/id-compressor/identifiers.js.map +1 -0
  320. package/lib/id-compressor/index.d.ts +5 -6
  321. package/lib/id-compressor/index.d.ts.map +1 -1
  322. package/lib/id-compressor/index.js +5 -6
  323. package/lib/id-compressor/index.js.map +1 -1
  324. package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
  325. package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
  326. package/lib/id-compressor/persistanceUtilities.js +34 -0
  327. package/lib/id-compressor/persistanceUtilities.js.map +1 -0
  328. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  329. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  330. package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
  331. package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  332. package/lib/id-compressor/sessions.d.ts +115 -0
  333. package/lib/id-compressor/sessions.d.ts.map +1 -0
  334. package/lib/id-compressor/sessions.js +290 -0
  335. package/lib/id-compressor/sessions.js.map +1 -0
  336. package/lib/id-compressor/utilities.d.ts +49 -0
  337. package/lib/id-compressor/utilities.d.ts.map +1 -0
  338. package/lib/id-compressor/utilities.js +148 -0
  339. package/lib/id-compressor/utilities.js.map +1 -0
  340. package/lib/index.d.ts +3 -3
  341. package/lib/index.d.ts.map +1 -1
  342. package/lib/index.js +2 -2
  343. package/lib/index.js.map +1 -1
  344. package/lib/metadata.d.ts +18 -0
  345. package/lib/metadata.d.ts.map +1 -0
  346. package/lib/metadata.js +6 -0
  347. package/lib/metadata.js.map +1 -0
  348. package/lib/opLifecycle/batchManager.d.ts +2 -1
  349. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  350. package/lib/opLifecycle/batchManager.js +15 -7
  351. package/lib/opLifecycle/batchManager.js.map +1 -1
  352. package/lib/opLifecycle/definitions.d.ts +11 -0
  353. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  354. package/lib/opLifecycle/definitions.js.map +1 -1
  355. package/lib/opLifecycle/index.d.ts +1 -1
  356. package/lib/opLifecycle/index.d.ts.map +1 -1
  357. package/lib/opLifecycle/index.js +1 -1
  358. package/lib/opLifecycle/index.js.map +1 -1
  359. package/lib/opLifecycle/opCompressor.d.ts +2 -2
  360. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  361. package/lib/opLifecycle/opCompressor.js +10 -5
  362. package/lib/opLifecycle/opCompressor.js.map +1 -1
  363. package/lib/opLifecycle/opDecompressor.d.ts +2 -2
  364. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  365. package/lib/opLifecycle/opDecompressor.js +22 -13
  366. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  367. package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
  368. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  369. package/lib/opLifecycle/opGroupingManager.js +17 -11
  370. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  371. package/lib/opLifecycle/opSplitter.d.ts +2 -2
  372. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  373. package/lib/opLifecycle/opSplitter.js +15 -10
  374. package/lib/opLifecycle/opSplitter.js.map +1 -1
  375. package/lib/opLifecycle/outbox.d.ts +39 -6
  376. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  377. package/lib/opLifecycle/outbox.js +132 -56
  378. package/lib/opLifecycle/outbox.js.map +1 -1
  379. package/lib/opLifecycle/remoteMessageProcessor.d.ts +6 -1
  380. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  381. package/lib/opLifecycle/remoteMessageProcessor.js +23 -9
  382. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  383. package/lib/opProperties.js +1 -2
  384. package/lib/opProperties.js.map +1 -1
  385. package/lib/packageVersion.d.ts +1 -1
  386. package/lib/packageVersion.js +1 -1
  387. package/lib/packageVersion.js.map +1 -1
  388. package/lib/pendingStateManager.d.ts +25 -10
  389. package/lib/pendingStateManager.d.ts.map +1 -1
  390. package/lib/pendingStateManager.js +90 -53
  391. package/lib/pendingStateManager.js.map +1 -1
  392. package/lib/scheduleManager.d.ts.map +1 -1
  393. package/lib/scheduleManager.js +25 -15
  394. package/lib/scheduleManager.js.map +1 -1
  395. package/lib/summary/index.d.ts +4 -4
  396. package/lib/summary/index.d.ts.map +1 -1
  397. package/lib/summary/index.js +2 -2
  398. package/lib/summary/index.js.map +1 -1
  399. package/lib/summary/orderedClientElection.d.ts +3 -3
  400. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  401. package/lib/summary/orderedClientElection.js +21 -22
  402. package/lib/summary/orderedClientElection.js.map +1 -1
  403. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  404. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  405. package/lib/summary/runningSummarizer.d.ts +31 -10
  406. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  407. package/lib/summary/runningSummarizer.js +265 -133
  408. package/lib/summary/runningSummarizer.js.map +1 -1
  409. package/lib/summary/summarizer.d.ts +8 -7
  410. package/lib/summary/summarizer.d.ts.map +1 -1
  411. package/lib/summary/summarizer.js +75 -74
  412. package/lib/summary/summarizer.js.map +1 -1
  413. package/lib/summary/summarizerClientElection.d.ts +2 -2
  414. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  415. package/lib/summary/summarizerClientElection.js +6 -10
  416. package/lib/summary/summarizerClientElection.js.map +1 -1
  417. package/lib/summary/summarizerHeuristics.js +9 -13
  418. package/lib/summary/summarizerHeuristics.js.map +1 -1
  419. package/lib/summary/summarizerNode/index.d.ts +1 -1
  420. package/lib/summary/summarizerNode/index.d.ts.map +1 -1
  421. package/lib/summary/summarizerNode/index.js.map +1 -1
  422. package/lib/summary/summarizerNode/summarizerNode.d.ts +40 -23
  423. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  424. package/lib/summary/summarizerNode/summarizerNode.js +132 -137
  425. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  426. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +25 -29
  427. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  428. package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  429. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  430. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +21 -16
  431. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  432. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +70 -119
  433. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  434. package/lib/summary/summarizerTypes.d.ts +44 -24
  435. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  436. package/lib/summary/summarizerTypes.js.map +1 -1
  437. package/lib/summary/summaryCollection.d.ts +2 -2
  438. package/lib/summary/summaryCollection.d.ts.map +1 -1
  439. package/lib/summary/summaryCollection.js +9 -6
  440. package/lib/summary/summaryCollection.js.map +1 -1
  441. package/lib/summary/summaryFormat.d.ts +4 -0
  442. package/lib/summary/summaryFormat.d.ts.map +1 -1
  443. package/lib/summary/summaryFormat.js +7 -4
  444. package/lib/summary/summaryFormat.js.map +1 -1
  445. package/lib/summary/summaryGenerator.d.ts +21 -6
  446. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  447. package/lib/summary/summaryGenerator.js +109 -47
  448. package/lib/summary/summaryGenerator.js.map +1 -1
  449. package/lib/summary/summaryManager.d.ts +8 -7
  450. package/lib/summary/summaryManager.d.ts.map +1 -1
  451. package/lib/summary/summaryManager.js +35 -25
  452. package/lib/summary/summaryManager.js.map +1 -1
  453. package/package.json +30 -32
  454. package/src/batchTracker.ts +7 -5
  455. package/src/blobManager.ts +235 -172
  456. package/src/connectionTelemetry.ts +19 -5
  457. package/src/containerRuntime.ts +853 -431
  458. package/src/dataStore.ts +12 -4
  459. package/src/dataStoreContext.ts +49 -46
  460. package/src/dataStoreContexts.ts +4 -4
  461. package/src/dataStoreRegistry.ts +1 -1
  462. package/src/dataStores.ts +119 -80
  463. package/src/deltaManagerProxyBase.ts +111 -0
  464. package/src/deltaManagerSummarizerProxy.ts +4 -1
  465. package/src/deltaScheduler.ts +7 -11
  466. package/src/error.ts +18 -0
  467. package/src/gc/garbageCollection.md +53 -5
  468. package/src/gc/garbageCollection.ts +58 -51
  469. package/src/gc/gcConfigs.ts +4 -2
  470. package/src/gc/gcDefinitions.ts +17 -21
  471. package/src/gc/gcEarlyAdoption.md +145 -0
  472. package/src/gc/gcHelpers.ts +1 -12
  473. package/src/gc/gcSummaryStateTracker.ts +19 -65
  474. package/src/gc/gcTelemetry.ts +15 -13
  475. package/src/gc/gcUnreferencedStateTracker.ts +1 -1
  476. package/src/gc/index.ts +2 -4
  477. package/src/id-compressor/appendOnlySortedMap.ts +26 -87
  478. package/src/id-compressor/finalSpace.ts +67 -0
  479. package/src/id-compressor/idCompressor.ts +458 -1682
  480. package/src/id-compressor/identifiers.ts +42 -0
  481. package/src/id-compressor/index.ts +11 -20
  482. package/src/id-compressor/persistanceUtilities.ts +58 -0
  483. package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
  484. package/src/id-compressor/sessions.ts +405 -0
  485. package/src/id-compressor/utilities.ts +187 -0
  486. package/src/index.ts +9 -2
  487. package/src/metadata.ts +19 -0
  488. package/src/opLifecycle/README.md +20 -0
  489. package/src/opLifecycle/batchManager.ts +9 -1
  490. package/src/opLifecycle/definitions.ts +11 -0
  491. package/src/opLifecycle/index.ts +1 -1
  492. package/src/opLifecycle/opCompressor.ts +6 -5
  493. package/src/opLifecycle/opDecompressor.ts +47 -17
  494. package/src/opLifecycle/opGroupingManager.ts +18 -8
  495. package/src/opLifecycle/opSplitter.ts +10 -7
  496. package/src/opLifecycle/outbox.ts +177 -72
  497. package/src/opLifecycle/remoteMessageProcessor.ts +32 -9
  498. package/src/packageVersion.ts +1 -1
  499. package/src/pendingStateManager.ts +123 -78
  500. package/src/scheduleManager.ts +22 -11
  501. package/src/summary/index.ts +7 -4
  502. package/src/summary/orderedClientElection.ts +10 -6
  503. package/src/summary/runWhileConnectedCoordinator.ts +1 -1
  504. package/src/summary/runningSummarizer.ts +291 -163
  505. package/src/summary/summarizer.ts +27 -16
  506. package/src/summary/summarizerClientElection.ts +2 -2
  507. package/src/summary/summarizerHeuristics.ts +1 -1
  508. package/src/summary/summarizerNode/index.ts +2 -2
  509. package/src/summary/summarizerNode/summarizerNode.ts +142 -184
  510. package/src/summary/summarizerNode/summarizerNodeUtils.ts +27 -35
  511. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +72 -148
  512. package/src/summary/summarizerTypes.ts +49 -24
  513. package/src/summary/summaryCollection.ts +9 -4
  514. package/src/summary/summaryFormat.ts +9 -2
  515. package/src/summary/summaryGenerator.ts +72 -49
  516. package/src/summary/summaryManager.ts +44 -16
  517. package/dist/id-compressor/idRange.d.ts +0 -11
  518. package/dist/id-compressor/idRange.d.ts.map +0 -1
  519. package/dist/id-compressor/idRange.js +0 -29
  520. package/dist/id-compressor/idRange.js.map +0 -1
  521. package/dist/id-compressor/numericUuid.d.ts +0 -59
  522. package/dist/id-compressor/numericUuid.d.ts.map +0 -1
  523. package/dist/id-compressor/numericUuid.js +0 -325
  524. package/dist/id-compressor/numericUuid.js.map +0 -1
  525. package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
  526. package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  527. package/dist/id-compressor/sessionIdNormalizer.js +0 -488
  528. package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
  529. package/dist/id-compressor/utils.d.ts +0 -57
  530. package/dist/id-compressor/utils.d.ts.map +0 -1
  531. package/dist/id-compressor/utils.js +0 -90
  532. package/dist/id-compressor/utils.js.map +0 -1
  533. package/dist/id-compressor/uuidUtilities.d.ts +0 -30
  534. package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
  535. package/dist/id-compressor/uuidUtilities.js +0 -106
  536. package/dist/id-compressor/uuidUtilities.js.map +0 -1
  537. package/lib/id-compressor/idRange.d.ts +0 -11
  538. package/lib/id-compressor/idRange.d.ts.map +0 -1
  539. package/lib/id-compressor/idRange.js +0 -25
  540. package/lib/id-compressor/idRange.js.map +0 -1
  541. package/lib/id-compressor/numericUuid.d.ts +0 -59
  542. package/lib/id-compressor/numericUuid.d.ts.map +0 -1
  543. package/lib/id-compressor/numericUuid.js +0 -315
  544. package/lib/id-compressor/numericUuid.js.map +0 -1
  545. package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
  546. package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  547. package/lib/id-compressor/sessionIdNormalizer.js +0 -484
  548. package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
  549. package/lib/id-compressor/utils.d.ts +0 -57
  550. package/lib/id-compressor/utils.d.ts.map +0 -1
  551. package/lib/id-compressor/utils.js +0 -79
  552. package/lib/id-compressor/utils.js.map +0 -1
  553. package/lib/id-compressor/uuidUtilities.d.ts +0 -30
  554. package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
  555. package/lib/id-compressor/uuidUtilities.js +0 -98
  556. package/lib/id-compressor/uuidUtilities.js.map +0 -1
  557. package/src/id-compressor/idRange.ts +0 -35
  558. package/src/id-compressor/numericUuid.ts +0 -383
  559. package/src/id-compressor/sessionIdNormalizer.ts +0 -609
  560. package/src/id-compressor/utils.ts +0 -114
  561. package/src/id-compressor/uuidUtilities.ts +0 -123
@@ -8,7 +8,7 @@ exports.createRootSummarizerNode = exports.SummarizerNode = void 0;
8
8
  const runtime_definitions_1 = require("@fluidframework/runtime-definitions");
9
9
  const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
10
10
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
11
- const common_utils_1 = require("@fluidframework/common-utils");
11
+ const core_utils_1 = require("@fluidframework/core-utils");
12
12
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
13
13
  const summarizerNodeUtils_1 = require("./summarizerNodeUtils");
14
14
  /**
@@ -34,7 +34,6 @@ class SummarizerNode {
34
34
  _latestSummary, initialSummary, wipSummaryLogger,
35
35
  /** A unique id of this node to be logged when sending telemetry. */
36
36
  telemetryNodeId) {
37
- var _a;
38
37
  this.summarizeInternalFn = summarizeInternalFn;
39
38
  this._changeSequenceNumber = _changeSequenceNumber;
40
39
  this._latestSummary = _latestSummary;
@@ -44,14 +43,12 @@ class SummarizerNode {
44
43
  this.children = new Map();
45
44
  this.pendingSummaries = new Map();
46
45
  this.wipSkipRecursion = false;
47
- this.canReuseHandle = (_a = config.canReuseHandle) !== null && _a !== void 0 ? _a : true;
46
+ this.canReuseHandle = config.canReuseHandle ?? true;
48
47
  // All logs posted by the summarizer node should include the telemetryNodeId.
49
- this.logger = telemetry_utils_1.ChildLogger.create(baseLogger, undefined /* namespace */, {
50
- all: {
51
- id: {
52
- tag: telemetry_utils_1.TelemetryDataTag.CodeArtifact,
53
- value: this.telemetryNodeId,
54
- },
48
+ this.logger = (0, telemetry_utils_1.createChildLogger)({
49
+ logger: baseLogger,
50
+ properties: {
51
+ all: (0, telemetry_utils_1.tagCodeArtifacts)({ id: this.telemetryNodeId }),
55
52
  },
56
53
  });
57
54
  }
@@ -60,12 +57,11 @@ class SummarizerNode {
60
57
  * Returns 0 if there is not yet an acked summary.
61
58
  */
62
59
  get referenceSequenceNumber() {
63
- var _a, _b;
64
- return (_b = (_a = this._latestSummary) === null || _a === void 0 ? void 0 : _a.referenceSequenceNumber) !== null && _b !== void 0 ? _b : 0;
60
+ return this._latestSummary?.referenceSequenceNumber ?? 0;
65
61
  }
66
62
  startSummary(referenceSequenceNumber, summaryLogger) {
67
- (0, common_utils_1.assert)(this.wipSummaryLogger === undefined, 0x19f /* "wipSummaryLogger should not be set yet in startSummary" */);
68
- (0, common_utils_1.assert)(this.wipReferenceSequenceNumber === undefined, 0x1a0 /* "Already tracking a summary" */);
63
+ (0, core_utils_1.assert)(this.wipSummaryLogger === undefined, 0x19f /* "wipSummaryLogger should not be set yet in startSummary" */);
64
+ (0, core_utils_1.assert)(this.wipReferenceSequenceNumber === undefined, 0x1a0 /* "Already tracking a summary" */);
69
65
  this.wipSummaryLogger = summaryLogger;
70
66
  for (const child of this.children.values()) {
71
67
  child.startSummary(referenceSequenceNumber, this.wipSummaryLogger);
@@ -73,8 +69,8 @@ class SummarizerNode {
73
69
  this.wipReferenceSequenceNumber = referenceSequenceNumber;
74
70
  }
75
71
  async summarize(fullTree, trackState = true, telemetryContext) {
76
- (0, common_utils_1.assert)(this.isSummaryInProgress(), 0x1a1 /* "summarize should not be called when not tracking the summary" */);
77
- (0, common_utils_1.assert)(this.wipSummaryLogger !== undefined, 0x1a2 /* "wipSummaryLogger should have been set in startSummary or ctor" */);
72
+ (0, core_utils_1.assert)(this.isSummaryInProgress(), 0x1a1 /* "summarize should not be called when not tracking the summary" */);
73
+ (0, core_utils_1.assert)(this.wipSummaryLogger !== undefined, 0x1a2 /* "wipSummaryLogger should have been set in startSummary or ctor" */);
78
74
  // Try to reuse the tree if unchanged
79
75
  if (this.canReuseHandle && !fullTree && !this.hasChanged()) {
80
76
  const latestSummary = this._latestSummary;
@@ -98,7 +94,7 @@ class SummarizerNode {
98
94
  }
99
95
  // This assert is the same the other 0a1x1 assert `isSummaryInProgress`, the only difference is that typescript
100
96
  // complains if this assert isn't done this way
101
- (0, common_utils_1.assert)(this.wipReferenceSequenceNumber !== undefined, 0x5df /* Summarize should not be called when not tracking the summary */);
97
+ (0, core_utils_1.assert)(this.wipReferenceSequenceNumber !== undefined, 0x5df /* Summarize should not be called when not tracking the summary */);
102
98
  const incrementalSummaryContext = this._latestSummary !== undefined
103
99
  ? {
104
100
  summarySequenceNumber: this.wipReferenceSequenceNumber,
@@ -115,17 +111,97 @@ class SummarizerNode {
115
111
  return { summary: result.summary, stats: result.stats };
116
112
  }
117
113
  /**
118
- * Complete the WIP summary for the given proposalHandle
114
+ * Validates that the in-progress summary is correct, i.e., summarize should have run for all non-skipped
115
+ * nodes. This will only be called for the root summarizer node and is called by it recursively on all child nodes.
116
+ *
117
+ * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.
118
+ * In case of failure, additional information is returned indicating type of failure and where it was.
119
119
  */
120
- completeSummary(proposalHandle) {
121
- this.completeSummaryCore(proposalHandle, undefined, false);
120
+ validateSummary() {
121
+ return this.validateSummaryCore(false /* parentSkipRecursion */);
122
122
  }
123
123
  /**
124
- * Recursive implementation for completeSummary, with additional internal-only parameters
124
+ * Validates that the in-progress summary is correct for all nodes, i.e., summarize should have run for all
125
+ * non-skipped nodes.
126
+ * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
127
+ * In that case, the children will not have work-in-progress state.
128
+ *
129
+ * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.
130
+ * In case of failure, additional information is returned indicating type of failure and where it was.
125
131
  */
126
- completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion) {
127
- (0, common_utils_1.assert)(this.wipSummaryLogger !== undefined, 0x1a3 /* "wipSummaryLogger should have been set in startSummary or ctor" */);
128
- (0, common_utils_1.assert)(this.wipReferenceSequenceNumber !== undefined, 0x1a4 /* "Not tracking a summary" */);
132
+ validateSummaryCore(parentSkipRecursion) {
133
+ if (this.wasSummarizeMissed(parentSkipRecursion)) {
134
+ return {
135
+ success: false,
136
+ reason: "NodeDidNotSummarize",
137
+ id: {
138
+ tag: telemetry_utils_1.TelemetryDataTag.CodeArtifact,
139
+ value: this.telemetryNodeId,
140
+ },
141
+ // These errors are usually transient and should go away when summarize is retried.
142
+ retryAfterSeconds: 1,
143
+ };
144
+ }
145
+ if (parentSkipRecursion) {
146
+ return { success: true };
147
+ }
148
+ for (const child of this.children.values()) {
149
+ const result = child.validateSummaryCore(this.wipSkipRecursion || parentSkipRecursion);
150
+ // If any child fails, return the failure.
151
+ if (!result.success) {
152
+ return result;
153
+ }
154
+ }
155
+ return { success: true };
156
+ }
157
+ wasSummarizeMissed(parentSkipRecursion) {
158
+ (0, core_utils_1.assert)(this.wipSummaryLogger !== undefined, 0x6fc /* wipSummaryLogger should have been set in startSummary or ctor */);
159
+ (0, core_utils_1.assert)(this.wipReferenceSequenceNumber !== undefined, 0x6fd /* Not tracking a summary */);
160
+ // If the parent node skipped recursion, it did not call summarize on this node. So, summarize was not missed
161
+ // but was intentionally not called.
162
+ // Otherwise, summarize should have been called on this node and wipLocalPaths must be set.
163
+ if (parentSkipRecursion || this.wipLocalPaths !== undefined) {
164
+ return false;
165
+ }
166
+ /**
167
+ * The absence of wip local path indicates that summarize was not called for this node. Return failure.
168
+ * This can happen if:
169
+ * 1. A child node was created after summarize was already called on the parent. For example, a data store
170
+ * is realized (loaded) after summarize was called on it creating summarizer nodes for its DDSes. In this case,
171
+ * parentSkipRecursion will be true and the if block above would handle it.
172
+ * 2. A new node was created but summarize was never called on it. This can mean that the summary that is
173
+ * generated may not have the data from this node. We should not continue, log and throw an error. This
174
+ * will help us identify these cases and take appropriate action.
175
+ *
176
+ * This happens due to scenarios such as data store created during summarize. Such errors should go away when
177
+ * summarize is attempted again.
178
+ */
179
+ return true;
180
+ }
181
+ /**
182
+ * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending summary
183
+ * queue. We track this until we get an ack from the server for this summary.
184
+ * @param proposalHandle - The handle of the summary that was uploaded to the server.
185
+ */
186
+ completeSummary(proposalHandle, validate) {
187
+ this.completeSummaryCore(proposalHandle, undefined /* parentPath */, false /* parentSkipRecursion */, validate);
188
+ }
189
+ /**
190
+ * Recursive implementation for completeSummary, with additional internal-only parameters.
191
+ * @param proposalHandle - The handle of the summary that was uploaded to the server.
192
+ * @param parentPath - The path of the parent node which is used to build the path of this node.
193
+ * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
194
+ * In that case, the children will not have work-in-progress state.
195
+ * @param validate - true to validate that the in-progress summary is correct for all nodes.
196
+ */
197
+ completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate) {
198
+ if (validate && this.wasSummarizeMissed(parentSkipRecursion)) {
199
+ this.throwUnexpectedError({
200
+ eventName: "NodeDidNotSummarize",
201
+ proposalHandle,
202
+ });
203
+ }
204
+ (0, core_utils_1.assert)(this.wipReferenceSequenceNumber !== undefined, 0x1a4 /* "Not tracking a summary" */);
129
205
  let localPathsToUse = this.wipLocalPaths;
130
206
  if (parentSkipRecursion) {
131
207
  const latestSummary = this._latestSummary;
@@ -152,25 +228,17 @@ class SummarizerNode {
152
228
  return;
153
229
  }
154
230
  }
155
- /**
156
- * The absence of wip local path indicates that summarize was not called for this node. This can happen if:
157
- * 1. A child node was created after summarize was already called on the parent. For example, a data store
158
- * is realized (loaded) after summarize was called on it creating summarizer nodes for its DDSes. In this case,
159
- * parentSkipRecursion will be true and the if block above would handle it.
160
- * 2. A new node was created but summarize was never called on it. This can mean that the summary that is
161
- * generated may not have the data from this node. We should not continue, log and throw an error. This
162
- * will help us identify these cases and take appropriate action.
163
- */
164
- if (localPathsToUse === undefined) {
165
- this.throwUnexpectedError({
166
- eventName: "NodeNotSummarized",
167
- proposalHandle,
168
- });
169
- }
170
- const summary = new summarizerNodeUtils_1.SummaryNode(Object.assign(Object.assign({}, localPathsToUse), { referenceSequenceNumber: this.wipReferenceSequenceNumber, basePath: parentPath }));
231
+ // If localPathsToUse is undefined, it means summarize didn't run for this node and in that case the validate
232
+ // step should have failed.
233
+ (0, core_utils_1.assert)(localPathsToUse !== undefined, 0x6fe /* summarize didn't run for node */);
234
+ const summary = new summarizerNodeUtils_1.SummaryNode({
235
+ ...localPathsToUse,
236
+ referenceSequenceNumber: this.wipReferenceSequenceNumber,
237
+ basePath: parentPath,
238
+ });
171
239
  const fullPathForChildren = summary.fullPathForChildren;
172
240
  for (const child of this.children.values()) {
173
- child.completeSummaryCore(proposalHandle, fullPathForChildren, this.wipSkipRecursion || parentSkipRecursion);
241
+ child.completeSummaryCore(proposalHandle, fullPathForChildren, this.wipSkipRecursion || parentSkipRecursion, validate);
174
242
  }
175
243
  // Note that this overwrites existing pending summary with
176
244
  // the same proposalHandle. If proposalHandle is something like
@@ -192,26 +260,21 @@ class SummarizerNode {
192
260
  }
193
261
  /**
194
262
  * Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,
195
- * it becomes the latest summary. If the current summary is already ahead (e.g., loaded from a service summary),
196
- * we skip the update. Otherwise, we fetch the latest snapshot and update latest summary based off of that.
197
- *
198
- * @returns A RefreshSummaryResult type which returns information based on the following three scenarios:
199
- *
200
- * 1. The latest summary was not updated.
263
+ * it becomes the latest summary. If the current summary is already ahead, we skip the update.
264
+ * If the current summary is behind, then we do not refresh.
201
265
  *
202
- * 2. The latest summary was updated and the summary corresponding to the params was being tracked.
203
- *
204
- * 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this
205
- * case, the latest summary is updated based on the downloaded snapshot which is also returned.
266
+ * @returns true if the summary is tracked by this node, false otherwise.
206
267
  */
207
- async refreshLatestSummary(proposalHandle, summaryRefSeq, fetchLatestSnapshot, readAndParseBlob, correlatedSummaryLogger) {
268
+ async refreshLatestSummary(proposalHandle, summaryRefSeq) {
208
269
  const eventProps = {
209
270
  proposalHandle,
210
271
  summaryRefSeq,
211
272
  referenceSequenceNumber: this.referenceSequenceNumber,
212
273
  };
213
- return telemetry_utils_1.PerformanceEvent.timedExecAsync(this.logger, Object.assign({ eventName: "refreshLatestSummary" }, eventProps), async (event) => {
214
- var _a;
274
+ return telemetry_utils_1.PerformanceEvent.timedExecAsync(this.logger, {
275
+ eventName: "refreshLatestSummary",
276
+ ...eventProps,
277
+ }, async (event) => {
215
278
  // Refresh latest summary should not happen while a summary is in progress. If it does, it can result
216
279
  // in inconsistent state, so, we should not continue;
217
280
  if (this.isSummaryInProgress()) {
@@ -219,57 +282,18 @@ class SummarizerNode {
219
282
  inProgressSummaryRefSeq: this.wipReferenceSequenceNumber,
220
283
  });
221
284
  }
222
- if (proposalHandle !== undefined) {
223
- const maybeSummaryNode = this.pendingSummaries.get(proposalHandle);
224
- if (maybeSummaryNode !== undefined) {
225
- this.refreshLatestSummaryFromPending(proposalHandle, maybeSummaryNode.referenceSequenceNumber);
226
- eventProps.wasSummaryTracked = true;
227
- eventProps.latestSummaryUpdated = true;
228
- event.end(eventProps);
229
- return {
230
- latestSummaryUpdated: true,
231
- wasSummaryTracked: true,
232
- summaryRefSeq,
233
- };
234
- }
235
- const props = {
236
- summaryRefSeq,
237
- pendingSize: (_a = this.pendingSummaries.size) !== null && _a !== void 0 ? _a : undefined,
238
- };
239
- this.logger.sendTelemetryEvent({
240
- eventName: "PendingSummaryNotFound",
241
- proposalHandle,
242
- referenceSequenceNumber: this.referenceSequenceNumber,
243
- details: JSON.stringify(props),
244
- });
285
+ let isSummaryTracked = false;
286
+ let isSummaryNewer = false;
287
+ if (summaryRefSeq > this.referenceSequenceNumber) {
288
+ isSummaryNewer = true;
245
289
  }
246
- // If the summary for which refresh is called is older than the latest tracked summary, ignore it.
247
- if (this.referenceSequenceNumber >= summaryRefSeq) {
248
- eventProps.latestSummaryUpdated = false;
249
- event.end(eventProps);
250
- return { latestSummaryUpdated: false };
290
+ const maybeSummaryNode = this.pendingSummaries.get(proposalHandle);
291
+ if (maybeSummaryNode !== undefined) {
292
+ this.refreshLatestSummaryFromPending(proposalHandle, maybeSummaryNode.referenceSequenceNumber);
293
+ isSummaryTracked = true;
251
294
  }
252
- // Fetch the latest snapshot and refresh state from it. Note that we need to use the reference sequence number
253
- // of the fetched snapshot and not the "summaryRefSeq" that was passed in.
254
- const { snapshotTree, snapshotRefSeq: fetchedSnapshotRefSeq } = await fetchLatestSnapshot();
255
- // Possible re-entrancy. We may have updated latest summary state while fetching the snapshot. If the fetched
256
- // snapshot is older than the latest tracked summary, ignore it.
257
- if (this.referenceSequenceNumber >= fetchedSnapshotRefSeq) {
258
- eventProps.latestSummaryUpdated = false;
259
- event.end(eventProps);
260
- return { latestSummaryUpdated: false };
261
- }
262
- await this.refreshLatestSummaryFromSnapshot(fetchedSnapshotRefSeq, snapshotTree, undefined, summarizerNodeUtils_1.EscapedPath.create(""), correlatedSummaryLogger, readAndParseBlob);
263
- eventProps.latestSummaryUpdated = true;
264
- eventProps.wasSummaryTracked = false;
265
- eventProps.summaryRefSeq = fetchedSnapshotRefSeq;
266
- event.end(eventProps);
267
- return {
268
- latestSummaryUpdated: true,
269
- wasSummaryTracked: false,
270
- snapshotTree,
271
- summaryRefSeq: fetchedSnapshotRefSeq,
272
- };
295
+ event.end({ ...eventProps, isSummaryNewer, pendingSummaryFound: isSummaryTracked });
296
+ return { isSummaryTracked, isSummaryNewer };
273
297
  }, { start: true, end: true, cancel: "error" });
274
298
  }
275
299
  /**
@@ -282,11 +306,11 @@ class SummarizerNode {
282
306
  const summaryNode = this.pendingSummaries.get(proposalHandle);
283
307
  if (summaryNode === undefined) {
284
308
  // This should only happen if parent skipped recursion AND no prior summary existed.
285
- (0, common_utils_1.assert)(this._latestSummary === undefined, 0x1a6 /* "Not found pending summary, but this node has previously completed a summary" */);
309
+ (0, core_utils_1.assert)(this._latestSummary === undefined, 0x1a6 /* "Not found pending summary, but this node has previously completed a summary" */);
286
310
  return;
287
311
  }
288
312
  else {
289
- (0, common_utils_1.assert)(referenceSequenceNumber === summaryNode.referenceSequenceNumber, 0x1a7 /* Pending summary reference sequence number should be consistent */);
313
+ (0, core_utils_1.assert)(referenceSequenceNumber === summaryNode.referenceSequenceNumber, 0x1a7 /* Pending summary reference sequence number should be consistent */);
290
314
  // Clear earlier pending summaries
291
315
  this.pendingSummaries.delete(proposalHandle);
292
316
  }
@@ -297,37 +321,6 @@ class SummarizerNode {
297
321
  child.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);
298
322
  }
299
323
  }
300
- async refreshLatestSummaryFromSnapshot(referenceSequenceNumber, snapshotTree, basePath, localPath, correlatedSummaryLogger, readAndParseBlob) {
301
- // Possible re-entrancy. If we have already seen a summary later than this one, ignore it.
302
- if (this.referenceSequenceNumber >= referenceSequenceNumber) {
303
- return;
304
- }
305
- this.refreshLatestSummaryCore(referenceSequenceNumber);
306
- this._latestSummary = new summarizerNodeUtils_1.SummaryNode({
307
- referenceSequenceNumber,
308
- basePath,
309
- localPath,
310
- });
311
- const pathParts = [];
312
- const { childrenTree, childrenPathPart } = (0, summarizerNodeUtils_1.parseSummaryForSubtrees)(snapshotTree);
313
- if (childrenPathPart !== undefined) {
314
- pathParts.push(childrenPathPart);
315
- }
316
- if (pathParts.length > 0) {
317
- this._latestSummary.additionalPath = summarizerNodeUtils_1.EscapedPath.createAndConcat(pathParts);
318
- }
319
- // Propagate update to all child nodes
320
- const pathForChildren = this._latestSummary.fullPathForChildren;
321
- await Promise.all(Array.from(this.children)
322
- .filter(([id]) => {
323
- // Assuming subtrees missing from snapshot are newer than the snapshot,
324
- // but might be nice to assert this using earliest seq for node.
325
- return childrenTree.trees[id] !== undefined;
326
- })
327
- .map(async ([id, child]) => {
328
- return child.refreshLatestSummaryFromSnapshot(referenceSequenceNumber, childrenTree.trees[id], pathForChildren, summarizerNodeUtils_1.EscapedPath.create(id), correlatedSummaryLogger, readAndParseBlob);
329
- }));
330
- }
331
324
  refreshLatestSummaryCore(referenceSequenceNumber) {
332
325
  for (const [key, value] of this.pendingSummaries) {
333
326
  if (value.referenceSequenceNumber < referenceSequenceNumber) {
@@ -373,7 +366,7 @@ class SummarizerNode {
373
366
  * Attach information if it is created from an attach op.
374
367
  */
375
368
  createParam, config = {}) {
376
- (0, common_utils_1.assert)(!this.children.has(id), 0x1ab /* "Create SummarizerNode child already exists" */);
369
+ (0, core_utils_1.assert)(!this.children.has(id), 0x1ab /* "Create SummarizerNode child already exists" */);
377
370
  const createDetails = this.getCreateDetailsForChild(id, createParam);
378
371
  const child = new SummarizerNode(this.logger, summarizeInternalFn, config, createDetails.changeSequenceNumber, createDetails.latestSummary, createDetails.initialSummary, this.wipSummaryLogger, createDetails.telemetryNodeId);
379
372
  // There may be additional state that has to be updated in this child. For example, if a summary is being
@@ -393,7 +386,6 @@ class SummarizerNode {
393
386
  * @returns the details needed to create the child node.
394
387
  */
395
388
  getCreateDetailsForChild(id, createParam) {
396
- var _a, _b;
397
389
  let initialSummary;
398
390
  let latestSummary;
399
391
  let changeSequenceNumber;
@@ -418,7 +410,7 @@ class SummarizerNode {
418
410
  }
419
411
  case runtime_definitions_1.CreateSummarizerNodeSource.FromSummary: {
420
412
  if (this.initialSummary === undefined) {
421
- (0, common_utils_1.assert)(!!parentLatestSummary, 0x1ac /* "Cannot create child from summary if parent does not have latest summary" */);
413
+ (0, core_utils_1.assert)(!!parentLatestSummary, 0x1ac /* "Cannot create child from summary if parent does not have latest summary" */);
422
414
  }
423
415
  // fallthrough to local
424
416
  }
@@ -428,16 +420,16 @@ class SummarizerNode {
428
420
  let childSummary;
429
421
  if (parentInitialSummary.summary !== undefined) {
430
422
  const { childrenTree } = (0, summarizerNodeUtils_1.parseSummaryTreeForSubtrees)(parentInitialSummary.summary.summary);
431
- (0, common_utils_1.assert)(childrenTree.type === protocol_definitions_1.SummaryType.Tree, 0x1d6 /* "Parent summary object is not a tree" */);
423
+ (0, core_utils_1.assert)(childrenTree.type === protocol_definitions_1.SummaryType.Tree, 0x1d6 /* "Parent summary object is not a tree" */);
432
424
  childSummary = childrenTree.tree[id];
433
425
  }
434
426
  if (createParam.type === runtime_definitions_1.CreateSummarizerNodeSource.FromSummary) {
435
427
  // Locally created would not have differential subtree.
436
- (0, common_utils_1.assert)(!!childSummary, 0x1ad /* "Missing child summary tree" */);
428
+ (0, core_utils_1.assert)(!!childSummary, 0x1ad /* "Missing child summary tree" */);
437
429
  }
438
430
  let childSummaryWithStats;
439
431
  if (childSummary !== undefined) {
440
- (0, common_utils_1.assert)(childSummary.type === protocol_definitions_1.SummaryType.Tree, 0x1ae /* "Child summary object is not a tree" */);
432
+ (0, core_utils_1.assert)(childSummary.type === protocol_definitions_1.SummaryType.Tree, 0x1ae /* "Child summary object is not a tree" */);
441
433
  childSummaryWithStats = {
442
434
  summary: childSummary,
443
435
  stats: (0, runtime_utils_1.calculateStats)(childSummary),
@@ -449,16 +441,16 @@ class SummarizerNode {
449
441
  summary: childSummaryWithStats,
450
442
  };
451
443
  }
452
- latestSummary = parentLatestSummary === null || parentLatestSummary === void 0 ? void 0 : parentLatestSummary.createForChild(id);
453
- changeSequenceNumber = (_a = parentLatestSummary === null || parentLatestSummary === void 0 ? void 0 : parentLatestSummary.referenceSequenceNumber) !== null && _a !== void 0 ? _a : -1;
444
+ latestSummary = parentLatestSummary?.createForChild(id);
445
+ changeSequenceNumber = parentLatestSummary?.referenceSequenceNumber ?? -1;
454
446
  break;
455
447
  }
456
448
  default: {
457
449
  const type = createParam.type;
458
- (0, common_utils_1.unreachableCase)(createParam, `Unexpected CreateSummarizerNodeSource: ${type}`);
450
+ (0, core_utils_1.unreachableCase)(createParam, `Unexpected CreateSummarizerNodeSource: ${type}`);
459
451
  }
460
452
  }
461
- const childtelemetryNodeId = `${(_b = this.telemetryNodeId) !== null && _b !== void 0 ? _b : ""}/${id}`;
453
+ const childtelemetryNodeId = `${this.telemetryNodeId ?? ""}/${id}`;
462
454
  return {
463
455
  initialSummary,
464
456
  latestSummary,
@@ -506,10 +498,13 @@ class SummarizerNode {
506
498
  * Creates and throws an error due to unexpected conditions.
507
499
  */
508
500
  throwUnexpectedError(eventProps) {
509
- const error = new telemetry_utils_1.LoggingError(eventProps.eventName, Object.assign(Object.assign({}, eventProps), { referenceSequenceNumber: this.wipReferenceSequenceNumber, id: {
510
- tag: telemetry_utils_1.TelemetryDataTag.CodeArtifact,
511
- value: this.telemetryNodeId,
512
- } }));
501
+ const error = new telemetry_utils_1.LoggingError(eventProps.eventName, {
502
+ ...eventProps,
503
+ referenceSequenceNumber: this.wipReferenceSequenceNumber,
504
+ ...(0, telemetry_utils_1.tagCodeArtifacts)({
505
+ id: this.telemetryNodeId,
506
+ }),
507
+ });
513
508
  this.logger.sendErrorEvent(eventProps, error);
514
509
  throw error;
515
510
  }