@fluidframework/container-runtime 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (554) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-report/container-runtime.api.md +471 -52
  3. package/dist/batchTracker.d.ts +1 -1
  4. package/dist/batchTracker.d.ts.map +1 -1
  5. package/dist/batchTracker.js +4 -4
  6. package/dist/batchTracker.js.map +1 -1
  7. package/dist/blobManager.d.ts +33 -30
  8. package/dist/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager.js +82 -107
  10. package/dist/blobManager.js.map +1 -1
  11. package/dist/channelCollection.d.ts +27 -22
  12. package/dist/channelCollection.d.ts.map +1 -1
  13. package/dist/channelCollection.js +155 -165
  14. package/dist/channelCollection.js.map +1 -1
  15. package/dist/connectionTelemetry.d.ts +3 -3
  16. package/dist/connectionTelemetry.d.ts.map +1 -1
  17. package/dist/connectionTelemetry.js +17 -17
  18. package/dist/connectionTelemetry.js.map +1 -1
  19. package/dist/containerHandleContext.d.ts.map +1 -1
  20. package/dist/containerHandleContext.js +2 -2
  21. package/dist/containerHandleContext.js.map +1 -1
  22. package/dist/containerRuntime.d.ts +42 -39
  23. package/dist/containerRuntime.d.ts.map +1 -1
  24. package/dist/containerRuntime.js +425 -292
  25. package/dist/containerRuntime.js.map +1 -1
  26. package/dist/dataStore.d.ts +1 -1
  27. package/dist/dataStore.d.ts.map +1 -1
  28. package/dist/dataStore.js +8 -8
  29. package/dist/dataStore.js.map +1 -1
  30. package/dist/dataStoreContext.d.ts +58 -19
  31. package/dist/dataStoreContext.d.ts.map +1 -1
  32. package/dist/dataStoreContext.js +169 -114
  33. package/dist/dataStoreContext.js.map +1 -1
  34. package/dist/dataStoreContexts.d.ts +1 -0
  35. package/dist/dataStoreContexts.d.ts.map +1 -1
  36. package/dist/dataStoreContexts.js +12 -11
  37. package/dist/dataStoreContexts.js.map +1 -1
  38. package/dist/dataStoreRegistry.d.ts +5 -1
  39. package/dist/dataStoreRegistry.d.ts.map +1 -1
  40. package/dist/dataStoreRegistry.js +4 -4
  41. package/dist/dataStoreRegistry.js.map +1 -1
  42. package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
  43. package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
  44. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  45. package/dist/deltaScheduler.d.ts +1 -1
  46. package/dist/deltaScheduler.d.ts.map +1 -1
  47. package/dist/deltaScheduler.js +6 -6
  48. package/dist/deltaScheduler.js.map +1 -1
  49. package/dist/error.d.ts +1 -1
  50. package/dist/error.d.ts.map +1 -1
  51. package/dist/error.js +4 -4
  52. package/dist/error.js.map +1 -1
  53. package/dist/gc/garbageCollection.d.ts +3 -2
  54. package/dist/gc/garbageCollection.d.ts.map +1 -1
  55. package/dist/gc/garbageCollection.js +23 -23
  56. package/dist/gc/garbageCollection.js.map +1 -1
  57. package/dist/gc/gcConfigs.d.ts +2 -2
  58. package/dist/gc/gcConfigs.d.ts.map +1 -1
  59. package/dist/gc/gcConfigs.js +4 -5
  60. package/dist/gc/gcConfigs.js.map +1 -1
  61. package/dist/gc/gcDefinitions.d.ts +4 -5
  62. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  63. package/dist/gc/gcDefinitions.js.map +1 -1
  64. package/dist/gc/gcHelpers.d.ts +5 -1
  65. package/dist/gc/gcHelpers.d.ts.map +1 -1
  66. package/dist/gc/gcHelpers.js +21 -12
  67. package/dist/gc/gcHelpers.js.map +1 -1
  68. package/dist/gc/gcSummaryStateTracker.d.ts +2 -2
  69. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  70. package/dist/gc/gcSummaryStateTracker.js +11 -11
  71. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  72. package/dist/gc/gcTelemetry.d.ts +2 -1
  73. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  74. package/dist/gc/gcTelemetry.js +11 -9
  75. package/dist/gc/gcTelemetry.js.map +1 -1
  76. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  77. package/dist/gc/gcUnreferencedStateTracker.js +6 -6
  78. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  79. package/dist/gc/index.d.ts +1 -1
  80. package/dist/gc/index.d.ts.map +1 -1
  81. package/dist/gc/index.js +2 -1
  82. package/dist/gc/index.js.map +1 -1
  83. package/dist/index.d.ts +5 -2
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +12 -2
  86. package/dist/index.js.map +1 -1
  87. package/dist/legacy.d.ts +91 -0
  88. package/dist/messageTypes.d.ts +11 -5
  89. package/dist/messageTypes.d.ts.map +1 -1
  90. package/dist/messageTypes.js +4 -0
  91. package/dist/messageTypes.js.map +1 -1
  92. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  93. package/dist/opLifecycle/batchManager.js.map +1 -1
  94. package/dist/opLifecycle/definitions.d.ts +2 -20
  95. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  96. package/dist/opLifecycle/definitions.js.map +1 -1
  97. package/dist/opLifecycle/index.d.ts +3 -3
  98. package/dist/opLifecycle/index.d.ts.map +1 -1
  99. package/dist/opLifecycle/index.js +3 -1
  100. package/dist/opLifecycle/index.js.map +1 -1
  101. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  102. package/dist/opLifecycle/opCompressor.js +5 -6
  103. package/dist/opLifecycle/opCompressor.js.map +1 -1
  104. package/dist/opLifecycle/opDecompressor.d.ts +15 -4
  105. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  106. package/dist/opLifecycle/opDecompressor.js +62 -63
  107. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  108. package/dist/opLifecycle/opGroupingManager.d.ts +2 -1
  109. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  110. package/dist/opLifecycle/opGroupingManager.js +14 -16
  111. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  112. package/dist/opLifecycle/opSplitter.d.ts +12 -4
  113. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  114. package/dist/opLifecycle/opSplitter.js +63 -53
  115. package/dist/opLifecycle/opSplitter.js.map +1 -1
  116. package/dist/opLifecycle/outbox.d.ts +2 -1
  117. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  118. package/dist/opLifecycle/outbox.js +30 -29
  119. package/dist/opLifecycle/outbox.js.map +1 -1
  120. package/dist/opLifecycle/remoteMessageProcessor.d.ts +8 -0
  121. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  122. package/dist/opLifecycle/remoteMessageProcessor.js +36 -32
  123. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  124. package/dist/packageVersion.d.ts +1 -1
  125. package/dist/packageVersion.js +1 -1
  126. package/dist/packageVersion.js.map +1 -1
  127. package/dist/pendingStateManager.d.ts +1 -1
  128. package/dist/pendingStateManager.d.ts.map +1 -1
  129. package/dist/pendingStateManager.js +18 -18
  130. package/dist/pendingStateManager.js.map +1 -1
  131. package/dist/public.d.ts +12 -0
  132. package/dist/scheduleManager.d.ts +1 -1
  133. package/dist/scheduleManager.d.ts.map +1 -1
  134. package/dist/scheduleManager.js +28 -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 +390 -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 +12 -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/internal.d.ts +11 -0
  203. package/legacy.d.ts +11 -0
  204. package/lib/batchTracker.d.ts +1 -1
  205. package/lib/batchTracker.d.ts.map +1 -1
  206. package/lib/batchTracker.js +2 -2
  207. package/lib/batchTracker.js.map +1 -1
  208. package/lib/blobManager.d.ts +33 -30
  209. package/lib/blobManager.d.ts.map +1 -1
  210. package/lib/blobManager.js +48 -73
  211. package/lib/blobManager.js.map +1 -1
  212. package/lib/channelCollection.d.ts +27 -22
  213. package/lib/channelCollection.d.ts.map +1 -1
  214. package/lib/channelCollection.js +96 -106
  215. package/lib/channelCollection.js.map +1 -1
  216. package/lib/connectionTelemetry.d.ts +3 -3
  217. package/lib/connectionTelemetry.d.ts.map +1 -1
  218. package/lib/connectionTelemetry.js +3 -3
  219. package/lib/connectionTelemetry.js.map +1 -1
  220. package/lib/containerHandleContext.d.ts.map +1 -1
  221. package/lib/containerHandleContext.js +1 -1
  222. package/lib/containerHandleContext.js.map +1 -1
  223. package/lib/containerRuntime.d.ts +42 -39
  224. package/lib/containerRuntime.d.ts.map +1 -1
  225. package/lib/containerRuntime.js +276 -141
  226. package/lib/containerRuntime.js.map +1 -1
  227. package/lib/dataStore.d.ts +1 -1
  228. package/lib/dataStore.d.ts.map +1 -1
  229. package/lib/dataStore.js +3 -3
  230. package/lib/dataStore.js.map +1 -1
  231. package/lib/dataStoreContext.d.ts +58 -19
  232. package/lib/dataStoreContext.d.ts.map +1 -1
  233. package/lib/dataStoreContext.js +107 -52
  234. package/lib/dataStoreContext.js.map +1 -1
  235. package/lib/dataStoreContexts.d.ts +1 -0
  236. package/lib/dataStoreContexts.d.ts.map +1 -1
  237. package/lib/dataStoreContexts.js +3 -2
  238. package/lib/dataStoreContexts.js.map +1 -1
  239. package/lib/dataStoreRegistry.d.ts +5 -1
  240. package/lib/dataStoreRegistry.d.ts.map +1 -1
  241. package/lib/dataStoreRegistry.js +1 -1
  242. package/lib/dataStoreRegistry.js.map +1 -1
  243. package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
  244. package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
  245. package/lib/deltaManagerSummarizerProxy.js.map +1 -1
  246. package/lib/deltaScheduler.d.ts +1 -1
  247. package/lib/deltaScheduler.d.ts.map +1 -1
  248. package/lib/deltaScheduler.js +1 -1
  249. package/lib/deltaScheduler.js.map +1 -1
  250. package/lib/error.d.ts +1 -1
  251. package/lib/error.d.ts.map +1 -1
  252. package/lib/error.js +2 -2
  253. package/lib/error.js.map +1 -1
  254. package/lib/gc/garbageCollection.d.ts +3 -2
  255. package/lib/gc/garbageCollection.d.ts.map +1 -1
  256. package/lib/gc/garbageCollection.js +8 -8
  257. package/lib/gc/garbageCollection.js.map +1 -1
  258. package/lib/gc/gcConfigs.d.ts +2 -2
  259. package/lib/gc/gcConfigs.d.ts.map +1 -1
  260. package/lib/gc/gcConfigs.js +4 -5
  261. package/lib/gc/gcConfigs.js.map +1 -1
  262. package/lib/gc/gcDefinitions.d.ts +4 -5
  263. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  264. package/lib/gc/gcDefinitions.js.map +1 -1
  265. package/lib/gc/gcHelpers.d.ts +5 -1
  266. package/lib/gc/gcHelpers.d.ts.map +1 -1
  267. package/lib/gc/gcHelpers.js +10 -2
  268. package/lib/gc/gcHelpers.js.map +1 -1
  269. package/lib/gc/gcSummaryStateTracker.d.ts +2 -2
  270. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  271. package/lib/gc/gcSummaryStateTracker.js +2 -2
  272. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  273. package/lib/gc/gcTelemetry.d.ts +2 -1
  274. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  275. package/lib/gc/gcTelemetry.js +4 -2
  276. package/lib/gc/gcTelemetry.js.map +1 -1
  277. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  278. package/lib/gc/gcUnreferencedStateTracker.js +2 -2
  279. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  280. package/lib/gc/index.d.ts +1 -1
  281. package/lib/gc/index.d.ts.map +1 -1
  282. package/lib/gc/index.js +1 -1
  283. package/lib/gc/index.js.map +1 -1
  284. package/lib/index.d.ts +5 -2
  285. package/lib/index.d.ts.map +1 -1
  286. package/lib/index.js +5 -2
  287. package/lib/index.js.map +1 -1
  288. package/lib/legacy.d.ts +91 -0
  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 +19 -18
  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 -32
  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/public.d.ts +12 -0
  333. package/lib/scheduleManager.d.ts +1 -1
  334. package/lib/scheduleManager.d.ts.map +1 -1
  335. package/lib/scheduleManager.js +7 -3
  336. package/lib/scheduleManager.js.map +1 -1
  337. package/lib/storageServiceWithAttachBlobs.d.ts +2 -2
  338. package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -1
  339. package/lib/storageServiceWithAttachBlobs.js +1 -1
  340. package/lib/storageServiceWithAttachBlobs.js.map +1 -1
  341. package/lib/summary/documentSchema.d.ts +209 -0
  342. package/lib/summary/documentSchema.d.ts.map +1 -0
  343. package/lib/summary/documentSchema.js +386 -0
  344. package/lib/summary/documentSchema.js.map +1 -0
  345. package/lib/summary/index.d.ts +2 -1
  346. package/lib/summary/index.d.ts.map +1 -1
  347. package/lib/summary/index.js +1 -0
  348. package/lib/summary/index.js.map +1 -1
  349. package/lib/summary/orderedClientElection.d.ts +2 -2
  350. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  351. package/lib/summary/orderedClientElection.js +7 -2
  352. package/lib/summary/orderedClientElection.js.map +1 -1
  353. package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -1
  354. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  355. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  356. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  357. package/lib/summary/runningSummarizer.d.ts +3 -3
  358. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  359. package/lib/summary/runningSummarizer.js +3 -3
  360. package/lib/summary/runningSummarizer.js.map +1 -1
  361. package/lib/summary/summarizer.d.ts +3 -2
  362. package/lib/summary/summarizer.d.ts.map +1 -1
  363. package/lib/summary/summarizer.js +3 -3
  364. package/lib/summary/summarizer.js.map +1 -1
  365. package/lib/summary/summarizerClientElection.d.ts +2 -2
  366. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  367. package/lib/summary/summarizerClientElection.js.map +1 -1
  368. package/lib/summary/summarizerHeuristics.d.ts +1 -1
  369. package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
  370. package/lib/summary/summarizerHeuristics.js +1 -1
  371. package/lib/summary/summarizerHeuristics.js.map +1 -1
  372. package/lib/summary/summarizerNode/summarizerNode.d.ts +3 -2
  373. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  374. package/lib/summary/summarizerNode/summarizerNode.js +5 -5
  375. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  376. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
  377. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  378. package/lib/summary/summarizerNode/summarizerNodeUtils.js +1 -1
  379. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  380. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -1
  381. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  382. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
  383. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  384. package/lib/summary/summarizerTypes.d.ts +5 -3
  385. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  386. package/lib/summary/summarizerTypes.js.map +1 -1
  387. package/lib/summary/summaryCollection.d.ts +2 -2
  388. package/lib/summary/summaryCollection.d.ts.map +1 -1
  389. package/lib/summary/summaryCollection.js +1 -1
  390. package/lib/summary/summaryCollection.js.map +1 -1
  391. package/lib/summary/summaryFormat.d.ts +6 -17
  392. package/lib/summary/summaryFormat.d.ts.map +1 -1
  393. package/lib/summary/summaryFormat.js +3 -3
  394. package/lib/summary/summaryFormat.js.map +1 -1
  395. package/lib/summary/summaryGenerator.d.ts +4 -3
  396. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  397. package/lib/summary/summaryGenerator.js +4 -4
  398. package/lib/summary/summaryGenerator.js.map +1 -1
  399. package/lib/summary/summaryManager.d.ts +1 -1
  400. package/lib/summary/summaryManager.d.ts.map +1 -1
  401. package/lib/summary/summaryManager.js +9 -8
  402. package/lib/summary/summaryManager.js.map +1 -1
  403. package/package.json +57 -65
  404. package/src/batchTracker.ts +4 -3
  405. package/src/blobManager.ts +100 -77
  406. package/src/channelCollection.ts +180 -165
  407. package/src/connectionTelemetry.ts +12 -12
  408. package/src/containerHandleContext.ts +3 -2
  409. package/src/containerRuntime.ts +481 -277
  410. package/src/dataStore.ts +9 -4
  411. package/src/dataStoreContext.ts +195 -93
  412. package/src/dataStoreContexts.ts +5 -2
  413. package/src/dataStoreRegistry.ts +3 -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 +21 -20
  418. package/src/gc/gcConfigs.ts +15 -18
  419. package/src/gc/gcDefinitions.ts +6 -8
  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 +22 -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 +90 -100
  433. package/src/opLifecycle/opGroupingManager.ts +12 -14
  434. package/src/opLifecycle/opSplitter.ts +76 -48
  435. package/src/opLifecycle/outbox.ts +30 -38
  436. package/src/opLifecycle/remoteMessageProcessor.ts +43 -55
  437. package/src/packageVersion.ts +1 -1
  438. package/src/pendingStateManager.ts +6 -6
  439. package/src/scheduleManager.ts +10 -8
  440. package/src/storageServiceWithAttachBlobs.ts +2 -2
  441. package/src/summary/documentSchema.ts +631 -0
  442. package/src/summary/index.ts +10 -1
  443. package/src/summary/orderedClientElection.ts +7 -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/api-extractor-cjs.json +0 -8
  458. package/dist/container-runtime-alpha.d.ts +0 -1753
  459. package/dist/container-runtime-beta.d.ts +0 -268
  460. package/dist/container-runtime-public.d.ts +0 -268
  461. package/dist/container-runtime-untrimmed.d.ts +0 -1893
  462. package/lib/container-runtime-alpha.d.ts +0 -1753
  463. package/lib/container-runtime-beta.d.ts +0 -268
  464. package/lib/container-runtime-public.d.ts +0 -268
  465. package/lib/container-runtime-untrimmed.d.ts +0 -1893
  466. package/lib/test/batchTracker.spec.js +0 -88
  467. package/lib/test/batchTracker.spec.js.map +0 -1
  468. package/lib/test/blobManager.spec.js +0 -835
  469. package/lib/test/blobManager.spec.js.map +0 -1
  470. package/lib/test/channelCollection.spec.js +0 -141
  471. package/lib/test/channelCollection.spec.js.map +0 -1
  472. package/lib/test/containerRuntime.spec.js +0 -1748
  473. package/lib/test/containerRuntime.spec.js.map +0 -1
  474. package/lib/test/dataStoreContext.spec.js +0 -801
  475. package/lib/test/dataStoreContext.spec.js.map +0 -1
  476. package/lib/test/dataStoreCreation.spec.js +0 -312
  477. package/lib/test/dataStoreCreation.spec.js.map +0 -1
  478. package/lib/test/dataStoreRegistry.spec.js +0 -26
  479. package/lib/test/dataStoreRegistry.spec.js.map +0 -1
  480. package/lib/test/fuzz/fuzzUtils.js +0 -66
  481. package/lib/test/fuzz/fuzzUtils.js.map +0 -1
  482. package/lib/test/fuzz/summarizer.fuzz.spec.js +0 -31
  483. package/lib/test/fuzz/summarizer.fuzz.spec.js.map +0 -1
  484. package/lib/test/fuzz/summarizerFuzzMocks.js +0 -162
  485. package/lib/test/fuzz/summarizerFuzzMocks.js.map +0 -1
  486. package/lib/test/fuzz/summarizerFuzzSuite.js +0 -106
  487. package/lib/test/fuzz/summarizerFuzzSuite.js.map +0 -1
  488. package/lib/test/gc/garbageCollection.spec.js +0 -1465
  489. package/lib/test/gc/garbageCollection.spec.js.map +0 -1
  490. package/lib/test/gc/gcConfigs.spec.js +0 -690
  491. package/lib/test/gc/gcConfigs.spec.js.map +0 -1
  492. package/lib/test/gc/gcHelpers.spec.js +0 -110
  493. package/lib/test/gc/gcHelpers.spec.js.map +0 -1
  494. package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js +0 -68
  495. package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js.map +0 -1
  496. package/lib/test/gc/gcStats.spec.js +0 -391
  497. package/lib/test/gc/gcStats.spec.js.map +0 -1
  498. package/lib/test/gc/gcSummaryStateTracker.spec.js +0 -228
  499. package/lib/test/gc/gcSummaryStateTracker.spec.js.map +0 -1
  500. package/lib/test/gc/gcTelemetry.spec.js +0 -530
  501. package/lib/test/gc/gcTelemetry.spec.js.map +0 -1
  502. package/lib/test/gc/gcUnitTestHelpers.js +0 -29
  503. package/lib/test/gc/gcUnitTestHelpers.js.map +0 -1
  504. package/lib/test/gc/gcUnreferencedStateTracker.spec.js +0 -192
  505. package/lib/test/gc/gcUnreferencedStateTracker.spec.js.map +0 -1
  506. package/lib/test/getPendingBlobs.spec.js +0 -193
  507. package/lib/test/getPendingBlobs.spec.js.map +0 -1
  508. package/lib/test/hardwareStats.spec.js +0 -93
  509. package/lib/test/hardwareStats.spec.js.map +0 -1
  510. package/lib/test/index.js +0 -6
  511. package/lib/test/index.js.map +0 -1
  512. package/lib/test/opLifecycle/OpGroupingManager.spec.js +0 -225
  513. package/lib/test/opLifecycle/OpGroupingManager.spec.js.map +0 -1
  514. package/lib/test/opLifecycle/batchManager.spec.js +0 -189
  515. package/lib/test/opLifecycle/batchManager.spec.js.map +0 -1
  516. package/lib/test/opLifecycle/opCompressor.spec.js +0 -74
  517. package/lib/test/opLifecycle/opCompressor.spec.js.map +0 -1
  518. package/lib/test/opLifecycle/opDecompressor.spec.js +0 -218
  519. package/lib/test/opLifecycle/opDecompressor.spec.js.map +0 -1
  520. package/lib/test/opLifecycle/opSplitter.spec.js +0 -272
  521. package/lib/test/opLifecycle/opSplitter.spec.js.map +0 -1
  522. package/lib/test/opLifecycle/outbox.spec.js +0 -675
  523. package/lib/test/opLifecycle/outbox.spec.js.map +0 -1
  524. package/lib/test/opLifecycle/remoteMessageProcessor.spec.js +0 -196
  525. package/lib/test/opLifecycle/remoteMessageProcessor.spec.js.map +0 -1
  526. package/lib/test/pendingStateManager.spec.js +0 -329
  527. package/lib/test/pendingStateManager.spec.js.map +0 -1
  528. package/lib/test/scheduleManager.spec.js +0 -270
  529. package/lib/test/scheduleManager.spec.js.map +0 -1
  530. package/lib/test/summarizerNode.spec.js +0 -326
  531. package/lib/test/summarizerNode.spec.js.map +0 -1
  532. package/lib/test/summarizerNodeWithGc.spec.js +0 -318
  533. package/lib/test/summarizerNodeWithGc.spec.js.map +0 -1
  534. package/lib/test/summary/orderedClientElection.spec.js +0 -535
  535. package/lib/test/summary/orderedClientElection.spec.js.map +0 -1
  536. package/lib/test/summary/runningSummarizer.spec.js +0 -1349
  537. package/lib/test/summary/runningSummarizer.spec.js.map +0 -1
  538. package/lib/test/summary/summarizer.spec.js +0 -29
  539. package/lib/test/summary/summarizer.spec.js.map +0 -1
  540. package/lib/test/summary/summarizerClientElection.spec.js +0 -436
  541. package/lib/test/summary/summarizerClientElection.spec.js.map +0 -1
  542. package/lib/test/summary/summarizerHeuristics.spec.js +0 -289
  543. package/lib/test/summary/summarizerHeuristics.spec.js.map +0 -1
  544. package/lib/test/summary/summaryCollection.spec.js +0 -200
  545. package/lib/test/summary/summaryCollection.spec.js.map +0 -1
  546. package/lib/test/summary/summaryManager.spec.js +0 -430
  547. package/lib/test/summary/summaryManager.spec.js.map +0 -1
  548. package/lib/test/summary/testQuorumClients.js +0 -34
  549. package/lib/test/summary/testQuorumClients.js.map +0 -1
  550. package/lib/test/throttler.spec.js +0 -175
  551. package/lib/test/throttler.spec.js.map +0 -1
  552. package/lib/test/types/validateContainerRuntimePrevious.generated.js +0 -180
  553. package/lib/test/types/validateContainerRuntimePrevious.generated.js.map +0 -1
  554. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -1,801 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { strict as assert } from "assert";
6
- import { stringToBuffer } from "@fluid-internal/client-utils";
7
- import { LazyPromise } from "@fluidframework/core-utils";
8
- import { AttachState, ContainerErrorTypes } from "@fluidframework/container-definitions";
9
- import { SummaryType, } from "@fluidframework/protocol-definitions";
10
- import { CreateSummarizerNodeSource, channelsTreeName, } from "@fluidframework/runtime-definitions";
11
- import { GCDataBuilder, convertSummaryTreeToITree } from "@fluidframework/runtime-utils";
12
- import { isFluidError, MockLogger, TelemetryDataTag, createChildLogger, } from "@fluidframework/telemetry-utils";
13
- import { MockFluidDataStoreRuntime, validateAssertionError, } from "@fluidframework/test-runtime-utils";
14
- import { DataStoreMessageType, FluidObjectHandle } from "@fluidframework/datastore";
15
- import { wrapContextForInnerChannel } from "../channelCollection.js";
16
- import { LocalDetachedFluidDataStoreContext, LocalFluidDataStoreContext, RemoteFluidDataStoreContext, } from "../dataStoreContext.js";
17
- import { StorageServiceWithAttachBlobs } from "../storageServiceWithAttachBlobs.js";
18
- import { createRootSummarizerNodeWithGC, dataStoreAttributesBlobName, summarizerClientType, } from "../summary/index.js";
19
- import { channelToDataStore } from "../dataStore.js";
20
- describe("Data Store Context Tests", () => {
21
- const dataStoreId = "Test1";
22
- const emptyGCData = { gcNodes: {} };
23
- let createSummarizerNodeFn;
24
- describe("LocalFluidDataStoreContext", () => {
25
- let localDataStoreContext;
26
- let storage;
27
- let scope;
28
- const makeLocallyVisibleFn = () => { };
29
- let containerRuntime;
30
- let summarizerNode;
31
- function createContainerRuntime(logger = createChildLogger(), clientDetails = {}, submitMessage = (type, contents, localOpMetadata) => { }) {
32
- const factory = {
33
- type: "store-type",
34
- get IFluidDataStoreFactory() {
35
- return factory;
36
- },
37
- instantiateDataStore: async (context) => new MockFluidDataStoreRuntime(),
38
- };
39
- const registry = {
40
- get IFluidDataStoreRegistry() {
41
- return registry;
42
- },
43
- get: async (pkg) => (pkg === "BOGUS" ? undefined : factory),
44
- };
45
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
46
- return {
47
- IFluidDataStoreRegistry: registry,
48
- on: (event, listener) => { },
49
- logger,
50
- clientDetails,
51
- submitMessage,
52
- };
53
- }
54
- beforeEach(async () => {
55
- summarizerNode = createRootSummarizerNodeWithGC(createChildLogger(), (() => undefined), 0, 0);
56
- summarizerNode.startSummary(0, createChildLogger(), 0);
57
- createSummarizerNodeFn = (summarizeInternal, getGCDataFn) => summarizerNode.createChild(summarizeInternal, dataStoreId, { type: CreateSummarizerNodeSource.Local }, undefined, getGCDataFn);
58
- containerRuntime = createContainerRuntime();
59
- });
60
- describe("Initialization", () => {
61
- it("rejects ids with forward slashes", async () => {
62
- const invalidId = "beforeSlash/afterSlash";
63
- const codeBlock = () => new LocalFluidDataStoreContext({
64
- id: invalidId,
65
- pkg: ["TestDataStore1"],
66
- parentContext: wrapContextForInnerChannel(invalidId, containerRuntime),
67
- storage,
68
- scope,
69
- createSummarizerNodeFn,
70
- makeLocallyVisibleFn,
71
- snapshotTree: undefined,
72
- isRootDataStore: true,
73
- });
74
- assert.throws(codeBlock, (e) => validateAssertionError(e, "Data store ID contains slash"));
75
- });
76
- it("Errors thrown during realize are wrapped as DataProcessingError", async () => {
77
- const fullPackageName = ["BOGUS1", "BOGUS2"];
78
- localDataStoreContext = new LocalFluidDataStoreContext({
79
- id: dataStoreId,
80
- pkg: fullPackageName,
81
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
82
- storage,
83
- scope,
84
- createSummarizerNodeFn,
85
- makeLocallyVisibleFn,
86
- snapshotTree: undefined,
87
- isRootDataStore: true,
88
- });
89
- try {
90
- await localDataStoreContext.realize();
91
- assert.fail("realize should have thrown an error due to empty pkg array");
92
- }
93
- catch (e) {
94
- assert(isFluidError(e), "Expected a valid Fluid Error to be thrown");
95
- assert.equal(e.errorType, ContainerErrorTypes.dataProcessingError, "Error should be a DataProcessingError");
96
- const props = e.getTelemetryProperties();
97
- assert.strictEqual(props.fullPackageName?.value, fullPackageName.join("/"), "The error should have the full package name in its telemetry properties");
98
- assert.equal(props.failedPkgPath?.value, "BOGUS1", "The error should have the failed package path in its telemetry properties");
99
- assert.equal(props.fluidDataStoreId?.value, "Test1", "The error should have the fluidDataStoreId in its telemetry properties");
100
- }
101
- });
102
- it("can initialize correctly and generate attributes", async () => {
103
- localDataStoreContext = new LocalFluidDataStoreContext({
104
- id: dataStoreId,
105
- pkg: ["TestDataStore1"],
106
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
107
- storage,
108
- scope,
109
- createSummarizerNodeFn,
110
- makeLocallyVisibleFn,
111
- snapshotTree: undefined,
112
- isRootDataStore: true,
113
- });
114
- await localDataStoreContext.realize();
115
- const { attachSummary: { summary }, type, } = localDataStoreContext.getAttachData(/* includeGCData: */ false);
116
- const snapshot = convertSummaryTreeToITree(summary);
117
- const attributesEntry = snapshot.entries.find((e) => e.path === dataStoreAttributesBlobName);
118
- assert(attributesEntry !== undefined, "There is no attributes blob in the summary tree");
119
- // Assume that it is in write format, will see errors if not.
120
- const contents = JSON.parse(attributesEntry.value.contents);
121
- const dataStoreAttributes = {
122
- pkg: JSON.stringify(["TestDataStore1"]),
123
- summaryFormatVersion: 2,
124
- isRootDataStore: true,
125
- };
126
- assert.strictEqual(contents.pkg, dataStoreAttributes.pkg, "Local DataStore package does not match.");
127
- assert.strictEqual(contents.summaryFormatVersion, dataStoreAttributes.summaryFormatVersion, "Local DataStore snapshot version does not match.");
128
- assert.strictEqual(contents.isRootDataStore, dataStoreAttributes.isRootDataStore, "Local DataStore root state does not match");
129
- assert.strictEqual(type, "TestDataStore1", "Attach message type does not match.");
130
- });
131
- it("should generate exception when incorrectly created with array of packages", async () => {
132
- let exception = false;
133
- localDataStoreContext = new LocalFluidDataStoreContext({
134
- id: dataStoreId,
135
- pkg: ["TestComp", "SubComp"],
136
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
137
- storage,
138
- scope,
139
- createSummarizerNodeFn,
140
- makeLocallyVisibleFn,
141
- snapshotTree: undefined,
142
- isRootDataStore: false,
143
- });
144
- await localDataStoreContext.realize().catch((error) => {
145
- exception = true;
146
- });
147
- assert.strictEqual(exception, true, "Exception did not occur.");
148
- });
149
- it("can initialize and generate attributes when correctly created with array of packages", async () => {
150
- const registryWithSubRegistries = {};
151
- registryWithSubRegistries.IFluidDataStoreFactory = registryWithSubRegistries;
152
- registryWithSubRegistries.IFluidDataStoreRegistry = registryWithSubRegistries;
153
- registryWithSubRegistries.get = async (pkg) => Promise.resolve(registryWithSubRegistries);
154
- registryWithSubRegistries.instantiateDataStore = async (context) => new MockFluidDataStoreRuntime();
155
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
156
- containerRuntime = {
157
- IFluidDataStoreRegistry: registryWithSubRegistries,
158
- on: (event, listener) => { },
159
- clientDetails: {},
160
- };
161
- localDataStoreContext = new LocalFluidDataStoreContext({
162
- id: dataStoreId,
163
- pkg: ["TestComp", "SubComp"],
164
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
165
- storage,
166
- scope,
167
- createSummarizerNodeFn,
168
- makeLocallyVisibleFn,
169
- snapshotTree: undefined,
170
- isRootDataStore: false,
171
- });
172
- await localDataStoreContext.realize();
173
- const { attachSummary: { summary }, type, } = localDataStoreContext.getAttachData(/* includeGCData: */ false);
174
- const snapshot = convertSummaryTreeToITree(summary);
175
- const attributesEntry = snapshot.entries.find((e) => e.path === dataStoreAttributesBlobName);
176
- assert(attributesEntry !== undefined, "There is no attributes blob in the summary tree");
177
- const contents = JSON.parse(attributesEntry.value.contents);
178
- const dataStoreAttributes = {
179
- pkg: JSON.stringify(["TestComp", "SubComp"]),
180
- summaryFormatVersion: 2,
181
- isRootDataStore: false,
182
- };
183
- assert.strictEqual(contents.pkg, dataStoreAttributes.pkg, "Local DataStore package does not match.");
184
- assert.strictEqual(contents.summaryFormatVersion, dataStoreAttributes.summaryFormatVersion, "Local DataStore snapshot version does not match.");
185
- assert.strictEqual(contents.isRootDataStore, dataStoreAttributes.isRootDataStore, "Local DataStore root state does not match");
186
- assert.strictEqual(type, "SubComp", "Attach message type does not match.");
187
- });
188
- it("can correctly initialize root context", async () => {
189
- localDataStoreContext = new LocalFluidDataStoreContext({
190
- id: dataStoreId,
191
- pkg: ["TestDataStore1"],
192
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
193
- storage,
194
- scope,
195
- createSummarizerNodeFn,
196
- makeLocallyVisibleFn,
197
- snapshotTree: undefined,
198
- isRootDataStore: true,
199
- });
200
- const isRootNode = await localDataStoreContext.isRoot();
201
- assert.strictEqual(isRootNode, true, "The data store should be root.");
202
- });
203
- it("can correctly initialize non-root context", async () => {
204
- localDataStoreContext = new LocalFluidDataStoreContext({
205
- id: dataStoreId,
206
- pkg: ["TestDataStore1"],
207
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
208
- storage,
209
- scope,
210
- createSummarizerNodeFn,
211
- makeLocallyVisibleFn,
212
- snapshotTree: undefined,
213
- isRootDataStore: false,
214
- });
215
- const isRootNode = await localDataStoreContext.isRoot();
216
- assert.strictEqual(isRootNode, false, "The data store should not be root.");
217
- });
218
- });
219
- describe("Local data stores in summarizer client", () => {
220
- let mockLogger;
221
- const packageName = ["TestDataStore1"];
222
- beforeEach(async () => {
223
- // Change the container runtime's logger to MockLogger and its type to be a summarizer client.
224
- mockLogger = new MockLogger();
225
- const clientDetails = {
226
- capabilities: {
227
- interactive: false,
228
- },
229
- type: summarizerClientType,
230
- };
231
- containerRuntime = createContainerRuntime(mockLogger, clientDetails);
232
- });
233
- it("logs when local data store is created in summarizer", async () => {
234
- localDataStoreContext = new LocalFluidDataStoreContext({
235
- id: dataStoreId,
236
- pkg: packageName,
237
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
238
- storage,
239
- scope,
240
- createSummarizerNodeFn,
241
- makeLocallyVisibleFn,
242
- snapshotTree: undefined,
243
- isRootDataStore: false,
244
- });
245
- const expectedEvents = [
246
- {
247
- eventName: "FluidDataStoreContext:DataStoreCreatedInSummarizer",
248
- fullPackageName: {
249
- tag: TelemetryDataTag.CodeArtifact,
250
- value: packageName.join("/"),
251
- },
252
- fluidDataStoreId: {
253
- tag: TelemetryDataTag.CodeArtifact,
254
- value: dataStoreId,
255
- },
256
- },
257
- ];
258
- mockLogger.assertMatch(expectedEvents, "data store create event not generated as expected");
259
- });
260
- it("logs when local data store sends op in summarizer", async () => {
261
- localDataStoreContext = new LocalFluidDataStoreContext({
262
- id: dataStoreId,
263
- pkg: packageName,
264
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
265
- storage,
266
- scope,
267
- createSummarizerNodeFn,
268
- makeLocallyVisibleFn,
269
- snapshotTree: undefined,
270
- isRootDataStore: false,
271
- });
272
- await localDataStoreContext.realize();
273
- localDataStoreContext.submitMessage(DataStoreMessageType.ChannelOp, "summarizer message", {});
274
- const expectedEvents = [
275
- {
276
- eventName: "FluidDataStoreContext:DataStoreMessageSubmittedInSummarizer",
277
- type: DataStoreMessageType.ChannelOp,
278
- fluidDataStoreId: {
279
- tag: TelemetryDataTag.CodeArtifact,
280
- value: dataStoreId,
281
- },
282
- fullPackageName: {
283
- tag: TelemetryDataTag.CodeArtifact,
284
- value: packageName.join("/"),
285
- },
286
- },
287
- ];
288
- mockLogger.assertMatch(expectedEvents, "data store message submitted event not generated as expected");
289
- });
290
- it("logs maximum of 10 local summarizer events per data store", async () => {
291
- localDataStoreContext = new LocalFluidDataStoreContext({
292
- id: dataStoreId,
293
- pkg: packageName,
294
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
295
- storage,
296
- scope,
297
- createSummarizerNodeFn,
298
- makeLocallyVisibleFn,
299
- snapshotTree: undefined,
300
- isRootDataStore: false,
301
- });
302
- await localDataStoreContext.realize();
303
- let eventCount = 0;
304
- for (let i = 0; i < 15; i++) {
305
- localDataStoreContext.submitMessage(DataStoreMessageType.ChannelOp, `summarizer message ${i}`, {});
306
- }
307
- for (const event of mockLogger.events) {
308
- if (event.eventName ===
309
- "FluidDataStoreContext:DataStoreMessageSubmittedInSummarizer" ||
310
- event.eventName === "FluidDataStoreContext:DataStoreCreatedInSummarizer") {
311
- eventCount++;
312
- }
313
- }
314
- assert.strictEqual(eventCount, 10, "There should be only 10 events per data store");
315
- });
316
- });
317
- describe("Garbage Collection", () => {
318
- it("can generate correct GC data", async () => {
319
- localDataStoreContext = new LocalFluidDataStoreContext({
320
- id: dataStoreId,
321
- pkg: ["TestDataStore1"],
322
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
323
- storage,
324
- scope,
325
- createSummarizerNodeFn,
326
- makeLocallyVisibleFn,
327
- snapshotTree: undefined,
328
- isRootDataStore: true,
329
- });
330
- const gcData = await localDataStoreContext.getGCData();
331
- assert.deepStrictEqual(gcData, emptyGCData, "GC data from getGCData should be empty.");
332
- });
333
- it("can successfully update referenced state", () => {
334
- localDataStoreContext = new LocalFluidDataStoreContext({
335
- id: dataStoreId,
336
- pkg: ["TestComp", "SubComp"],
337
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
338
- storage,
339
- scope,
340
- createSummarizerNodeFn,
341
- makeLocallyVisibleFn,
342
- snapshotTree: undefined,
343
- isRootDataStore: false,
344
- });
345
- // Get the summarizer node for this data store which tracks its referenced state.
346
- const dataStoreSummarizerNode = summarizerNode.getChild(dataStoreId);
347
- assert.strictEqual(dataStoreSummarizerNode?.isReferenced(), true, "Data store should be referenced by default");
348
- // Update the used routes to not include route to the data store.
349
- localDataStoreContext.updateUsedRoutes([]);
350
- assert.strictEqual(dataStoreSummarizerNode?.isReferenced(), false, "Data store should now be unreferenced");
351
- // Add the data store's route (empty string) to its used routes.
352
- localDataStoreContext.updateUsedRoutes([""]);
353
- assert.strictEqual(dataStoreSummarizerNode?.isReferenced(), true, "Data store should now be referenced");
354
- });
355
- it("can tombstone a local datastore", async () => {
356
- localDataStoreContext = new LocalFluidDataStoreContext({
357
- id: dataStoreId,
358
- pkg: ["TestComp", "SubComp"],
359
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
360
- storage,
361
- scope,
362
- createSummarizerNodeFn,
363
- makeLocallyVisibleFn,
364
- snapshotTree: undefined,
365
- isRootDataStore: false,
366
- });
367
- localDataStoreContext.setTombstone(true);
368
- assert(localDataStoreContext.tombstoned, `Local data store should be tombstoned!`);
369
- localDataStoreContext.setTombstone(false);
370
- assert(!localDataStoreContext.tombstoned, `Local data store should not be tombstoned!`);
371
- });
372
- });
373
- });
374
- describe("RemoteDataStoreContext", () => {
375
- let remoteDataStoreContext;
376
- let dataStoreAttributes;
377
- const storage = {};
378
- let scope;
379
- let summarizerNode;
380
- let containerRuntime;
381
- beforeEach(async () => {
382
- const factory = {};
383
- factory.IFluidDataStoreFactory = factory;
384
- factory.instantiateDataStore = (context) => new MockFluidDataStoreRuntime();
385
- const registry = {};
386
- registry.IFluidDataStoreRegistry = registry;
387
- registry.get = async (pkg) => Promise.resolve(factory);
388
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
389
- containerRuntime = {
390
- IFluidDataStoreRegistry: registry,
391
- on: (event, listener) => { },
392
- clientDetails: {},
393
- };
394
- });
395
- describe("Initialization - can correctly initialize and generate attributes", () => {
396
- beforeEach(() => {
397
- summarizerNode = createRootSummarizerNodeWithGC(createChildLogger(), (() => undefined), 0, 0);
398
- summarizerNode.startSummary(0, createChildLogger(), 0);
399
- createSummarizerNodeFn = (summarizeInternal, getGCDataFn) => summarizerNode.createChild(summarizeInternal, dataStoreId, { type: CreateSummarizerNodeSource.FromSummary },
400
- // Disable GC for initialization tests.
401
- { gcDisabled: true }, getGCDataFn);
402
- });
403
- const pkgName = "TestDataStore1";
404
- /**
405
- * Runs the initialization and generate datastore attributes tests with the given write-mode preferences
406
- * and expectations.
407
- * This runs the same test with various summary write and read preferences. Specifically each call of this
408
- * function will run the test 4 times, one for each possible summary format we could be reading from.
409
- * @param expected - the expected datastore attributes to be generated given the write preference
410
- */
411
- function testGenerateAttributes(expected) {
412
- /**
413
- * This function is called for each possible base snapshot format version. We want to cover all
414
- * summary format read/write combinations. We only write in latest or -1 version, but we can
415
- * need to be able to read old summary format versions forever.
416
- * @param hasIsolatedChannels - whether we expect to read a snapshot tree with isolated channels or not
417
- * @param attributes - datastore attributes that are in the base snapshot we load from
418
- */
419
- async function testGenerateAttributesCore(attributes) {
420
- const buffer = stringToBuffer(JSON.stringify(attributes), "utf8");
421
- const attachBlobs = new Map([
422
- ["fluidDataStoreAttributes", buffer],
423
- ]);
424
- const snapshotTree = {
425
- blobs: { [dataStoreAttributesBlobName]: "fluidDataStoreAttributes" },
426
- trees: {},
427
- };
428
- // If we are expecting to read isolated channels as intended by the test, then make sure
429
- // it exists on the snapshot. Otherwise, make sure it doesn't to most closely resemble
430
- // real loading use cases.
431
- snapshotTree.trees[channelsTreeName] = {
432
- blobs: {},
433
- trees: {},
434
- };
435
- remoteDataStoreContext = new RemoteFluidDataStoreContext({
436
- id: dataStoreId,
437
- snapshotTree,
438
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
439
- storage: new StorageServiceWithAttachBlobs(storage, attachBlobs),
440
- scope,
441
- createSummarizerNodeFn,
442
- });
443
- const isRootNode = await remoteDataStoreContext.isRoot();
444
- assert.strictEqual(isRootNode, true, "The data store should be root.");
445
- const summarizeResult = await remoteDataStoreContext.summarize(true /* fullTree */);
446
- assert(summarizeResult.summary.type === SummaryType.Tree, "summarize should always return a tree when fullTree is true");
447
- const blob = summarizeResult.summary.tree[dataStoreAttributesBlobName];
448
- const contents = JSON.parse(blob.content);
449
- // Validate that generated attributes are as expected.
450
- assert.deepStrictEqual(contents, expected, "Unexpected datastore attributes written");
451
- }
452
- it("can read from latest with isolated channels", async () => testGenerateAttributesCore({
453
- pkg: JSON.stringify([pkgName]),
454
- summaryFormatVersion: 2,
455
- isRootDataStore: true,
456
- }));
457
- }
458
- it("rejects ids with forward slashes", async () => {
459
- const invalidId = "beforeSlash/afterSlash";
460
- const codeBlock = () => new RemoteFluidDataStoreContext({
461
- id: invalidId,
462
- pkg: ["TestDataStore1"],
463
- parentContext: wrapContextForInnerChannel(invalidId, containerRuntime),
464
- storage: storage,
465
- scope,
466
- createSummarizerNodeFn,
467
- snapshotTree: undefined,
468
- });
469
- assert.throws(codeBlock, (e) => validateAssertionError(e, "Data store ID contains slash"));
470
- });
471
- describe("writing with isolated channels enabled", () => testGenerateAttributes({
472
- pkg: JSON.stringify([pkgName]),
473
- summaryFormatVersion: 2,
474
- isRootDataStore: true,
475
- }));
476
- });
477
- describe("Garbage Collection", () => {
478
- // The base GC details of the root summarizer node. The child base GC details from this is passed on to the
479
- // child summarizer node during its creation.
480
- let rootBaseGCDetails;
481
- const getRootBaseGCDetails = async () => rootBaseGCDetails;
482
- /**
483
- * Given the GC data of a data store, build the GC data of the root (parent) node.
484
- */
485
- function buildRootGCData(dataStoreGCData, id) {
486
- const builder = new GCDataBuilder();
487
- builder.prefixAndAddNodes(id, dataStoreGCData.gcNodes);
488
- return builder.getGCData();
489
- }
490
- beforeEach(() => {
491
- summarizerNode = createRootSummarizerNodeWithGC(createChildLogger(), (() => undefined), 0, 0, undefined, undefined, getRootBaseGCDetails);
492
- summarizerNode.startSummary(0, createChildLogger(), 0);
493
- createSummarizerNodeFn = (summarizeInternal, getGCDataFn) => summarizerNode.createChild(summarizeInternal, dataStoreId, { type: CreateSummarizerNodeSource.FromSummary }, undefined, getGCDataFn);
494
- });
495
- it("can generate GC data without base GC details in initial summary", async () => {
496
- dataStoreAttributes = {
497
- pkg: "TestDataStore1",
498
- summaryFormatVersion: undefined,
499
- };
500
- const buffer = stringToBuffer(JSON.stringify(dataStoreAttributes), "utf8");
501
- const attachBlobs = new Map([
502
- ["fluidDataStoreAttributes", buffer],
503
- ]);
504
- const snapshotTree = {
505
- blobs: {
506
- [dataStoreAttributesBlobName]: "fluidDataStoreAttributes",
507
- },
508
- trees: {},
509
- };
510
- remoteDataStoreContext = new RemoteFluidDataStoreContext({
511
- id: dataStoreId,
512
- snapshotTree,
513
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
514
- storage: new StorageServiceWithAttachBlobs(storage, attachBlobs),
515
- scope,
516
- createSummarizerNodeFn,
517
- });
518
- const gcData = await remoteDataStoreContext.getGCData();
519
- assert.deepStrictEqual(gcData, emptyGCData, "GC data from getGCData should be empty.");
520
- });
521
- it("can generate GC data with GC details in initial summary", async () => {
522
- dataStoreAttributes = {
523
- pkg: "TestDataStore1",
524
- summaryFormatVersion: undefined,
525
- };
526
- const attributesBuffer = stringToBuffer(JSON.stringify(dataStoreAttributes), "utf8");
527
- const attachBlobs = new Map([
528
- ["fluidDataStoreAttributes", attributesBuffer],
529
- ]);
530
- const snapshotTree = {
531
- blobs: {
532
- [dataStoreAttributesBlobName]: "fluidDataStoreAttributes",
533
- },
534
- trees: {},
535
- };
536
- // The base GC data of the data store.
537
- const dataStoreGCData = {
538
- gcNodes: {
539
- "/": ["/dds1", "/dds2"],
540
- "/dds1": ["/dds2", "/"],
541
- },
542
- };
543
- // Set the root base GC details to include the child node's base GC data.
544
- rootBaseGCDetails = {
545
- usedRoutes: [],
546
- gcData: buildRootGCData(dataStoreGCData, dataStoreId),
547
- };
548
- remoteDataStoreContext = new RemoteFluidDataStoreContext({
549
- id: dataStoreId,
550
- snapshotTree,
551
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
552
- storage: new StorageServiceWithAttachBlobs(storage, attachBlobs),
553
- scope,
554
- createSummarizerNodeFn,
555
- });
556
- const gcData = await remoteDataStoreContext.getGCData();
557
- assert.deepStrictEqual(gcData, dataStoreGCData, "GC data from getGCData is incorrect.");
558
- });
559
- it("should not reuse summary data when used state changed since last summary", async () => {
560
- dataStoreAttributes = {
561
- pkg: "TestDataStore1",
562
- summaryFormatVersion: undefined,
563
- };
564
- const attributesBuffer = stringToBuffer(JSON.stringify(dataStoreAttributes), "utf8");
565
- const attachBlobs = new Map([
566
- ["fluidDataStoreAttributes", attributesBuffer],
567
- ]);
568
- const snapshotTree = {
569
- id: "dummy",
570
- blobs: {
571
- [dataStoreAttributesBlobName]: "fluidDataStoreAttributes",
572
- },
573
- trees: {},
574
- };
575
- // The base GC data of the data store.
576
- const dataStoreGCData = {
577
- gcNodes: {
578
- "/": [],
579
- },
580
- };
581
- // Set the root base GC details to include the child node's base GC data.
582
- rootBaseGCDetails = {
583
- usedRoutes: [`/${dataStoreId}`],
584
- gcData: buildRootGCData(dataStoreGCData, dataStoreId),
585
- };
586
- remoteDataStoreContext = new RemoteFluidDataStoreContext({
587
- id: dataStoreId,
588
- snapshotTree,
589
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
590
- storage: new StorageServiceWithAttachBlobs(storage, attachBlobs),
591
- scope,
592
- createSummarizerNodeFn,
593
- });
594
- // Since GC is enabled, GC must run before summarize. Get the GC data and update used routes to
595
- // emulate the GC process.
596
- const gcData = await remoteDataStoreContext.getGCData();
597
- assert.deepStrictEqual(gcData, dataStoreGCData, "GC data from getGCData should be empty.");
598
- // Update used routes to the same as in initial GC details. This will ensure that the used state
599
- // matches the initial used state.
600
- remoteDataStoreContext.updateUsedRoutes([""]);
601
- // The data in the store has not changed since last summary and the reference used routes (from initial
602
- // used routes) and current used routes (default) are both empty. So, summarize should return a handle.
603
- let summarizeResult = await remoteDataStoreContext.summarize(false /* fullTree */);
604
- assert(summarizeResult.summary.type === SummaryType.Handle, "summarize should return a handle since nothing changed");
605
- // Update the used routes of the data store to a different value than current.
606
- remoteDataStoreContext.updateUsedRoutes([]);
607
- // Since the used state has changed, it should generate a full summary tree.
608
- summarizeResult = await remoteDataStoreContext.summarize(false /* fullTree */);
609
- assert(summarizeResult.summary.type === SummaryType.Tree, "summarize should return a tree since used state changed");
610
- });
611
- function updateReferencedStateTest() {
612
- const buffer = stringToBuffer(JSON.stringify(dataStoreAttributes), "utf8");
613
- const attachBlobs = new Map([
614
- ["fluidDataStoreAttributes", buffer],
615
- ]);
616
- const snapshotTree = {
617
- id: "dummy",
618
- blobs: { [".component"]: "fluidDataStoreAttributes" },
619
- trees: {},
620
- };
621
- remoteDataStoreContext = new RemoteFluidDataStoreContext({
622
- id: dataStoreId,
623
- snapshotTree,
624
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
625
- storage: new StorageServiceWithAttachBlobs(storage, attachBlobs),
626
- scope,
627
- createSummarizerNodeFn,
628
- });
629
- // Get the summarizer node for this data store which tracks its referenced state.
630
- const dataStoreSummarizerNode = summarizerNode.getChild(dataStoreId);
631
- assert.strictEqual(dataStoreSummarizerNode?.isReferenced(), true, "Data store should be referenced by default");
632
- // Update the used routes to not include route to the data store.
633
- remoteDataStoreContext.updateUsedRoutes([]);
634
- assert.strictEqual(dataStoreSummarizerNode?.isReferenced(), false, "Data store should now be unreferenced");
635
- // Add the data store's route (empty string) to its used routes.
636
- remoteDataStoreContext.updateUsedRoutes([""]);
637
- assert.strictEqual(dataStoreSummarizerNode?.isReferenced(), true, "Data store should now be referenced");
638
- }
639
- it("can successfully update referenced state from format version 0", () => {
640
- dataStoreAttributes = {
641
- pkg: "TestDataStore1",
642
- };
643
- updateReferencedStateTest();
644
- });
645
- it("can successfully update referenced state from format version 1", () => {
646
- dataStoreAttributes = {
647
- pkg: '["TestDataStore1"]',
648
- snapshotFormatVersion: "0.1",
649
- };
650
- updateReferencedStateTest();
651
- });
652
- it("can successfully update referenced state from format version 2", () => {
653
- dataStoreAttributes = {
654
- pkg: '["TestDataStore1"]',
655
- summaryFormatVersion: 2,
656
- };
657
- updateReferencedStateTest();
658
- });
659
- it("can successfully tombstone a remote datastore", async () => {
660
- dataStoreAttributes = {
661
- pkg: JSON.stringify(["TestDataStore1"]),
662
- isRootDataStore: false,
663
- };
664
- const buffer = stringToBuffer(JSON.stringify(dataStoreAttributes), "utf8");
665
- const attachBlobs = new Map([
666
- ["fluidDataStoreAttributes", buffer],
667
- ]);
668
- const snapshotTree = {
669
- id: "dummy",
670
- blobs: { [".component"]: "fluidDataStoreAttributes" },
671
- trees: {},
672
- };
673
- remoteDataStoreContext = new RemoteFluidDataStoreContext({
674
- id: dataStoreId,
675
- snapshotTree,
676
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
677
- storage: new StorageServiceWithAttachBlobs(storage, attachBlobs),
678
- scope,
679
- createSummarizerNodeFn,
680
- });
681
- remoteDataStoreContext.setTombstone(true);
682
- assert(remoteDataStoreContext.tombstoned, `Local data store should be tombstoned!`);
683
- remoteDataStoreContext.setTombstone(false);
684
- assert(!remoteDataStoreContext.tombstoned, `Local data store should not be tombstoned!`);
685
- });
686
- });
687
- });
688
- describe("LocalDetachedFluidDataStoreContext", () => {
689
- let localDataStoreContext;
690
- let storage;
691
- let scope;
692
- let factory;
693
- const makeLocallyVisibleFn = () => { };
694
- const channelToDataStoreFn = (fluidDataStore) => channelToDataStore(fluidDataStore, "id", channelCollection, containerRuntime.logger);
695
- let containerRuntime;
696
- let channelCollection;
697
- let provideDsRuntimeWithFailingEntrypoint = false;
698
- beforeEach(async () => {
699
- const summarizerNode = createRootSummarizerNodeWithGC(createChildLogger(), (() => undefined), 0, 0);
700
- summarizerNode.startSummary(0, createChildLogger(), 0);
701
- createSummarizerNodeFn = (summarizeInternal, getGCDataFn) => summarizerNode.createChild(summarizeInternal, dataStoreId, { type: CreateSummarizerNodeSource.Local }, undefined, getGCDataFn);
702
- const failingEntryPoint = new FluidObjectHandle(new LazyPromise(async () => {
703
- throw new Error("Simulating failure when initializing EntryPoint");
704
- }), "", undefined);
705
- factory = {
706
- type: "store-type",
707
- get IFluidDataStoreFactory() {
708
- return factory;
709
- },
710
- instantiateDataStore: async (context, existing) => provideDsRuntimeWithFailingEntrypoint
711
- ? new MockFluidDataStoreRuntime({ entryPoint: failingEntryPoint })
712
- : new MockFluidDataStoreRuntime(),
713
- };
714
- const registry = {
715
- get IFluidDataStoreRegistry() {
716
- return registry;
717
- },
718
- get: async (pkg) => (pkg === factory.type ? factory : undefined),
719
- };
720
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
721
- containerRuntime = {
722
- IFluidDataStoreRegistry: registry,
723
- on: (event, listener) => { },
724
- logger: createChildLogger(),
725
- clientDetails: {},
726
- };
727
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
728
- channelCollection = {
729
- parentContext: containerRuntime,
730
- };
731
- });
732
- describe("Initialization", () => {
733
- it("rejects ids with forward slashes", async () => {
734
- const invalidId = "beforeSlash/afterSlash";
735
- const codeBlock = () => new LocalDetachedFluidDataStoreContext({
736
- id: invalidId,
737
- pkg: [factory.type],
738
- parentContext: wrapContextForInnerChannel(invalidId, containerRuntime),
739
- storage,
740
- scope,
741
- createSummarizerNodeFn,
742
- makeLocallyVisibleFn,
743
- snapshotTree: undefined,
744
- isRootDataStore: true,
745
- channelToDataStoreFn,
746
- });
747
- assert.throws(codeBlock, (e) => validateAssertionError(e, "Data store ID contains slash"));
748
- });
749
- describe("should error on attach if data store cannot be constructed/initialized", () => {
750
- // Tests in this suite should be scenarios that lead to a data store which cannot be constructed for
751
- // some reason.
752
- it("because of package type for data store not present in registry", async () => {
753
- let exceptionOccurred = false;
754
- localDataStoreContext = new LocalDetachedFluidDataStoreContext({
755
- id: dataStoreId,
756
- pkg: ["some-datastore-type-not-present-in-registry"],
757
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
758
- storage,
759
- scope,
760
- createSummarizerNodeFn,
761
- makeLocallyVisibleFn,
762
- snapshotTree: undefined,
763
- isRootDataStore: false,
764
- channelToDataStoreFn,
765
- });
766
- const dataStore = await factory.instantiateDataStore(localDataStoreContext, false);
767
- await localDataStoreContext.attachRuntime(factory, dataStore).catch((error) => {
768
- assert.strictEqual(error.message, "Registry does not contain entry for the package", "Unexpected exception thrown");
769
- exceptionOccurred = true;
770
- });
771
- assert.strictEqual(exceptionOccurred, true, "attachRuntime() call did not fail as expected.");
772
- assert.strictEqual(localDataStoreContext.attachState, AttachState.Detached);
773
- });
774
- it("because of entryPoint that fails to initialize", async () => {
775
- let exceptionOccurred = false;
776
- provideDsRuntimeWithFailingEntrypoint = true;
777
- localDataStoreContext = new LocalDetachedFluidDataStoreContext({
778
- id: dataStoreId,
779
- pkg: [factory.type],
780
- parentContext: wrapContextForInnerChannel(dataStoreId, containerRuntime),
781
- storage,
782
- scope,
783
- createSummarizerNodeFn,
784
- makeLocallyVisibleFn,
785
- snapshotTree: undefined,
786
- isRootDataStore: false,
787
- channelToDataStoreFn,
788
- });
789
- const dataStore = await factory.instantiateDataStore(localDataStoreContext, false);
790
- await localDataStoreContext.attachRuntime(factory, dataStore).catch((error) => {
791
- assert.strictEqual(error.message, "Simulating failure when initializing EntryPoint", "Unexpected exception thrown");
792
- exceptionOccurred = true;
793
- });
794
- assert.strictEqual(exceptionOccurred, true, "attachRuntime() call did not fail as expected.");
795
- assert.strictEqual(localDataStoreContext.attachState, AttachState.Detached);
796
- });
797
- });
798
- });
799
- });
800
- });
801
- //# sourceMappingURL=dataStoreContext.spec.js.map