@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 +1 @@
1
- {"version":3,"file":"channelCollection.js","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,yDAA8D;AAE9D,6EAmB6C;AAC7C,iEAauC;AACvC,qEASyC;AACzC,iFAAoE;AACpE,+DAAiE;AACjE,2DAAuE;AACvE,iEAA2D;AAC3D,+DAAoF;AACpF,+DAM+B;AAC/B,yFAAmF;AACnF,iDAIwB;AACxB,4CAIuB;AACvB,iDAI4B;AAC5B,uDAAuF;AACvF,iEAAgE;AAEhE;;;GAGG;AACH,IAAY,cAKX;AALD,WAAY,cAAc;IACzB,kFAAkF;IAClF,+BAAa,CAAA;IACb,0DAA0D;IAC1D,yCAAuB,CAAA;AACxB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAED;;GAEG;AACU,QAAA,8BAA8B,GAAG,gBAAgB,CAAC,CAAC,8DAA8D;AAC9H;;;GAGG;AACU,QAAA,6BAA6B,GAAG,eAAe,CAAC,CAAC,8DAA8D;AAS5H;;GAEG;AACH,SAAgB,WAAW,CAAC,OAA4B;IACvD,OAAO;QACN,IAAI,uBAAuB;YAC1B,OAAO,OAAO,CAAC,uBAAuB,CAAC;QACxC,CAAC;QACD,mBAAmB,EAAE,OAAO,CAAC,mBAAm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CAAC,CAAC,CAAC;AAC7E,CAAC;AAlCD,4DAkCC;AAED,gBAAgB;AAChB,MAAa,wBAAwB;IAKpC,YACC,eAAmD;IACnD,sCAAsC;IACrB,iBAEQ;QAFR,sBAAiB,GAAjB,iBAAiB,CAET;QATV,SAAI,GAAG,0BAA0B,CAAC;QAWjD,IAAI,CAAC,uBAAuB,GAAG,IAAI,6CAAsB,CAAC,eAAe,CAAC,CAAC;IAC5E,CAAC;IAED,IAAW,sBAAsB;QAChC,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAChC,OAA+B,EAC/B,SAAkB;QAElB,MAAM,OAAO,GAAG,IAAI,iBAAiB,CACpC,OAAO,CAAC,YAAY,EACpB,OAAO,EAAE,gBAAgB;QACzB,OAAO,CAAC,MAAM,EACd,GAAG,EAAE,GAAE,CAAC,EAAE,gBAAgB;QAC1B,CAAC,SAAiB,EAAE,EAAE,CAAC,KAAK,EAAE,qBAAqB;QACnD,IAAI,GAAG,EAAE,EAAE,WAAW;QACtB,IAAI,CAAC,iBAAiB,CACtB,CAAC;QAEF,OAAO,OAAO,CAAC;IAChB,CAAC;CACD;AAnCD,4DAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tITelemetryBaseLogger,\n\tIDisposable,\n\tIFluidHandle,\n\tIRequest,\n\tFluidObject,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tAliasResult,\n\tchannelsTreeName,\n\tCreateSummarizerNodeSource,\n\tIAttachMessage,\n\tIEnvelope,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContextDetached,\n\tIGarbageCollectionData,\n\tIInboundSignalMessage,\n\tIFluidParentContext,\n\tInboundAttachMessage,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreContext,\n\tNamedFluidDataStoreRegistryEntries,\n\tIFluidDataStoreRegistry,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tcreate404Response,\n\tcreateResponseError,\n\tGCDataBuilder,\n\tisSerializedHandle,\n\tprocessAttachMessageGCData,\n\tresponseToException,\n\tSummaryTreeBuilder,\n\tunpackChildNodesUsedRoutes,\n\tRequestParser,\n\tencodeCompactIdToString,\n} from \"@fluidframework/runtime-utils\";\nimport {\n\tcreateChildMonitoringContext,\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tLoggingError,\n\tMonitoringContext,\n\ttagCodeArtifacts,\n\tcreateChildLogger,\n} from \"@fluidframework/telemetry-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils\";\nimport { assert, Lazy, LazyPromise } from \"@fluidframework/core-utils\";\nimport { DataStoreContexts } from \"./dataStoreContexts.js\";\nimport { defaultRuntimeHeaderData, RuntimeHeaderData } from \"./containerRuntime.js\";\nimport {\n\tFluidDataStoreContext,\n\tRemoteFluidDataStoreContext,\n\tLocalFluidDataStoreContext,\n\tcreateAttributesBlob,\n\tLocalDetachedFluidDataStoreContext,\n} from \"./dataStoreContext.js\";\nimport { StorageServiceWithAttachBlobs } from \"./storageServiceWithAttachBlobs.js\";\nimport {\n\tIDataStoreAliasMessage,\n\tchannelToDataStore,\n\tisDataStoreAliasMessage,\n} from \"./dataStore.js\";\nimport {\n\tGCNodeType,\n\tdetectOutboundRoutesViaDDSKey,\n\ttrimLeadingAndTrailingSlashes,\n} from \"./gc/index.js\";\nimport {\n\tIContainerRuntimeMetadata,\n\tnonDataStorePaths,\n\trootHasIsolatedChannels,\n} from \"./summary/index.js\";\nimport { ContainerMessageType, LocalContainerRuntimeMessage } from \"./messageTypes.js\";\nimport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\n\n/**\n * Accepted header keys for requests coming to the runtime.\n * @internal\n */\nexport enum RuntimeHeaders {\n\t/** True to wait for a data store to be created and loaded before returning it. */\n\twait = \"wait\",\n\t/** True if the request is coming from an IFluidHandle. */\n\tviaHandle = \"viaHandle\",\n}\n\n/** True if a tombstoned object should be returned without erroring\n * @alpha\n */\nexport const AllowTombstoneRequestHeaderKey = \"allowTombstone\"; // Belongs in the enum above, but avoiding the breaking change\n/**\n * [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring\n * @internal\n */\nexport const AllowInactiveRequestHeaderKey = \"allowInactive\"; // Belongs in the enum above, but avoiding the breaking change\n\ntype PendingAliasResolve = (success: boolean) => void;\n\ninterface FluidDataStoreMessage {\n\tcontent: any;\n\ttype: string;\n}\n\n/**\n * Creates a shallow wrapper of {@link IFluidParentContext}. The wrapper can then have its methods overwritten as needed\n */\nexport function wrapContext(context: IFluidParentContext): IFluidParentContext {\n\treturn {\n\t\tget IFluidDataStoreRegistry() {\n\t\t\treturn context.IFluidDataStoreRegistry;\n\t\t},\n\t\tIFluidHandleContext: context.IFluidHandleContext,\n\t\toptions: context.options,\n\t\tget clientId() {\n\t\t\treturn context.clientId;\n\t\t},\n\t\tget connected() {\n\t\t\treturn context.connected;\n\t\t},\n\t\tdeltaManager: context.deltaManager,\n\t\tstorage: context.storage,\n\t\tlogger: context.logger,\n\t\tget clientDetails() {\n\t\t\treturn context.clientDetails;\n\t\t},\n\t\tget idCompressor() {\n\t\t\treturn context.idCompressor;\n\t\t},\n\t\tloadingGroupId: context.loadingGroupId,\n\t\tget attachState() {\n\t\t\treturn context.attachState;\n\t\t},\n\t\tcontainerRuntime: context.containerRuntime,\n\t\tscope: context.scope,\n\t\tgcThrowOnTombstoneUsage: context.gcThrowOnTombstoneUsage,\n\t\tgcTombstoneEnforcementAllowed: context.gcTombstoneEnforcementAllowed,\n\t\tgetAbsoluteUrl: async (...args) => {\n\t\t\treturn context.getAbsoluteUrl(...args);\n\t\t},\n\t\tgetQuorum: (...args) => {\n\t\t\treturn context.getQuorum(...args);\n\t\t},\n\t\tgetAudience: (...args) => {\n\t\t\treturn context.getAudience(...args);\n\t\t},\n\t\tensureNoDataModelChanges: (...args) => {\n\t\t\treturn context.ensureNoDataModelChanges(...args);\n\t\t},\n\t\tsubmitMessage: (...args) => {\n\t\t\treturn context.submitMessage(...args);\n\t\t},\n\t\tsubmitSignal: (...args) => {\n\t\t\treturn context.submitSignal(...args);\n\t\t},\n\t\tmakeLocallyVisible: (...args) => {\n\t\t\treturn context.makeLocallyVisible(...args);\n\t\t},\n\t\tuploadBlob: async (...args) => {\n\t\t\treturn context.uploadBlob(...args);\n\t\t},\n\t\taddedGCOutboundReference: (...args) => {\n\t\t\treturn context.addedGCOutboundReference?.(...args);\n\t\t},\n\t\tgetCreateChildSummarizerNodeFn: (...args) => {\n\t\t\treturn context.getCreateChildSummarizerNodeFn?.(...args);\n\t\t},\n\t\tdeleteChildSummarizerNode: (...args) => {\n\t\t\treturn context.deleteChildSummarizerNode?.(...args);\n\t\t},\n\t};\n}\n\n/**\n * Creates a wrapper of a {@link IFluidParentContext} to be provided to the inner datastore channels.\n * The wrapper will have the submit methods overwritten with the appropriate id as the destination address.\n *\n * @param id - the id of the channel\n * @param parentContext - the {@link IFluidParentContext} to wrap\n * @returns A wrapped {@link IFluidParentContext}\n */\nexport function wrapContextForInnerChannel(\n\tid: string,\n\tparentContext: IFluidParentContext,\n): IFluidParentContext {\n\tconst context = wrapContext(parentContext);\n\n\tcontext.submitMessage = (type: string, content: any, localOpMetadata: unknown) => {\n\t\tconst fluidDataStoreContent: FluidDataStoreMessage = {\n\t\t\tcontent,\n\t\t\ttype,\n\t\t};\n\t\tconst envelope: IEnvelope = {\n\t\t\taddress: id,\n\t\t\tcontents: fluidDataStoreContent,\n\t\t};\n\t\tparentContext.submitMessage(\n\t\t\tContainerMessageType.FluidDataStoreOp,\n\t\t\tenvelope,\n\t\t\tlocalOpMetadata,\n\t\t);\n\t};\n\n\tcontext.submitSignal = (type: string, contents: any, targetClientId?: string) => {\n\t\tconst envelope: IEnvelope = {\n\t\t\taddress: id,\n\t\t\tcontents,\n\t\t};\n\t\tparentContext.submitSignal(type, envelope, targetClientId);\n\t};\n\n\treturn context;\n}\n\n/**\n * This class encapsulates data store handling. Currently it is only used by the container runtime,\n * but eventually could be hosted on any channel once we formalize the channel api boundary.\n * @internal\n */\nexport class ChannelCollection implements IFluidDataStoreChannel, IDisposable {\n\t// Stores tracked by the Domain\n\tprivate readonly pendingAttach = new Map<string, IAttachMessage>();\n\t// 0.24 back-compat attachingBeforeSummary\n\tpublic readonly attachOpFiredForDataStore = new Set<string>();\n\n\tprivate readonly mc: MonitoringContext;\n\n\tprivate readonly disposeOnce = new Lazy<void>(() => this.contexts.dispose());\n\n\tpublic readonly entryPoint: IFluidHandle<FluidObject>;\n\n\tpublic readonly containerLoadStats: {\n\t\t// number of dataStores during loadContainer\n\t\treadonly containerLoadDataStoreCount: number;\n\t\t// number of unreferenced dataStores during loadContainer\n\t\treadonly referencedDataStoreCount: number;\n\t};\n\n\t// Stores the ids of new data stores between two GC runs. This is used to notify the garbage collector of new\n\t// root data stores that are added.\n\tprivate dataStoresSinceLastGC: string[] = [];\n\t// The handle to the container runtime. This is used mainly for GC purposes to represent outbound reference from\n\t// the container runtime to other nodes.\n\tprivate readonly containerRuntimeHandle: IFluidHandle;\n\tprivate readonly pendingAliasMap: Map<string, Promise<AliasResult>> = new Map<\n\t\tstring,\n\t\tPromise<AliasResult>\n\t>();\n\n\tprivate readonly contexts: DataStoreContexts;\n\n\tconstructor(\n\t\tprivate readonly baseSnapshot: ISnapshotTree | undefined,\n\t\tpublic readonly parentContext: IFluidParentContext,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly gcNodeUpdated: (\n\t\t\tnodePath: string,\n\t\t\treason: \"Loaded\" | \"Changed\",\n\t\t\ttimestampMs?: number,\n\t\t\tpackagePath?: readonly string[],\n\t\t\trequest?: IRequest,\n\t\t\theaderData?: RuntimeHeaderData,\n\t\t) => void,\n\t\tprivate readonly isDataStoreDeleted: (nodePath: string) => boolean,\n\t\tprivate readonly aliasMap: Map<string, string>,\n\t\tprovideEntryPoint: (runtime: ChannelCollection) => Promise<FluidObject>,\n\t) {\n\t\tthis.mc = createChildMonitoringContext({ logger: baseLogger });\n\t\tthis.contexts = new DataStoreContexts(baseLogger);\n\t\tthis.containerRuntimeHandle = new FluidObjectHandle(\n\t\t\tthis.parentContext,\n\t\t\t\"/\",\n\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t);\n\t\tthis.entryPoint = new FluidObjectHandle<FluidObject>(\n\t\t\tnew LazyPromise(async () => provideEntryPoint(this)),\n\t\t\t\"\",\n\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t);\n\n\t\t// Extract stores stored inside the snapshot\n\t\tconst fluidDataStores = new Map<string, ISnapshotTree>();\n\t\tif (baseSnapshot) {\n\t\t\tfor (const [key, value] of Object.entries(baseSnapshot.trees)) {\n\t\t\t\tfluidDataStores.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\tlet unreferencedDataStoreCount = 0;\n\t\t// Create a context for each of them\n\t\tfor (const [key, value] of fluidDataStores) {\n\t\t\tlet dataStoreContext: FluidDataStoreContext;\n\n\t\t\t// counting number of unreferenced data stores\n\t\t\tif (value.unreferenced) {\n\t\t\t\tunreferencedDataStoreCount++;\n\t\t\t}\n\t\t\t// If we have a detached container, then create local data store contexts.\n\t\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\t\tdataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tsnapshotTree: value,\n\t\t\t\t\tparentContext: this.wrapContextForInnerChannel(key),\n\t\t\t\t\tstorage: this.parentContext.storage,\n\t\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tloadingGroupId: value.groupId,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tthrow new LoggingError(\"Snapshot should be there to load from!!\");\n\t\t\t\t}\n\t\t\t\tconst snapshotTree = value;\n\t\t\t\tdataStoreContext = new LocalFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tpkg: undefined,\n\t\t\t\t\tparentContext: this.wrapContextForInnerChannel(key),\n\t\t\t\t\tstorage: this.parentContext.storage,\n\t\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),\n\t\t\t\t\tsnapshotTree,\n\t\t\t\t\tisRootDataStore: undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\t\t}\n\t\tthis.containerLoadStats = {\n\t\t\tcontainerLoadDataStoreCount: fluidDataStores.size,\n\t\t\treferencedDataStoreCount: fluidDataStores.size - unreferencedDataStoreCount,\n\t\t};\n\t}\n\n\tpublic get aliases(): ReadonlyMap<string, string> {\n\t\treturn this.aliasMap;\n\t}\n\n\tpublic get pendingAliases(): Map<string, Promise<AliasResult>> {\n\t\treturn this.pendingAliasMap;\n\t}\n\n\tpublic async waitIfPendingAlias(maybeAlias: string): Promise<AliasResult> {\n\t\tconst pendingAliasPromise = this.pendingAliases.get(maybeAlias);\n\t\treturn pendingAliasPromise ?? \"Success\";\n\t}\n\n\t/** For sampling. Only log once per container */\n\tprivate shouldSendAttachLog = true;\n\n\tprivate wrapContextForInnerChannel(id: string): IFluidParentContext {\n\t\treturn wrapContextForInnerChannel(id, this.parentContext);\n\t}\n\n\t/**\n\t * IFluidDataStoreChannel.makeVisibleAndAttachGraph implementation\n\t * Not clear when it would be called and what it should do.\n\t * Currently this API is called by context only for root data stores.\n\t */\n\tpublic makeVisibleAndAttachGraph() {\n\t\tthis.parentContext.makeLocallyVisible();\n\t}\n\n\tprivate processAttachMessage(message: ISequencedDocumentMessage, local: boolean) {\n\t\tconst attachMessage = message.contents as InboundAttachMessage;\n\n\t\tthis.dataStoresSinceLastGC.push(attachMessage.id);\n\n\t\t// We need to process the GC Data for both local and remote attach messages\n\t\tconst foundGCData = processAttachMessageGCData(attachMessage.snapshot, (nodeId, toPath) => {\n\t\t\t// nodeId is the relative path under the node being attached. Always starts with \"/\", but no trailing \"/\" after an id\n\t\t\tconst fromPath = `/${attachMessage.id}${nodeId === \"/\" ? \"\" : nodeId}`;\n\t\t\tthis.parentContext.addedGCOutboundReference?.(\n\t\t\t\t{ absolutePath: fromPath },\n\t\t\t\t{ absolutePath: toPath },\n\t\t\t);\n\t\t});\n\n\t\t// Only log once per container to avoid noise/cost.\n\t\t// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details\n\t\tif (this.shouldSendAttachLog) {\n\t\t\tthis.shouldSendAttachLog = false;\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"dataStoreAttachMessage_sampled\",\n\t\t\t\t...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),\n\t\t\t\tdetails: {\n\t\t\t\t\tlocal,\n\t\t\t\t\tsnapshot: !!attachMessage.snapshot,\n\t\t\t\t\tfoundGCData,\n\t\t\t\t},\n\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t});\n\t\t}\n\n\t\t// The local object has already been attached\n\t\tif (local) {\n\t\t\tassert(\n\t\t\t\tthis.pendingAttach.has(attachMessage.id),\n\t\t\t\t0x15e /* \"Local object does not have matching attach message id\" */,\n\t\t\t);\n\t\t\tthis.contexts.get(attachMessage.id)?.emit(\"attached\");\n\t\t\tthis.pendingAttach.delete(attachMessage.id);\n\t\t\treturn;\n\t\t}\n\n\t\t// If a non-local operation then go and create the object, otherwise mark it as officially attached.\n\t\tif (this.alreadyProcessed(attachMessage.id)) {\n\t\t\t// TODO: dataStoreId may require a different tag from PackageData #7488\n\t\t\tconst error = new DataCorruptionError(\n\t\t\t\t// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId\n\t\t\t\t\"Duplicate DataStore created with existing id\",\n\t\t\t\t{\n\t\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t\t\t...tagCodeArtifacts({ dataStoreId: attachMessage.id }),\n\t\t\t\t},\n\t\t\t);\n\t\t\tthrow error;\n\t\t}\n\n\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\tlet snapshotTree: ISnapshotTree | undefined;\n\t\tif (attachMessage.snapshot) {\n\t\t\tsnapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);\n\t\t}\n\n\t\t// Include the type of attach message which is the pkg of the store to be\n\t\t// used by RemoteFluidDataStoreContext in case it is not in the snapshot.\n\t\tconst pkg = [attachMessage.type];\n\t\tconst remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\tid: attachMessage.id,\n\t\t\tsnapshotTree,\n\t\t\tparentContext: this.wrapContextForInnerChannel(attachMessage.id),\n\t\t\tstorage: new StorageServiceWithAttachBlobs(this.parentContext.storage, flatAttachBlobs),\n\t\t\tscope: this.parentContext.scope,\n\t\t\tloadingGroupId: attachMessage.snapshot?.groupId,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(\n\t\t\t\tattachMessage.id,\n\t\t\t\t{\n\t\t\t\t\ttype: CreateSummarizerNodeSource.FromAttach,\n\t\t\t\t\tsequenceNumber: message.sequenceNumber,\n\t\t\t\t\tsnapshot: attachMessage.snapshot ?? {\n\t\t\t\t\t\tentries: [createAttributesBlob(pkg, true /* isRootDataStore */)],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t),\n\t\t\tpkg,\n\t\t});\n\n\t\tthis.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);\n\t}\n\n\tprivate processAliasMessage(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: unknown,\n\t\tlocal: boolean,\n\t): void {\n\t\tconst aliasMessage = message.contents as IDataStoreAliasMessage;\n\t\tif (!isDataStoreAliasMessage(aliasMessage)) {\n\t\t\tthrow new DataCorruptionError(\"malformedDataStoreAliasMessage\", {\n\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t});\n\t\t}\n\n\t\tconst resolve = localOpMetadata as PendingAliasResolve;\n\t\tconst aliasResult = this.processAliasMessageCore(aliasMessage);\n\t\tif (local) {\n\t\t\tresolve(aliasResult);\n\t\t}\n\t}\n\n\tpublic processAliasMessageCore(aliasMessage: IDataStoreAliasMessage): boolean {\n\t\tif (this.alreadyProcessed(aliasMessage.alias)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst context = this.contexts.get(aliasMessage.internalId);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted a signal.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\taliasMessage.internalId,\n\t\t\t\tcontext,\n\t\t\t\t\"Changed\",\n\t\t\t\t\"processAliasMessageCore\",\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (context === undefined) {\n\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\teventName: \"AliasFluidDataStoreNotFound\",\n\t\t\t\tfluidDataStoreId: aliasMessage.internalId,\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst handle = new FluidObjectHandle(\n\t\t\tcontext,\n\t\t\taliasMessage.internalId,\n\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t);\n\t\tthis.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);\n\n\t\tthis.aliasMap.set(aliasMessage.alias, context.id);\n\t\tcontext.setInMemoryRoot();\n\t\treturn true;\n\t}\n\n\tprivate alreadyProcessed(id: string): boolean {\n\t\treturn this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;\n\t}\n\n\t/** Package up the context's attach summary etc into an IAttachMessage */\n\tprivate generateAttachMessage(localContext: LocalFluidDataStoreContext): IAttachMessage {\n\t\tconst { attachSummary } = localContext.getAttachData(/* includeGCData: */ true);\n\t\tconst type = localContext.packagePath[localContext.packagePath.length - 1];\n\n\t\t// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.\n\t\tconst snapshot = convertSummaryTreeToITree(attachSummary.summary);\n\n\t\treturn {\n\t\t\tid: localContext.id,\n\t\t\tsnapshot,\n\t\t\ttype,\n\t\t} satisfies IAttachMessage;\n\t}\n\n\t/**\n\t * Make the data store locally visible in the container graph by moving the data store context from unbound to\n\t * bound list and submitting the attach message. This data store can now be reached from the root.\n\t * @param id - The id of the data store context to make visible.\n\t */\n\tprivate makeDataStoreLocallyVisible(id: string): void {\n\t\tconst localContext = this.contexts.getUnbound(id);\n\t\tassert(!!localContext, 0x15f /* \"Could not find unbound context to bind\" */);\n\n\t\t/**\n\t\t * If the container is not detached, it is globally visible to all clients. This data store should also be\n\t\t * globally visible. Move it to attaching state and send an \"attach\" op for it.\n\t\t * If the container is detached, this data store will be part of the summary that makes the container attached.\n\t\t */\n\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\tlocalContext.emit(\"attaching\");\n\t\t\tconst message = this.generateAttachMessage(localContext);\n\n\t\t\tthis.pendingAttach.set(id, message);\n\t\t\tthis.parentContext.submitMessage(ContainerMessageType.Attach, message, undefined);\n\t\t\tthis.attachOpFiredForDataStore.add(id);\n\t\t}\n\n\t\tthis.contexts.bind(id);\n\t}\n\n\t/**\n\t * Generate compact internal DataStore ID.\n\t *\n\t * A note about namespace and name collisions:\n\t * This code assumes that that's the only way to generate internal IDs, and that it's Ok for this namespace to overlap with\n\t * user-provided alias names namespace.\n\t * There are two scenarios where it could cause trouble:\n\t * 1) Old files, where (already removed) CreateRoot*DataStore*() API was used, and thus internal name of data store\n\t * was provided by user. Such files may experience name collision with future data stores that receive a name generated\n\t * by this function.\n\t * 2) Much less likely, but if it happen that internal ID (generated by this function) is exactly the same as alias name\n\t * that user might use in the future, them ContainerRuntime.getAliasedDataStoreEntryPoint() or\n\t * ContainerRuntime.getDataStoreFromRequest() could return a data store with internalID matching user request, even though\n\t * user expected some other data store (that would receive alias later).\n\t * Please note that above mentioned functions have the implementation they have (allowing #2) due to #1.\n\t */\n\tprotected createDataStoreId(): string {\n\t\t// We use three non-overlapping namespaces:\n\t\t// - detached state: even numbers\n\t\t// - attached state: odd numbers\n\t\t// - uuids\n\t\t// In first two cases we will encode result as strings in more compact form.\n\t\tif (this.parentContext.attachState === AttachState.Detached) {\n\t\t\t// container is detached, only one client observes content, no way to hit collisions with other clients.\n\t\t\treturn encodeCompactIdToString(2 * this.contexts.size);\n\t\t}\n\t\tconst id = this.parentContext.containerRuntime.generateDocumentUniqueId();\n\t\tif (typeof id === \"number\") {\n\t\t\treturn encodeCompactIdToString(2 * id + 1);\n\t\t}\n\t\treturn id;\n\t}\n\n\tpublic createDetachedDataStoreCore(\n\t\tpkg: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextDetached {\n\t\tconst id = this.createDataStoreId();\n\n\t\tconst context = new LocalDetachedFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage: this.parentContext.storage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tisRootDataStore: false,\n\t\t\tloadingGroupId,\n\t\t\tchannelToDataStoreFn: (channel: IFluidDataStoreChannel) =>\n\t\t\t\tchannelToDataStore(\n\t\t\t\t\tchannel,\n\t\t\t\t\tid,\n\t\t\t\t\tthis,\n\t\t\t\t\tcreateChildLogger({ logger: this.parentContext.logger }),\n\t\t\t\t),\n\t\t});\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic _createFluidDataStoreContext(\n\t\tpkg: Readonly<string[]>,\n\t\tprops?: any,\n\t\tloadingGroupId?: string,\n\t) {\n\t\tconst id = this.createDataStoreId();\n\t\tconst context = new LocalFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage: this.parentContext.storage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tisRootDataStore: false,\n\t\t\tcreateProps: props,\n\t\t\tloadingGroupId,\n\t\t});\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic get disposed() {\n\t\treturn this.disposeOnce.evaluated;\n\t}\n\tpublic readonly dispose = () => this.disposeOnce.value;\n\n\tpublic reSubmit(type: string, content: any, localOpMetadata: unknown) {\n\t\tswitch (type) {\n\t\t\tcase ContainerMessageType.Attach:\n\t\t\tcase ContainerMessageType.Alias:\n\t\t\t\tthis.parentContext.submitMessage(type, content, localOpMetadata);\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t}\n\n\t\tassert(type === ContainerMessageType.FluidDataStoreOp, 0x8e7 /* type */);\n\t\tconst envelope = content as IEnvelope;\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and throw an error. If there are local changes for a\n\t\t// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"resubmitDataStoreOp\")\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"Context is deleted!\", {\n\t\t\t\tcallSite: \"resubmitDataStoreOp\",\n\t\t\t\t...tagCodeArtifacts({ id: envelope.address }),\n\t\t\t});\n\t\t}\n\t\tassert(!!context, 0x160 /* \"There should be a store context for the op\" */);\n\t\tconst innerContents = envelope.contents as FluidDataStoreMessage;\n\t\tcontext.reSubmit(innerContents.type, innerContents.content, localOpMetadata);\n\t}\n\n\tpublic rollback(type: string, content: any, localOpMetadata: unknown) {\n\t\tassert(type === ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);\n\t\tconst envelope = content as IEnvelope;\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and throw an error. If there are local changes for a\n\t\t// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"rollbackDataStoreOp\")\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"Context is deleted!\", {\n\t\t\t\tcallSite: \"rollbackDataStoreOp\",\n\t\t\t\t...tagCodeArtifacts({ id: envelope.address }),\n\t\t\t});\n\t\t}\n\t\tassert(!!context, 0x2e8 /* \"There should be a store context for the op\" */);\n\t\tconst innerContents = envelope.contents as FluidDataStoreMessage;\n\t\tcontext.rollback(innerContents.type, innerContents.content, localOpMetadata);\n\t}\n\n\tpublic async applyStashedOp(content: unknown): Promise<unknown> {\n\t\tconst opContents = content as LocalContainerRuntimeMessage;\n\t\tswitch (opContents.type) {\n\t\t\tcase ContainerMessageType.Attach:\n\t\t\t\treturn this.applyStashedAttachOp(opContents.contents);\n\t\t\tcase ContainerMessageType.Alias:\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t}\n\n\t\tconst envelope = opContents.contents as IEnvelope;\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case the data store that stashed the op is deleted.\n\t\tif (this.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"applyStashedOp\")) {\n\t\t\treturn undefined;\n\t\t}\n\t\tassert(!!context, 0x161 /* \"There should be a store context for the op\" */);\n\t\treturn context.applyStashedOp(envelope.contents);\n\t}\n\n\tprivate async applyStashedAttachOp(message: IAttachMessage) {\n\t\tconst { id, snapshot } = message;\n\n\t\t// build the snapshot from the summary in the attach message\n\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\tconst snapshotTree = buildSnapshotTree(snapshot.entries, flatAttachBlobs);\n\t\tconst storage = new StorageServiceWithAttachBlobs(\n\t\t\tthis.parentContext.storage,\n\t\t\tflatAttachBlobs,\n\t\t);\n\n\t\t// create a local datastore context for the data store context,\n\t\t// which this message represents. All newly created data store\n\t\t// contexts start as a local context on the client that created\n\t\t// them, and for stashed ops, the client that applies it plays\n\t\t// the role of creating client.\n\t\tconst dataStoreContext = new LocalFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg: undefined,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree,\n\t\t\tisRootDataStore: false,\n\t\t});\n\n\t\t// realize the local context, as local contexts shouldn't be delay\n\t\t// loaded, as this client is playing the role of creating client,\n\t\t// and creating clients always create realized data store contexts.\n\t\tconst channel = await dataStoreContext.realize();\n\t\tawait channel.entryPoint.get();\n\n\t\t// add to the list of bound or remoted, as this context must be bound\n\t\t// to had an attach message sent, and is the non-detached case is remoted.\n\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\t// if the client is not detached put in the pending attach list\n\t\t\t// so that on ack of the stashed op, the context is found.\n\t\t\t// detached client don't send ops, so should not expect and ack.\n\t\t\tthis.pendingAttach.set(message.id, message);\n\t\t}\n\t}\n\n\tpublic process(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalMessageMetadata: unknown,\n\t\taddedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,\n\t) {\n\t\tswitch (message.type) {\n\t\t\tcase ContainerMessageType.Attach:\n\t\t\t\tthis.processAttachMessage(message, local);\n\t\t\t\treturn;\n\t\t\tcase ContainerMessageType.Alias:\n\t\t\t\tthis.processAliasMessage(message, localMessageMetadata, local);\n\t\t\t\treturn;\n\t\t\tcase ContainerMessageType.FluidDataStoreOp:\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tassert(false, 0x8e9 /* unreached */);\n\t\t}\n\n\t\tconst envelope = message.contents as IEnvelope;\n\t\tconst innerContents = envelope.contents as FluidDataStoreMessage;\n\t\tconst transformed = {\n\t\t\t...message,\n\t\t\ttype: innerContents.type,\n\t\t\tcontents: innerContents.content,\n\t\t};\n\n\t\tconst context = this.contexts.get(envelope.address);\n\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted an op.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tenvelope.address,\n\t\t\t\tcontext,\n\t\t\t\t\"Changed\",\n\t\t\t\t\"processFluidDataStoreOp\",\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (context === undefined) {\n\t\t\t// Former assert 0x162\n\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\"No context for op\",\n\t\t\t\t\"processFluidDataStoreOp\",\n\t\t\t\tmessage,\n\t\t\t\t{\n\t\t\t\t\tlocal,\n\t\t\t\t\tmessageDetails: JSON.stringify({\n\t\t\t\t\t\ttype: message.type,\n\t\t\t\t\t\tcontentType: typeof message.contents,\n\t\t\t\t\t}),\n\t\t\t\t\t...tagCodeArtifacts({ address: envelope.address }),\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tcontext.process(transformed, local, localMessageMetadata);\n\n\t\t// By default, we use the new behavior of detecting outbound routes here.\n\t\t// If this setting is true, then DataStoreContext would be notifying GC instead.\n\t\tif (\n\t\t\tthis.mc.config.getBoolean(detectOutboundRoutesViaDDSKey) !== true &&\n\t\t\taddedOutboundReference !== undefined\n\t\t) {\n\t\t\t// Notify GC of any outbound references that were added by this op.\n\t\t\tdetectOutboundReferences(envelope, addedOutboundReference);\n\t\t}\n\n\t\t// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is\n\t\t// being used.\n\t\tthis.gcNodeUpdated(\n\t\t\t`/${envelope.address}`,\n\t\t\t\"Changed\",\n\t\t\tmessage.timestamp,\n\t\t\tcontext.isLoaded ? context.packagePath : undefined,\n\t\t);\n\t}\n\n\tpublic async getDataStore(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<FluidDataStoreContext> {\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tid,\n\t\t\t\tthis.contexts.get(id),\n\t\t\t\t\"Requested\",\n\t\t\t\t\"getDataStore\",\n\t\t\t\trequestHeaderData,\n\t\t\t)\n\t\t) {\n\t\t\t// The requested data store has been deleted by gc. Create a 404 response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", request),\n\t\t\t\trequest,\n\t\t\t);\n\t\t}\n\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\t// The requested data store does not exits. Throw a 404 response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(create404Response(request), request);\n\t\t}\n\t\treturn context;\n\t}\n\n\t/**\n\t * Returns the data store requested with the given id if available. Otherwise, returns undefined.\n\t */\n\tpublic async getDataStoreIfAvailable(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<FluidDataStoreContext | undefined> {\n\t\t// If the data store has been deleted, log an error and return undefined.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tid,\n\t\t\t\tthis.contexts.get(id),\n\t\t\t\t\"Requested\",\n\t\t\t\t\"getDataStoreIfAvailable\",\n\t\t\t\trequestHeaderData,\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn context;\n\t}\n\n\t/**\n\t * Checks if the data store has been deleted by GC. If so, log an error.\n\t * @param id - The data store's id.\n\t * @param context - The data store context.\n\t * @param callSite - The function name this is called from.\n\t * @param requestHeaderData - The request header information to log if the data store is deleted.\n\t * @returns true if the data store is deleted. Otherwise, returns false.\n\t */\n\tprivate checkAndLogIfDeleted(\n\t\tid: string,\n\t\tcontext: FluidDataStoreContext | undefined,\n\t\tdeletedLogSuffix: string,\n\t\tcallSite: string,\n\t\trequestHeaderData?: RuntimeHeaderData,\n\t) {\n\t\tconst dataStoreNodePath = `/${id}`;\n\t\tif (!this.isDataStoreDeleted(dataStoreNodePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.mc.logger.sendErrorEvent({\n\t\t\teventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,\n\t\t\t...tagCodeArtifacts({ id }),\n\t\t\tcallSite,\n\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\texists: context !== undefined,\n\t\t});\n\t\treturn true;\n\t}\n\n\tpublic processSignal(messageArg: IInboundSignalMessage, local: boolean) {\n\t\tconst envelope = messageArg.content as IEnvelope;\n\t\tconst fluidDataStoreId = envelope.address;\n\t\tconst message = { ...messageArg, content: envelope.contents };\n\t\tconst context = this.contexts.get(fluidDataStoreId);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted a signal.\n\t\tif (this.checkAndLogIfDeleted(fluidDataStoreId, context, \"Changed\", \"processSignal\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!context) {\n\t\t\t// Attach message may not have been processed yet\n\t\t\tassert(!local, 0x163 /* \"Missing datastore for local signal\" */);\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"SignalFluidDataStoreNotFound\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tcontext.processSignal(message, local);\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.setConnectionState(connected, clientId);\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"SetConnectionStateError\",\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\truntimeConnected: this.parentContext.connected,\n\t\t\t\t\t\t\tconnected,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tconst eventName = attachState === AttachState.Attaching ? \"attaching\" : \"attached\";\n\t\tfor (const [, context] of this.contexts) {\n\t\t\t// Fire only for bounded stores.\n\t\t\tif (!this.contexts.isNotBound(context.id)) {\n\t\t\t\tcontext.emit(eventName);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.contexts.size;\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\n\t\t// Iterate over each store and ask it to snapshot\n\t\tawait Promise.all(\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(([_, context]) => {\n\t\t\t\t\t// Summarizer works only with clients with no local changes. A data store in attaching\n\t\t\t\t\t// state indicates an op was sent to attach a local data store, and the the attach op\n\t\t\t\t\t// had not yet round tripped back to the client.\n\t\t\t\t\tif (context.attachState === AttachState.Attaching) {\n\t\t\t\t\t\t// Formerly assert 0x588\n\t\t\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\t\t\"Local data store detected in attaching state during summarize\",\n\t\t\t\t\t\t\t\"summarize\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\treturn context.attachState === AttachState.Attached;\n\t\t\t\t})\n\t\t\t\t.map(async ([contextId, context]) => {\n\t\t\t\t\tconst contextSummary = await context.summarize(\n\t\t\t\t\t\tfullTree,\n\t\t\t\t\t\ttrackState,\n\t\t\t\t\t\ttelemetryContext,\n\t\t\t\t\t);\n\t\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t\t}),\n\t\t);\n\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t */\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\t// Attaching graph of some stores can cause other stores to get bound too.\n\t\t// So keep taking summary until no new stores get bound.\n\t\tlet notBoundContextsLength: number;\n\t\tdo {\n\t\t\tconst builderTree = builder.summary.tree;\n\t\t\tnotBoundContextsLength = this.contexts.notBoundLength();\n\t\t\t// Iterate over each data store and ask it to snapshot\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(\n\t\t\t\t\t([key, _]) =>\n\t\t\t\t\t\t// Take summary of bounded data stores only, make sure we haven't summarized them already\n\t\t\t\t\t\t// and no attach op has been fired for that data store because for loader versions <= 0.24\n\t\t\t\t\t\t// we set attach state as \"attaching\" before taking createNew summary.\n\t\t\t\t\t\t!(\n\t\t\t\t\t\t\tthis.contexts.isNotBound(key) ||\n\t\t\t\t\t\t\tbuilderTree[key] ||\n\t\t\t\t\t\t\tthis.attachOpFiredForDataStore.has(key)\n\t\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t.map(([key, value]) => {\n\t\t\t\t\tlet dataStoreSummary: ISummarizeResult;\n\t\t\t\t\tif (value.isLoaded) {\n\t\t\t\t\t\tdataStoreSummary = value.getAttachData(\n\t\t\t\t\t\t\t/* includeGCCData: */ false,\n\t\t\t\t\t\t\ttelemetryContext,\n\t\t\t\t\t\t).attachSummary;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If this data store is not yet loaded, then there should be no changes in the snapshot from\n\t\t\t\t\t\t// which it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\t!!this.baseSnapshot,\n\t\t\t\t\t\t\t0x166 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdataStoreSummary = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\t\tthis.baseSnapshot.trees[key],\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbuilder.addWithStats(key, dataStoreSummary);\n\t\t\t\t});\n\t\t} while (notBoundContextsLength !== this.contexts.notBoundLength());\n\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Before GC runs, called by the garbage collector to update any pending GC state.\n\t * The garbage collector needs to know all outbound references that are added. Since root data stores are not\n\t * explicitly marked as referenced, notify GC of new root data stores that were added since the last GC run.\n\t */\n\tpublic async updateStateBeforeGC(): Promise<void> {\n\t\tfor (const id of this.dataStoresSinceLastGC) {\n\t\t\tconst context = this.contexts.get(id);\n\t\t\tassert(context !== undefined, 0x2b6 /* Missing data store context */);\n\t\t\tif (await context.isRoot()) {\n\t\t\t\t// A root data store is basically a reference from the container runtime to the data store.\n\t\t\t\tconst handle = new FluidObjectHandle(\n\t\t\t\t\tcontext,\n\t\t\t\t\tid,\n\t\t\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t\t\t);\n\t\t\t\tthis.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);\n\t\t\t}\n\t\t}\n\t\tthis.dataStoresSinceLastGC = [];\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. It does the following:\n\t *\n\t * 1. Calls into each child data store context to get its GC data.\n\t *\n\t * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be\n\t * identified as belonging to the child.\n\t *\n\t * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent\n\t * the GC data of this channel.\n\t *\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst builder = new GCDataBuilder();\n\t\t// Iterate over each store and get their GC data.\n\t\tawait Promise.all(\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(([_, context]) => {\n\t\t\t\t\t// Summarizer client and hence GC works only with clients with no local changes. A data store in\n\t\t\t\t\t// attaching state indicates an op was sent to attach a local data store, and the the attach op\n\t\t\t\t\t// had not yet round tripped back to the client.\n\t\t\t\t\t// Formerly assert 0x589\n\t\t\t\t\tif (context.attachState === AttachState.Attaching) {\n\t\t\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\t\t\"Local data store detected in attaching state while running GC\",\n\t\t\t\t\t\t\t\"getGCData\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn context.attachState === AttachState.Attached;\n\t\t\t\t})\n\t\t\t\t.map(async ([contextId, context]) => {\n\t\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\t\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t\t}),\n\t\t);\n\n\t\t// Get the outbound routes and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", await this.getOutboundRoutes());\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * After GC has run, called to notify this Container's data stores of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in all data stores in this Container.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: readonly string[]) {\n\t\t// Get a map of data store ids to routes used in it.\n\t\tconst usedDataStoreRoutes = unpackChildNodesUsedRoutes(usedRoutes);\n\n\t\t// Verify that the used routes are correct.\n\t\tfor (const [id] of usedDataStoreRoutes) {\n\t\t\tassert(\n\t\t\t\tthis.contexts.has(id),\n\t\t\t\t0x167 /* \"Used route does not belong to any known data store\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.updateUsedRoutes(usedDataStoreRoutes.get(contextId) ?? []);\n\t\t}\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are unused. The unused objects are deleted.\n\t * @param unusedRoutes - The routes that are unused in all data stores in this Container.\n\t */\n\tpublic updateUnusedRoutes(unusedRoutes: readonly string[]) {\n\t\tfor (const route of unusedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Delete data store only if its route (/datastoreId) is in unusedRoutes. We don't want to delete a data\n\t\t\t// store based on its DDS being unused.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x2d7 /* No data store with specified id */);\n\t\t\t// Delete the contexts of unused data stores.\n\t\t\tthis.contexts.delete(dataStoreId);\n\t\t\t// Delete the summarizer node of the unused data stores.\n\t\t\tthis.parentContext.deleteChildSummarizerNode?.(dataStoreId);\n\t\t}\n\t}\n\n\t/**\n\t * Delete data stores and its objects that are sweep ready.\n\t * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should\n\t * be deleted.\n\t * @returns The routes of data stores and its objects that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(sweepReadyDataStoreRoutes: readonly string[]): readonly string[] {\n\t\tfor (const route of sweepReadyDataStoreRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tconst dataStoreId = pathParts[1];\n\n\t\t\t// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only\n\t\t\t// need to delete the data store.\n\t\t\t// These routes will still be returned below as among the deleted routes\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst dataStoreContext = this.contexts.get(dataStoreId);\n\t\t\tif (dataStoreContext === undefined) {\n\t\t\t\t// If the data store hasn't already been deleted, log an error because this should never happen.\n\t\t\t\t// If the data store has already been deleted, log a telemetry event. This can happen because multiple GC\n\t\t\t\t// sweep ops can contain the same data store. It would be interesting to track how often this happens.\n\t\t\t\tconst alreadyDeleted = this.isDataStoreDeleted(`/${dataStoreId}`);\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"DeletedDataStoreNotFound\",\n\t\t\t\t\tcategory: alreadyDeleted ? \"generic\" : \"error\",\n\t\t\t\t\t...tagCodeArtifacts({ id: dataStoreId }),\n\t\t\t\t\tdetails: { alreadyDeleted },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdataStoreContext.delete();\n\n\t\t\t// Delete the contexts of sweep ready data stores.\n\t\t\tthis.contexts.delete(dataStoreId);\n\t\t\t// Delete the summarizer node of the sweep ready data stores.\n\t\t\tthis.parentContext.deleteChildSummarizerNode?.(dataStoreId);\n\t\t}\n\t\treturn Array.from(sweepReadyDataStoreRoutes);\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are tombstones.\n\t *\n\t * A Tombstoned object has been unreferenced long enough that GC knows it won't be referenced again.\n\t * Tombstoned objects are eventually deleted by GC.\n\t *\n\t * @param tombstonedRoutes - The routes that are tombstones in all data stores in this Container.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {\n\t\tconst tombstonedDataStoresSet: Set<string> = new Set();\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Tombstone data store only if its route (/datastoreId) is directly in tombstoneRoutes.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);\n\t\t\ttombstonedDataStoresSet.add(dataStoreId);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.setTombstone(tombstonedDataStoresSet.has(contextId));\n\t\t}\n\t}\n\n\t/**\n\t * Returns the outbound routes of this channel. Only root data stores are considered referenced and their paths are\n\t * part of outbound routes.\n\t */\n\tprivate async getOutboundRoutes(): Promise<string[]> {\n\t\tconst outboundRoutes: string[] = [];\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tconst isRootDataStore = await context.isRoot();\n\t\t\tif (isRootDataStore) {\n\t\t\t\toutboundRoutes.push(`/${contextId}`);\n\t\t\t}\n\t\t}\n\t\treturn outboundRoutes;\n\t}\n\n\t/**\n\t * Called by GC to retrieve the package path of a data store node with the given path.\n\t */\n\tpublic async getDataStorePackagePath(nodePath: string): Promise<readonly string[] | undefined> {\n\t\t// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the\n\t\t// data store that contains it.\n\t\tconst context = this.contexts.get(nodePath.split(\"/\")[1]);\n\t\treturn (await context?.getInitialSnapshotDetails())?.pkg;\n\t}\n\n\t/**\n\t * Called by GC to determine if a node is for a data store or for an object within a data store (for e.g. DDS).\n\t * @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.\n\t */\n\tpublic getGCNodeType(nodePath: string): GCNodeType | undefined {\n\t\tconst pathParts = nodePath.split(\"/\");\n\t\tif (!this.contexts.has(pathParts[1])) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Data stores paths are of the format \"/dataStoreId\".\n\t\t// Sub data store paths are of the format \"/dataStoreId/subPath/...\".\n\t\tif (pathParts.length === 2) {\n\t\t\treturn GCNodeType.DataStore;\n\t\t}\n\t\treturn GCNodeType.SubDataStore;\n\t}\n\n\tpublic internalId(maybeAlias: string): string {\n\t\treturn this.aliases.get(maybeAlias) ?? maybeAlias;\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\tconst requestParser = RequestParser.create(request);\n\t\tconst id = requestParser.pathParts[0];\n\n\t\t// Differentiate between requesting the dataStore directly, or one of its children\n\t\tconst requestForChild = !requestParser.isLeaf(1);\n\n\t\tconst headerData: RuntimeHeaderData = {};\n\t\tif (typeof request.headers?.[RuntimeHeaders.wait] === \"boolean\") {\n\t\t\theaderData.wait = request.headers[RuntimeHeaders.wait];\n\t\t}\n\t\tif (typeof request.headers?.[RuntimeHeaders.viaHandle] === \"boolean\") {\n\t\t\theaderData.viaHandle = request.headers[RuntimeHeaders.viaHandle];\n\t\t}\n\t\tif (typeof request.headers?.[AllowTombstoneRequestHeaderKey] === \"boolean\") {\n\t\t\theaderData.allowTombstone = request.headers[AllowTombstoneRequestHeaderKey];\n\t\t}\n\t\tif (typeof request.headers?.[AllowInactiveRequestHeaderKey] === \"boolean\") {\n\t\t\theaderData.allowInactive = request.headers[AllowInactiveRequestHeaderKey];\n\t\t}\n\n\t\t// We allow Tombstone requests for sub-DataStore objects\n\t\tif (requestForChild) {\n\t\t\theaderData.allowTombstone = true;\n\t\t}\n\n\t\tawait this.waitIfPendingAlias(id);\n\t\tconst internalId = this.internalId(id);\n\t\tconst dataStoreContext = await this.getDataStore(internalId, headerData);\n\n\t\t// Remove query params, leading and trailing slashes from the url. This is done to make sure the format is\n\t\t// the same as GC nodes id.\n\t\tconst urlWithoutQuery = trimLeadingAndTrailingSlashes(request.url.split(\"?\")[0]);\n\t\t// Get the initial snapshot details which contain the data store package path.\n\t\tconst details = await dataStoreContext.getInitialSnapshotDetails();\n\n\t\t// Note that this will throw if the data store is inactive or tombstoned and throwing on incorrect usage\n\t\t// is configured.\n\t\tthis.gcNodeUpdated(\n\t\t\t`/${urlWithoutQuery}`,\n\t\t\t\"Loaded\",\n\t\t\tundefined /* timestampMs */,\n\t\t\tdetails.pkg,\n\t\t\trequest,\n\t\t\theaderData,\n\t\t);\n\t\tconst dataStore = await dataStoreContext.realize();\n\n\t\tconst subRequest = requestParser.createSubRequest(1);\n\t\t// We always expect createSubRequest to include a leading slash, but asserting here to protect against\n\t\t// unintentionally modifying the url if that changes.\n\t\tassert(\n\t\t\tsubRequest.url.startsWith(\"/\"),\n\t\t\t0x126 /* \"Expected createSubRequest url to include a leading slash\" */,\n\t\t);\n\n\t\treturn dataStore.request(subRequest);\n\t}\n}\n\nexport function getSummaryForDatastores(\n\tsnapshot: ISnapshotTree | undefined,\n\tmetadata?: IContainerRuntimeMetadata,\n): ISnapshotTree | undefined {\n\tif (!snapshot) {\n\t\treturn undefined;\n\t}\n\n\tif (rootHasIsolatedChannels(metadata)) {\n\t\tconst datastoresSnapshot = snapshot.trees[channelsTreeName];\n\t\tassert(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);\n\t\treturn datastoresSnapshot;\n\t} else {\n\t\t// back-compat: strip out all non-datastore paths before giving to DataStores object.\n\t\tconst datastoresTrees: ISnapshotTree[\"trees\"] = {};\n\t\tfor (const [key, value] of Object.entries(snapshot.trees)) {\n\t\t\tif (!nonDataStorePaths.includes(key)) {\n\t\t\t\tdatastoresTrees[key] = value;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...snapshot,\n\t\t\ttrees: datastoresTrees,\n\t\t};\n\t}\n}\n\n/**\n * Traverse this op's contents and detect any outbound routes that were added by this op.\n *\n * @internal\n */\nexport function detectOutboundReferences(\n\tenvelope: IEnvelope,\n\taddedOutboundReference: (fromNodePath: string, toNodePath: string) => void,\n): void {\n\t// These will be built up as we traverse the envelope contents\n\tconst outboundPaths: string[] = [];\n\tlet ddsAddress: string | undefined;\n\n\tfunction recursivelyFindHandles(obj: unknown) {\n\t\tif (typeof obj === \"object\" && obj !== null) {\n\t\t\tfor (const [key, value] of Object.entries(obj)) {\n\t\t\t\t// If 'value' is a serialized IFluidHandle, it represents a new outbound route.\n\t\t\t\tif (isSerializedHandle(value)) {\n\t\t\t\t\toutboundPaths.push(value.url);\n\t\t\t\t}\n\n\t\t\t\t// NOTE: This is taking a hard dependency on the fact that in our DataStore implementation,\n\t\t\t\t// the address of the DDS is stored in a property called \"address\". This is not ideal.\n\t\t\t\t// An alternative would be for the op envelope to include the absolute path (built up as it is submitted)\n\t\t\t\tif (key === \"address\" && ddsAddress === undefined) {\n\t\t\t\t\tddsAddress = value;\n\t\t\t\t}\n\n\t\t\t\trecursivelyFindHandles(value);\n\t\t\t}\n\t\t}\n\t}\n\n\trecursivelyFindHandles(envelope.contents);\n\n\t// GC node paths are all absolute paths, hence the \"\" prefix.\n\t// e.g. this will yield \"/dataStoreId/ddsId\"\n\tconst fromPath = [\"\", envelope.address, ddsAddress].join(\"/\");\n\toutboundPaths.forEach((toPath) => addedOutboundReference(fromPath, toPath));\n}\n\n/** @internal */\nexport class ChannelCollectionFactory implements IFluidDataStoreFactory {\n\tpublic readonly type = \"ChannelCollectionChannel\";\n\n\tpublic IFluidDataStoreRegistry: IFluidDataStoreRegistry;\n\n\tconstructor(\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\t// ADO:7302 We need a better type here\n\t\tprivate readonly provideEntryPoint: (\n\t\t\truntime: IFluidDataStoreChannel,\n\t\t) => Promise<FluidObject>,\n\t) {\n\t\tthis.IFluidDataStoreRegistry = new FluidDataStoreRegistry(registryEntries);\n\t}\n\n\tpublic get IFluidDataStoreFactory() {\n\t\treturn this;\n\t}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\t_existing: boolean,\n\t): Promise<IFluidDataStoreChannel> {\n\t\tconst runtime = new ChannelCollection(\n\t\t\tcontext.baseSnapshot,\n\t\t\tcontext, // parentContext\n\t\t\tcontext.logger,\n\t\t\t() => {}, // gcNodeUpdated\n\t\t\t(_nodePath: string) => false, // isDataStoreDeleted\n\t\t\tnew Map(), // aliasMap\n\t\t\tthis.provideEntryPoint,\n\t\t);\n\n\t\treturn runtime;\n\t}\n}\n"]}
1
+ {"version":3,"file":"channelCollection.js","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AASpE,kEAAgF;AAChF,iEAAuE;AACvE,oEAA0E;AAQ1E,2EAesD;AACtD,qEAagD;AAChD,uEASkD;AAElD,+DAAoF;AACpF,iDAIwB;AACxB,+DAQ+B;AAC/B,iEAA2D;AAC3D,iEAAgE;AAChE,4CAIuB;AACvB,uDAAuF;AACvF,yFAAmF;AACnF,iDAI4B;AAE5B;;;GAGG;AACH,IAAY,cAKX;AALD,WAAY,cAAc;IACzB,kFAAkF;IAClF,+BAAa,CAAA;IACb,0DAA0D;IAC1D,yCAAuB,CAAA;AACxB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAED;;GAEG;AACU,QAAA,8BAA8B,GAAG,gBAAgB,CAAC,CAAC,8DAA8D;AAC9H;;;GAG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AAC,QAAQ,CAAC,CAAC;IAEjC,6DAA6D;IAC7D,4CAA4C;IAC5C,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrD,aAAa,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC7E,CAAC;AAnCD,4DAmCC;AAED,gBAAgB;AAChB,MAAa,wBAAwB;IAOpC,YACC,eAAmD;IACnD,sCAAsC;IACrB,iBAEQ,EACR,IAAqE;QAHrE,sBAAiB,GAAjB,iBAAiB,CAET;QACR,SAAI,GAAJ,IAAI,CAAiE;QAVvE,SAAI,GAAG,0BAA0B,CAAC;QAYjD,IAAI,CAAC,uBAAuB,GAAG,IAAI,6CAAsB,CAAC,eAAe,CAAC,CAAC;IAC5E,CAAC;IAED,IAAW,sBAAsB;QAChC,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAChC,OAA+B,EAC/B,SAAkB;QAElB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CACxB,OAAO,CAAC,YAAY,EACpB,OAAO,EAAE,gBAAgB;QACzB,OAAO,CAAC,MAAM,EACd,GAAG,EAAE,GAAE,CAAC,EAAE,gBAAgB;QAC1B,CAAC,SAAiB,EAAE,EAAE,CAAC,KAAK,EAAE,qBAAqB;QACnD,IAAI,GAAG,EAAE,EAAE,WAAW;QACtB,IAAI,CAAC,iBAAiB,CACtB,CAAC;QAEF,OAAO,OAAO,CAAC;IAChB,CAAC;CACD;AAtCD,4DAsCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport {\n\tFluidObject,\n\tIDisposable,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { assert, Lazy, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIGarbageCollectionData,\n\tIInboundSignalMessage,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tAliasResult,\n\tCreateSummarizerNodeSource,\n\tIAttachMessage,\n\tIEnvelope,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIFluidParentContext,\n\tISummarizeResult,\n\tInboundAttachMessage,\n\tNamedFluidDataStoreRegistryEntries,\n\tchannelsTreeName,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tGCDataBuilder,\n\tRequestParser,\n\tSummaryTreeBuilder,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tcreate404Response,\n\tcreateResponseError,\n\tencodeCompactIdToString,\n\tisSerializedHandle,\n\tprocessAttachMessageGCData,\n\tresponseToException,\n\tunpackChildNodesUsedRoutes,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\tLoggingError,\n\tMonitoringContext,\n\tcreateChildLogger,\n\tcreateChildMonitoringContext,\n\textractSafePropertiesFromMessage,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { RuntimeHeaderData, defaultRuntimeHeaderData } from \"./containerRuntime.js\";\nimport {\n\tIDataStoreAliasMessage,\n\tchannelToDataStore,\n\tisDataStoreAliasMessage,\n} from \"./dataStore.js\";\nimport {\n\tFluidDataStoreContext,\n\tIFluidDataStoreContextInternal,\n\tILocalDetachedFluidDataStoreContextProps,\n\tLocalDetachedFluidDataStoreContext,\n\tLocalFluidDataStoreContext,\n\tRemoteFluidDataStoreContext,\n\tcreateAttributesBlob,\n} from \"./dataStoreContext.js\";\nimport { DataStoreContexts } from \"./dataStoreContexts.js\";\nimport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nimport {\n\tGCNodeType,\n\tdetectOutboundRoutesViaDDSKey,\n\ttrimLeadingAndTrailingSlashes,\n} from \"./gc/index.js\";\nimport { ContainerMessageType, LocalContainerRuntimeMessage } from \"./messageTypes.js\";\nimport { StorageServiceWithAttachBlobs } from \"./storageServiceWithAttachBlobs.js\";\nimport {\n\tIContainerRuntimeMetadata,\n\tnonDataStorePaths,\n\trootHasIsolatedChannels,\n} from \"./summary/index.js\";\n\n/**\n * Accepted header keys for requests coming to the runtime.\n * @internal\n */\nexport enum RuntimeHeaders {\n\t/** True to wait for a data store to be created and loaded before returning it. */\n\twait = \"wait\",\n\t/** True if the request is coming from an IFluidHandle. */\n\tviaHandle = \"viaHandle\",\n}\n\n/** True if a tombstoned object should be returned without erroring\n * @alpha\n */\nexport const AllowTombstoneRequestHeaderKey = \"allowTombstone\"; // Belongs in the enum above, but avoiding the breaking change\n/**\n * [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring\n * @internal\n */\nexport const AllowInactiveRequestHeaderKey = \"allowInactive\"; // Belongs in the enum above, but avoiding the breaking change\n\ntype PendingAliasResolve = (success: boolean) => void;\n\ninterface FluidDataStoreMessage {\n\tcontent: any;\n\ttype: string;\n}\n\n/**\n * Creates a shallow wrapper of {@link IFluidParentContext}. The wrapper can then have its methods overwritten as needed\n */\nexport function wrapContext(context: IFluidParentContext): IFluidParentContext {\n\treturn {\n\t\tget IFluidDataStoreRegistry() {\n\t\t\treturn context.IFluidDataStoreRegistry;\n\t\t},\n\t\tIFluidHandleContext: context.IFluidHandleContext,\n\t\toptions: context.options,\n\t\tget clientId() {\n\t\t\treturn context.clientId;\n\t\t},\n\t\tget connected() {\n\t\t\treturn context.connected;\n\t\t},\n\t\tdeltaManager: context.deltaManager,\n\t\tstorage: context.storage,\n\t\tlogger: context.logger,\n\t\tget clientDetails() {\n\t\t\treturn context.clientDetails;\n\t\t},\n\t\tget idCompressor() {\n\t\t\treturn context.idCompressor;\n\t\t},\n\t\tloadingGroupId: context.loadingGroupId,\n\t\tget attachState() {\n\t\t\treturn context.attachState;\n\t\t},\n\t\tcontainerRuntime: context.containerRuntime,\n\t\tscope: context.scope,\n\t\tgcThrowOnTombstoneUsage: context.gcThrowOnTombstoneUsage,\n\t\tgcTombstoneEnforcementAllowed: context.gcTombstoneEnforcementAllowed,\n\t\tgetAbsoluteUrl: async (...args) => {\n\t\t\treturn context.getAbsoluteUrl(...args);\n\t\t},\n\t\tgetQuorum: (...args) => {\n\t\t\treturn context.getQuorum(...args);\n\t\t},\n\t\tgetAudience: (...args) => {\n\t\t\treturn context.getAudience(...args);\n\t\t},\n\t\tensureNoDataModelChanges: (...args) => {\n\t\t\treturn context.ensureNoDataModelChanges(...args);\n\t\t},\n\t\tsubmitMessage: (...args) => {\n\t\t\treturn context.submitMessage(...args);\n\t\t},\n\t\tsubmitSignal: (...args) => {\n\t\t\treturn context.submitSignal(...args);\n\t\t},\n\t\tmakeLocallyVisible: (...args) => {\n\t\t\treturn context.makeLocallyVisible(...args);\n\t\t},\n\t\tuploadBlob: async (...args) => {\n\t\t\treturn context.uploadBlob(...args);\n\t\t},\n\t\taddedGCOutboundReference: (...args) => {\n\t\t\treturn context.addedGCOutboundReference?.(...args);\n\t\t},\n\t\tgetCreateChildSummarizerNodeFn: (...args) => {\n\t\t\treturn context.getCreateChildSummarizerNodeFn?.(...args);\n\t\t},\n\t\tdeleteChildSummarizerNode: (...args) => {\n\t\t\treturn context.deleteChildSummarizerNode(...args);\n\t\t},\n\t\tsetChannelDirty: (address: string) => {\n\t\t\treturn context.setChannelDirty(address);\n\t\t},\n\t};\n}\n\n/**\n * Creates a wrapper of a {@link IFluidParentContext} to be provided to the inner datastore channels.\n * The wrapper will have the submit methods overwritten with the appropriate id as the destination address.\n *\n * @param id - the id of the channel\n * @param parentContext - the {@link IFluidParentContext} to wrap\n * @returns A wrapped {@link IFluidParentContext}\n */\nexport function wrapContextForInnerChannel(\n\tid: string,\n\tparentContext: IFluidParentContext,\n): IFluidParentContext {\n\tconst context = wrapContext(parentContext);\n\n\tcontext.submitMessage = (type: string, content: any, localOpMetadata: unknown) => {\n\t\tconst fluidDataStoreContent: FluidDataStoreMessage = {\n\t\t\tcontent,\n\t\t\ttype,\n\t\t};\n\t\tconst envelope: IEnvelope = {\n\t\t\taddress: id,\n\t\t\tcontents: fluidDataStoreContent,\n\t\t};\n\t\tparentContext.submitMessage(\n\t\t\tContainerMessageType.FluidDataStoreOp,\n\t\t\tenvelope,\n\t\t\tlocalOpMetadata,\n\t\t);\n\t};\n\n\tcontext.submitSignal = (type: string, contents: unknown, targetClientId?: string) => {\n\t\tconst envelope: IEnvelope = {\n\t\t\taddress: id,\n\t\t\tcontents,\n\t\t};\n\t\tparentContext.submitSignal(type, envelope, targetClientId);\n\t};\n\n\treturn context;\n}\n\n/**\n * This class encapsulates data store handling. Currently it is only used by the container runtime,\n * but eventually could be hosted on any channel once we formalize the channel api boundary.\n * @internal\n */\nexport class ChannelCollection implements IFluidDataStoreChannel, IDisposable {\n\t// Stores tracked by the Domain\n\tprivate readonly pendingAttach = new Map<string, IAttachMessage>();\n\t// 0.24 back-compat attachingBeforeSummary\n\tpublic readonly attachOpFiredForDataStore = new Set<string>();\n\n\tprotected readonly mc: MonitoringContext;\n\n\tprivate readonly disposeOnce = new Lazy<void>(() => this.contexts.dispose());\n\n\tpublic readonly entryPoint: IFluidHandle<FluidObject>;\n\n\tpublic readonly containerLoadStats: {\n\t\t// number of dataStores during loadContainer\n\t\treadonly containerLoadDataStoreCount: number;\n\t\t// number of unreferenced dataStores during loadContainer\n\t\treadonly referencedDataStoreCount: number;\n\t};\n\n\t// Stores the ids of new data stores between two GC runs. This is used to notify the garbage collector of new\n\t// root data stores that are added.\n\tprivate dataStoresSinceLastGC: string[] = [];\n\t// The handle to the container runtime. This is used mainly for GC purposes to represent outbound reference from\n\t// the container runtime to other nodes.\n\tprivate readonly containerRuntimeHandle: IFluidHandle;\n\tprivate readonly pendingAliasMap: Map<string, Promise<AliasResult>> = new Map<\n\t\tstring,\n\t\tPromise<AliasResult>\n\t>();\n\n\tprotected readonly contexts: DataStoreContexts;\n\tprivate readonly aliasedDataStores: Set<string>;\n\n\tconstructor(\n\t\tprotected readonly baseSnapshot: ISnapshotTree | undefined,\n\t\tpublic readonly parentContext: IFluidParentContext,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly gcNodeUpdated: (\n\t\t\tnodePath: string,\n\t\t\treason: \"Loaded\" | \"Changed\",\n\t\t\ttimestampMs?: number,\n\t\t\tpackagePath?: readonly string[],\n\t\t\trequest?: IRequest,\n\t\t\theaderData?: RuntimeHeaderData,\n\t\t) => void,\n\t\tprivate readonly isDataStoreDeleted: (nodePath: string) => boolean,\n\t\tprivate readonly aliasMap: Map<string, string>,\n\t\tprovideEntryPoint: (runtime: ChannelCollection) => Promise<FluidObject>,\n\t) {\n\t\tthis.mc = createChildMonitoringContext({ logger: baseLogger });\n\t\tthis.contexts = new DataStoreContexts(baseLogger);\n\t\tthis.containerRuntimeHandle = new FluidObjectHandle(\n\t\t\tthis.parentContext,\n\t\t\t\"/\",\n\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t);\n\t\tthis.entryPoint = new FluidObjectHandle<FluidObject>(\n\t\t\tnew LazyPromise(async () => provideEntryPoint(this)),\n\t\t\t\"\",\n\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t);\n\t\tthis.aliasedDataStores = new Set(aliasMap.values());\n\n\t\t// Extract stores stored inside the snapshot\n\t\tconst fluidDataStores = new Map<string, ISnapshotTree>();\n\t\tif (baseSnapshot) {\n\t\t\tfor (const [key, value] of Object.entries(baseSnapshot.trees)) {\n\t\t\t\tfluidDataStores.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\tlet unreferencedDataStoreCount = 0;\n\t\t// Create a context for each of them\n\t\tfor (const [key, value] of fluidDataStores) {\n\t\t\tlet dataStoreContext: FluidDataStoreContext;\n\n\t\t\t// counting number of unreferenced data stores\n\t\t\tif (value.unreferenced) {\n\t\t\t\tunreferencedDataStoreCount++;\n\t\t\t}\n\t\t\t// If we have a detached container, then create local data store contexts.\n\t\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\t\tdataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tsnapshotTree: value,\n\t\t\t\t\tparentContext: this.wrapContextForInnerChannel(key),\n\t\t\t\t\tstorage: this.parentContext.storage,\n\t\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tloadingGroupId: value.groupId,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tthrow new LoggingError(\"Snapshot should be there to load from!!\");\n\t\t\t\t}\n\t\t\t\tconst snapshotTree = value;\n\t\t\t\tdataStoreContext = new LocalFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tpkg: undefined,\n\t\t\t\t\tparentContext: this.wrapContextForInnerChannel(key),\n\t\t\t\t\tstorage: this.parentContext.storage,\n\t\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),\n\t\t\t\t\tsnapshotTree,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\t\t}\n\t\tthis.containerLoadStats = {\n\t\t\tcontainerLoadDataStoreCount: fluidDataStores.size,\n\t\t\treferencedDataStoreCount: fluidDataStores.size - unreferencedDataStoreCount,\n\t\t};\n\t}\n\n\tpublic get aliases(): ReadonlyMap<string, string> {\n\t\treturn this.aliasMap;\n\t}\n\n\tpublic get pendingAliases(): Map<string, Promise<AliasResult>> {\n\t\treturn this.pendingAliasMap;\n\t}\n\n\tpublic async waitIfPendingAlias(maybeAlias: string): Promise<AliasResult> {\n\t\tconst pendingAliasPromise = this.pendingAliases.get(maybeAlias);\n\t\treturn pendingAliasPromise ?? \"Success\";\n\t}\n\n\t/** For sampling. Only log once per container */\n\tprivate shouldSendAttachLog = true;\n\n\tprotected wrapContextForInnerChannel(id: string): IFluidParentContext {\n\t\treturn wrapContextForInnerChannel(id, this.parentContext);\n\t}\n\n\t/**\n\t * IFluidDataStoreChannel.makeVisibleAndAttachGraph implementation\n\t * Not clear when it would be called and what it should do.\n\t * Currently this API is called by context only for root data stores.\n\t */\n\tpublic makeVisibleAndAttachGraph() {\n\t\tthis.parentContext.makeLocallyVisible();\n\t}\n\n\tprivate processAttachMessage(message: ISequencedDocumentMessage, local: boolean) {\n\t\tconst attachMessage = message.contents as InboundAttachMessage;\n\n\t\tthis.dataStoresSinceLastGC.push(attachMessage.id);\n\n\t\t// We need to process the GC Data for both local and remote attach messages\n\t\tconst foundGCData = processAttachMessageGCData(attachMessage.snapshot, (nodeId, toPath) => {\n\t\t\t// nodeId is the relative path under the node being attached. Always starts with \"/\", but no trailing \"/\" after an id\n\t\t\tconst fromPath = `/${attachMessage.id}${nodeId === \"/\" ? \"\" : nodeId}`;\n\t\t\tthis.parentContext.addedGCOutboundReference?.(\n\t\t\t\t{ absolutePath: fromPath },\n\t\t\t\t{ absolutePath: toPath },\n\t\t\t);\n\t\t});\n\n\t\t// Only log once per container to avoid noise/cost.\n\t\t// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details\n\t\tif (this.shouldSendAttachLog) {\n\t\t\tthis.shouldSendAttachLog = false;\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"dataStoreAttachMessage_sampled\",\n\t\t\t\t...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),\n\t\t\t\tdetails: {\n\t\t\t\t\tlocal,\n\t\t\t\t\tsnapshot: !!attachMessage.snapshot,\n\t\t\t\t\tfoundGCData,\n\t\t\t\t},\n\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t});\n\t\t}\n\n\t\t// The local object has already been attached\n\t\tif (local) {\n\t\t\tassert(\n\t\t\t\tthis.pendingAttach.has(attachMessage.id),\n\t\t\t\t0x15e /* \"Local object does not have matching attach message id\" */,\n\t\t\t);\n\t\t\tthis.contexts.get(attachMessage.id)?.setAttachState(AttachState.Attached);\n\t\t\tthis.pendingAttach.delete(attachMessage.id);\n\t\t\treturn;\n\t\t}\n\n\t\t// If a non-local operation then go and create the object, otherwise mark it as officially attached.\n\t\tif (this.alreadyProcessed(attachMessage.id)) {\n\t\t\t// TODO: dataStoreId may require a different tag from PackageData #7488\n\t\t\tconst error = new DataCorruptionError(\n\t\t\t\t// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId\n\t\t\t\t\"Duplicate DataStore created with existing id\",\n\t\t\t\t{\n\t\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t\t\t...tagCodeArtifacts({ dataStoreId: attachMessage.id }),\n\t\t\t\t},\n\t\t\t);\n\t\t\tthrow error;\n\t\t}\n\n\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\tlet snapshotTree: ISnapshotTree | undefined;\n\t\tif (attachMessage.snapshot) {\n\t\t\tsnapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);\n\t\t}\n\n\t\t// Include the type of attach message which is the pkg of the store to be\n\t\t// used by RemoteFluidDataStoreContext in case it is not in the snapshot.\n\t\tconst pkg = [attachMessage.type];\n\t\tconst remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\tid: attachMessage.id,\n\t\t\tsnapshotTree,\n\t\t\tparentContext: this.wrapContextForInnerChannel(attachMessage.id),\n\t\t\tstorage: new StorageServiceWithAttachBlobs(this.parentContext.storage, flatAttachBlobs),\n\t\t\tscope: this.parentContext.scope,\n\t\t\tloadingGroupId: attachMessage.snapshot?.groupId,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(\n\t\t\t\tattachMessage.id,\n\t\t\t\t{\n\t\t\t\t\ttype: CreateSummarizerNodeSource.FromAttach,\n\t\t\t\t\tsequenceNumber: message.sequenceNumber,\n\t\t\t\t\tsnapshot: attachMessage.snapshot ?? {\n\t\t\t\t\t\tentries: [createAttributesBlob(pkg, true /* isRootDataStore */)],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t),\n\t\t\tpkg,\n\t\t});\n\n\t\tthis.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);\n\t}\n\n\tprivate processAliasMessage(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: unknown,\n\t\tlocal: boolean,\n\t): void {\n\t\tconst aliasMessage = message.contents as IDataStoreAliasMessage;\n\t\tif (!isDataStoreAliasMessage(aliasMessage)) {\n\t\t\tthrow new DataCorruptionError(\"malformedDataStoreAliasMessage\", {\n\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t});\n\t\t}\n\n\t\tconst resolve = localOpMetadata as PendingAliasResolve;\n\t\tconst aliasResult = this.processAliasMessageCore(\n\t\t\taliasMessage.internalId,\n\t\t\taliasMessage.alias,\n\t\t);\n\t\tif (local) {\n\t\t\tresolve(aliasResult);\n\t\t}\n\t}\n\n\tpublic processAliasMessageCore(internalId: string, alias: string): boolean {\n\t\tif (this.alreadyProcessed(alias)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst context = this.contexts.get(internalId);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted a signal.\n\t\tif (this.checkAndLogIfDeleted(internalId, context, \"Changed\", \"processAliasMessageCore\")) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (context === undefined) {\n\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\teventName: \"AliasFluidDataStoreNotFound\",\n\t\t\t\tfluidDataStoreId: internalId,\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst handle = new FluidObjectHandle(\n\t\t\tcontext,\n\t\t\tinternalId,\n\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t);\n\t\tthis.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);\n\n\t\tthis.aliasMap.set(alias, context.id);\n\t\tthis.aliasedDataStores.add(context.id);\n\t\tcontext.setInMemoryRoot();\n\t\treturn true;\n\t}\n\n\tprivate alreadyProcessed(id: string): boolean {\n\t\treturn this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;\n\t}\n\n\t/** Package up the context's attach summary etc into an IAttachMessage */\n\tprivate generateAttachMessage(localContext: IFluidDataStoreContextInternal): IAttachMessage {\n\t\tconst { attachSummary } = localContext.getAttachData(/* includeGCData: */ true);\n\t\tconst type = localContext.packagePath[localContext.packagePath.length - 1];\n\n\t\t// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.\n\t\tconst snapshot = convertSummaryTreeToITree(attachSummary.summary);\n\n\t\treturn {\n\t\t\tid: localContext.id,\n\t\t\tsnapshot,\n\t\t\ttype,\n\t\t} satisfies IAttachMessage;\n\t}\n\n\t/**\n\t * Make the data store locally visible in the container graph by moving the data store context from unbound to\n\t * bound list and submitting the attach message. This data store can now be reached from the root.\n\t * @param id - The id of the data store context to make visible.\n\t */\n\tprivate makeDataStoreLocallyVisible(id: string): void {\n\t\tconst localContext = this.contexts.getUnbound(id);\n\t\tassert(!!localContext, 0x15f /* \"Could not find unbound context to bind\" */);\n\n\t\t/**\n\t\t * If the container is not detached, it is globally visible to all clients. This data store should also be\n\t\t * globally visible. Move it to attaching state and send an \"attach\" op for it.\n\t\t * If the container is detached, this data store will be part of the summary that makes the container attached.\n\t\t */\n\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\tlocalContext.setAttachState(AttachState.Attaching);\n\t\t\tthis.submitAttachChannelOp(localContext);\n\t\t}\n\n\t\tthis.contexts.bind(id);\n\t}\n\n\tprotected submitAttachChannelOp(localContext: LocalFluidDataStoreContext) {\n\t\tconst message = this.generateAttachMessage(localContext);\n\t\tthis.pendingAttach.set(localContext.id, message);\n\t\tthis.parentContext.submitMessage(ContainerMessageType.Attach, message, undefined);\n\t\tthis.attachOpFiredForDataStore.add(localContext.id);\n\t}\n\n\t/**\n\t * Generate compact internal DataStore ID.\n\t *\n\t * A note about namespace and name collisions:\n\t * This code assumes that that's the only way to generate internal IDs, and that it's Ok for this namespace to overlap with\n\t * user-provided alias names namespace.\n\t * There are two scenarios where it could cause trouble:\n\t * 1) Old files, where (already removed) CreateRoot*DataStore*() API was used, and thus internal name of data store\n\t * was provided by user. Such files may experience name collision with future data stores that receive a name generated\n\t * by this function.\n\t * 2) Much less likely, but if it happen that internal ID (generated by this function) is exactly the same as alias name\n\t * that user might use in the future, them ContainerRuntime.getAliasedDataStoreEntryPoint() or\n\t * ContainerRuntime.getDataStoreFromRequest() could return a data store with internalID matching user request, even though\n\t * user expected some other data store (that would receive alias later).\n\t * Please note that above mentioned functions have the implementation they have (allowing #2) due to #1.\n\t */\n\tprotected createDataStoreId(): string {\n\t\t// We use three non-overlapping namespaces:\n\t\t// - detached state: even numbers\n\t\t// - attached state: odd numbers\n\t\t// - uuids\n\t\t// In first two cases we will encode result as strings in more compact form.\n\t\tif (this.parentContext.attachState === AttachState.Detached) {\n\t\t\t// container is detached, only one client observes content, no way to hit collisions with other clients.\n\t\t\treturn encodeCompactIdToString(2 * this.contexts.size);\n\t\t}\n\t\tconst id = this.parentContext.containerRuntime.generateDocumentUniqueId();\n\t\tif (typeof id === \"number\") {\n\t\t\treturn encodeCompactIdToString(2 * id + 1);\n\t\t}\n\t\treturn id;\n\t}\n\n\tpublic createDetachedDataStore(\n\t\tpkg: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextDetached {\n\t\treturn this.createContext(\n\t\t\tthis.createDataStoreId(),\n\t\t\tpkg,\n\t\t\tLocalDetachedFluidDataStoreContext,\n\t\t\tundefined, // props\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\tpublic createDataStoreContext(\n\t\tpkg: Readonly<string[]>,\n\t\tprops?: any,\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextInternal {\n\t\treturn this.createContext(\n\t\t\tthis.createDataStoreId(),\n\t\t\tpkg,\n\t\t\tLocalFluidDataStoreContext,\n\t\t\tprops,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\tprotected createContext<T extends LocalFluidDataStoreContext>(\n\t\tid: string,\n\t\tpkg: Readonly<string[]>,\n\t\tcontextCtor: new (props: ILocalDetachedFluidDataStoreContextProps) => T,\n\t\tcreateProps?: any,\n\t\tloadingGroupId?: string,\n\t) {\n\t\tconst context = new contextCtor({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage: this.parentContext.storage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tcreateProps,\n\t\t\tloadingGroupId,\n\t\t\tchannelToDataStoreFn: (channel: IFluidDataStoreChannel) =>\n\t\t\t\tchannelToDataStore(\n\t\t\t\t\tchannel,\n\t\t\t\t\tid,\n\t\t\t\t\tthis,\n\t\t\t\t\tcreateChildLogger({ logger: this.parentContext.logger }),\n\t\t\t\t),\n\t\t});\n\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic get disposed() {\n\t\treturn this.disposeOnce.evaluated;\n\t}\n\tpublic readonly dispose = () => this.disposeOnce.value;\n\n\tpublic reSubmit(type: string, content: any, localOpMetadata: unknown) {\n\t\tswitch (type) {\n\t\t\tcase ContainerMessageType.Attach:\n\t\t\tcase ContainerMessageType.Alias:\n\t\t\t\tthis.parentContext.submitMessage(type, content, localOpMetadata);\n\t\t\t\treturn;\n\t\t\tcase ContainerMessageType.FluidDataStoreOp:\n\t\t\t\treturn this.reSubmitChannelOp(type, content, localOpMetadata);\n\t\t\tdefault:\n\t\t\t\tassert(false, 0x907 /* unknown op type */);\n\t\t}\n\t}\n\n\tprotected reSubmitChannelOp(type: string, content: any, localOpMetadata: unknown) {\n\t\tconst envelope = content as IEnvelope;\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and throw an error. If there are local changes for a\n\t\t// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"resubmitDataStoreOp\")\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"Context is deleted!\", {\n\t\t\t\tcallSite: \"resubmitDataStoreOp\",\n\t\t\t\t...tagCodeArtifacts({ id: envelope.address }),\n\t\t\t});\n\t\t}\n\t\tassert(!!context, 0x160 /* \"There should be a store context for the op\" */);\n\t\tconst innerContents = envelope.contents as FluidDataStoreMessage;\n\t\tcontext.reSubmit(innerContents.type, innerContents.content, localOpMetadata);\n\t}\n\n\tpublic rollback(type: string, content: any, localOpMetadata: unknown) {\n\t\tassert(type === ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);\n\t\tconst envelope = content as IEnvelope;\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and throw an error. If there are local changes for a\n\t\t// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"rollbackDataStoreOp\")\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"Context is deleted!\", {\n\t\t\t\tcallSite: \"rollbackDataStoreOp\",\n\t\t\t\t...tagCodeArtifacts({ id: envelope.address }),\n\t\t\t});\n\t\t}\n\t\tassert(!!context, 0x2e8 /* \"There should be a store context for the op\" */);\n\t\tconst innerContents = envelope.contents as FluidDataStoreMessage;\n\t\tcontext.rollback(innerContents.type, innerContents.content, localOpMetadata);\n\t}\n\n\tpublic async applyStashedOp(content: unknown): Promise<unknown> {\n\t\tconst opContents = content as LocalContainerRuntimeMessage;\n\t\tswitch (opContents.type) {\n\t\t\tcase ContainerMessageType.Attach:\n\t\t\t\treturn this.applyStashedAttachOp(opContents.contents);\n\t\t\tcase ContainerMessageType.Alias:\n\t\t\t\treturn;\n\t\t\tcase ContainerMessageType.FluidDataStoreOp:\n\t\t\t\treturn this.applyStashedChannelChannelOp(opContents.contents);\n\t\t\tdefault:\n\t\t\t\tassert(false, 0x908 /* unknon type of op */);\n\t\t}\n\t}\n\n\tprotected async applyStashedChannelChannelOp(envelope: IEnvelope) {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case the data store that stashed the op is deleted.\n\t\tif (this.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"applyStashedOp\")) {\n\t\t\treturn undefined;\n\t\t}\n\t\tassert(!!context, 0x161 /* \"There should be a store context for the op\" */);\n\t\treturn context.applyStashedOp(envelope.contents);\n\t}\n\n\tprivate async applyStashedAttachOp(message: IAttachMessage) {\n\t\tconst { id, snapshot } = message;\n\n\t\t// build the snapshot from the summary in the attach message\n\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\tconst snapshotTree = buildSnapshotTree(snapshot.entries, flatAttachBlobs);\n\t\tconst storage = new StorageServiceWithAttachBlobs(\n\t\t\tthis.parentContext.storage,\n\t\t\tflatAttachBlobs,\n\t\t);\n\n\t\t// create a local datastore context for the data store context,\n\t\t// which this message represents. All newly created data store\n\t\t// contexts start as a local context on the client that created\n\t\t// them, and for stashed ops, the client that applies it plays\n\t\t// the role of creating client.\n\t\tconst dataStoreContext = new LocalFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg: undefined,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree,\n\t\t});\n\n\t\t// realize the local context, as local contexts shouldn't be delay\n\t\t// loaded, as this client is playing the role of creating client,\n\t\t// and creating clients always create realized data store contexts.\n\t\tconst channel = await dataStoreContext.realize();\n\t\tawait channel.entryPoint.get();\n\n\t\t// add to the list of bound or remoted, as this context must be bound\n\t\t// to had an attach message sent, and is the non-detached case is remoted.\n\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\t// if the client is not detached put in the pending attach list\n\t\t\t// so that on ack of the stashed op, the context is found.\n\t\t\t// detached client don't send ops, so should not expect and ack.\n\t\t\tthis.pendingAttach.set(message.id, message);\n\t\t}\n\t}\n\n\tpublic process(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalMessageMetadata: unknown,\n\t\taddedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,\n\t) {\n\t\tswitch (message.type) {\n\t\t\tcase ContainerMessageType.Attach:\n\t\t\t\tthis.processAttachMessage(message, local);\n\t\t\t\treturn;\n\t\t\tcase ContainerMessageType.Alias:\n\t\t\t\tthis.processAliasMessage(message, localMessageMetadata, local);\n\t\t\t\treturn;\n\t\t\tcase ContainerMessageType.FluidDataStoreOp: {\n\t\t\t\tconst envelope = message.contents as IEnvelope;\n\t\t\t\tconst innerContents = envelope.contents as FluidDataStoreMessage;\n\t\t\t\tconst transformed = {\n\t\t\t\t\t...message,\n\t\t\t\t\ttype: innerContents.type,\n\t\t\t\t\tcontents: innerContents.content,\n\t\t\t\t};\n\n\t\t\t\tthis.processChannelOp(envelope.address, transformed, local, localMessageMetadata);\n\n\t\t\t\t// By default, we use the new behavior of detecting outbound routes here.\n\t\t\t\t// If this setting is true, then DataStoreContext would be notifying GC instead.\n\t\t\t\tif (\n\t\t\t\t\tthis.mc.config.getBoolean(detectOutboundRoutesViaDDSKey) !== true &&\n\t\t\t\t\taddedOutboundReference !== undefined\n\t\t\t\t) {\n\t\t\t\t\t// Notify GC of any outbound references that were added by this op.\n\t\t\t\t\tdetectOutboundReferences(\n\t\t\t\t\t\tenvelope.address,\n\t\t\t\t\t\ttransformed.contents,\n\t\t\t\t\t\taddedOutboundReference,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tassert(false, 0x8e9 /* unreached */);\n\t\t}\n\t}\n\n\tprotected processChannelOp(\n\t\taddress: string,\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalMessageMetadata: unknown,\n\t) {\n\t\tconst context = this.contexts.get(address);\n\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted an op.\n\t\tif (this.checkAndLogIfDeleted(address, context, \"Changed\", \"processFluidDataStoreOp\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (context === undefined) {\n\t\t\t// Former assert 0x162\n\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\"No context for op\",\n\t\t\t\t\"processFluidDataStoreOp\",\n\t\t\t\tmessage,\n\t\t\t\t{\n\t\t\t\t\tlocal,\n\t\t\t\t\tmessageDetails: JSON.stringify({\n\t\t\t\t\t\ttype: message.type,\n\t\t\t\t\t\tcontentType: typeof message.contents,\n\t\t\t\t\t}),\n\t\t\t\t\t...tagCodeArtifacts({ address }),\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tcontext.process(message, local, localMessageMetadata);\n\n\t\t// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is\n\t\t// being used.\n\t\tthis.gcNodeUpdated(\n\t\t\t`/${address}`,\n\t\t\t\"Changed\",\n\t\t\tmessage.timestamp,\n\t\t\tcontext.isLoaded ? context.packagePath : undefined,\n\t\t);\n\t}\n\n\tpublic async getDataStore(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<IFluidDataStoreContextInternal> {\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tid,\n\t\t\t\tthis.contexts.get(id),\n\t\t\t\t\"Requested\",\n\t\t\t\t\"getDataStore\",\n\t\t\t\trequestHeaderData,\n\t\t\t)\n\t\t) {\n\t\t\t// The requested data store has been deleted by gc. Create a 404 response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", request),\n\t\t\t\trequest,\n\t\t\t);\n\t\t}\n\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\t// The requested data store does not exits. Throw a 404 response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(create404Response(request), request);\n\t\t}\n\t\treturn context;\n\t}\n\n\t/**\n\t * Returns the data store requested with the given id if available. Otherwise, returns undefined.\n\t */\n\tpublic async getDataStoreIfAvailable(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<IFluidDataStoreContextInternal | undefined> {\n\t\t// If the data store has been deleted, log an error and return undefined.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tid,\n\t\t\t\tthis.contexts.get(id),\n\t\t\t\t\"Requested\",\n\t\t\t\t\"getDataStoreIfAvailable\",\n\t\t\t\trequestHeaderData,\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn context;\n\t}\n\n\t/**\n\t * Checks if the data store has been deleted by GC. If so, log an error.\n\t * @param id - The data store's id.\n\t * @param context - The data store context.\n\t * @param callSite - The function name this is called from.\n\t * @param requestHeaderData - The request header information to log if the data store is deleted.\n\t * @returns true if the data store is deleted. Otherwise, returns false.\n\t */\n\tprivate checkAndLogIfDeleted(\n\t\tid: string,\n\t\tcontext: IFluidDataStoreContext | undefined,\n\t\tdeletedLogSuffix: string,\n\t\tcallSite: string,\n\t\trequestHeaderData?: RuntimeHeaderData,\n\t) {\n\t\tconst dataStoreNodePath = `/${id}`;\n\t\tif (!this.isDataStoreDeleted(dataStoreNodePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.mc.logger.sendErrorEvent({\n\t\t\teventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,\n\t\t\t...tagCodeArtifacts({ id }),\n\t\t\tcallSite,\n\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\texists: context !== undefined,\n\t\t});\n\t\treturn true;\n\t}\n\n\tpublic processSignal(messageArg: IInboundSignalMessage, local: boolean) {\n\t\tconst envelope = messageArg.content as IEnvelope;\n\t\tconst fluidDataStoreId = envelope.address;\n\t\tconst message = { ...messageArg, content: envelope.contents };\n\t\tconst context = this.contexts.get(fluidDataStoreId);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted a signal.\n\t\tif (this.checkAndLogIfDeleted(fluidDataStoreId, context, \"Changed\", \"processSignal\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!context) {\n\t\t\t// Attach message may not have been processed yet\n\t\t\tassert(!local, 0x163 /* \"Missing datastore for local signal\" */);\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"SignalFluidDataStoreNotFound\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tcontext.processSignal(message, local);\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.setConnectionState(connected, clientId);\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"SetConnectionStateError\",\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\truntimeConnected: this.parentContext.connected,\n\t\t\t\t\t\t\tconnected,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tfor (const [, context] of this.contexts) {\n\t\t\t// Fire only for bounded stores.\n\t\t\tif (!this.contexts.isNotBound(context.id)) {\n\t\t\t\tcontext.setAttachState(attachState);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.contexts.size;\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\n\t\t// Iterate over each store and ask it to snapshot\n\t\tawait Promise.all(\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(([_, context]) => {\n\t\t\t\t\t// Summarizer works only with clients with no local changes. A data store in attaching\n\t\t\t\t\t// state indicates an op was sent to attach a local data store, and the the attach op\n\t\t\t\t\t// had not yet round tripped back to the client.\n\t\t\t\t\tif (context.attachState === AttachState.Attaching) {\n\t\t\t\t\t\t// Formerly assert 0x588\n\t\t\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\t\t\"Local data store detected in attaching state during summarize\",\n\t\t\t\t\t\t\t\"summarize\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\treturn context.attachState === AttachState.Attached;\n\t\t\t\t})\n\t\t\t\t.map(async ([contextId, context]) => {\n\t\t\t\t\tconst contextSummary = await context.summarize(\n\t\t\t\t\t\tfullTree,\n\t\t\t\t\t\ttrackState,\n\t\t\t\t\t\ttelemetryContext,\n\t\t\t\t\t);\n\t\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t\t}),\n\t\t);\n\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t */\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\t// Attaching graph of some stores can cause other stores to get bound too.\n\t\t// So keep taking summary until no new stores get bound.\n\t\tlet notBoundContextsLength: number;\n\t\tdo {\n\t\t\tconst builderTree = builder.summary.tree;\n\t\t\tnotBoundContextsLength = this.contexts.notBoundLength();\n\t\t\t// Iterate over each data store and ask it to snapshot\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(\n\t\t\t\t\t([key, _]) =>\n\t\t\t\t\t\t// Take summary of bounded data stores only, make sure we haven't summarized them already\n\t\t\t\t\t\t// and no attach op has been fired for that data store because for loader versions <= 0.24\n\t\t\t\t\t\t// we set attach state as \"attaching\" before taking createNew summary.\n\t\t\t\t\t\t!(\n\t\t\t\t\t\t\tthis.contexts.isNotBound(key) ||\n\t\t\t\t\t\t\tbuilderTree[key] ||\n\t\t\t\t\t\t\tthis.attachOpFiredForDataStore.has(key)\n\t\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t.map(([key, value]) => {\n\t\t\t\t\tlet dataStoreSummary: ISummarizeResult;\n\t\t\t\t\tif (value.isLoaded) {\n\t\t\t\t\t\tdataStoreSummary = value.getAttachData(\n\t\t\t\t\t\t\t/* includeGCCData: */ false,\n\t\t\t\t\t\t\ttelemetryContext,\n\t\t\t\t\t\t).attachSummary;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If this data store is not yet loaded, then there should be no changes in the snapshot from\n\t\t\t\t\t\t// which it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\t!!this.baseSnapshot,\n\t\t\t\t\t\t\t0x166 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdataStoreSummary = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\t\tthis.baseSnapshot.trees[key],\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbuilder.addWithStats(key, dataStoreSummary);\n\t\t\t\t});\n\t\t} while (notBoundContextsLength !== this.contexts.notBoundLength());\n\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Before GC runs, called by the garbage collector to update any pending GC state.\n\t * The garbage collector needs to know all outbound references that are added. Since root data stores are not\n\t * explicitly marked as referenced, notify GC of new root data stores that were added since the last GC run.\n\t */\n\tpublic async updateStateBeforeGC(): Promise<void> {\n\t\tfor (const id of this.dataStoresSinceLastGC) {\n\t\t\tconst context = this.contexts.get(id);\n\t\t\tassert(context !== undefined, 0x2b6 /* Missing data store context */);\n\t\t\tif (await context.isRoot()) {\n\t\t\t\t// A root data store is basically a reference from the container runtime to the data store.\n\t\t\t\tconst handle = new FluidObjectHandle(\n\t\t\t\t\tcontext,\n\t\t\t\t\tid,\n\t\t\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t\t\t);\n\t\t\t\tthis.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);\n\t\t\t}\n\t\t}\n\t\tthis.dataStoresSinceLastGC = [];\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. It does the following:\n\t *\n\t * 1. Calls into each child data store context to get its GC data.\n\t *\n\t * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be\n\t * identified as belonging to the child.\n\t *\n\t * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent\n\t * the GC data of this channel.\n\t *\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst builder = new GCDataBuilder();\n\t\t// Iterate over each store and get their GC data.\n\t\tawait Promise.all(\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(([_, context]) => {\n\t\t\t\t\t// Summarizer client and hence GC works only with clients with no local changes. A data store in\n\t\t\t\t\t// attaching state indicates an op was sent to attach a local data store, and the the attach op\n\t\t\t\t\t// had not yet round tripped back to the client.\n\t\t\t\t\t// Formerly assert 0x589\n\t\t\t\t\tif (context.attachState === AttachState.Attaching) {\n\t\t\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\t\t\"Local data store detected in attaching state while running GC\",\n\t\t\t\t\t\t\t\"getGCData\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn context.attachState === AttachState.Attached;\n\t\t\t\t})\n\t\t\t\t.map(async ([contextId, context]) => {\n\t\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\t\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t\t}),\n\t\t);\n\n\t\t// Get the outbound routes and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", await this.getOutboundRoutes());\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * After GC has run, called to notify this Container's data stores of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in all data stores in this Container.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: readonly string[]) {\n\t\t// Get a map of data store ids to routes used in it.\n\t\tconst usedDataStoreRoutes = unpackChildNodesUsedRoutes(usedRoutes);\n\n\t\t// Verify that the used routes are correct.\n\t\tfor (const [id] of usedDataStoreRoutes) {\n\t\t\tassert(\n\t\t\t\tthis.contexts.has(id),\n\t\t\t\t0x167 /* \"Used route does not belong to any known data store\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.updateUsedRoutes(usedDataStoreRoutes.get(contextId) ?? []);\n\t\t}\n\t}\n\n\tpublic deleteChild(dataStoreId: string) {\n\t\tconst dataStoreContext = this.contexts.get(dataStoreId);\n\t\tassert(dataStoreContext !== undefined, 0x2d7 /* No data store with specified id */);\n\n\t\tdataStoreContext.delete();\n\t\t// Delete the contexts of unused data stores.\n\t\tthis.contexts.delete(dataStoreId);\n\t\t// Delete the summarizer node of the unused data stores.\n\t\tthis.parentContext.deleteChildSummarizerNode(dataStoreId);\n\t}\n\n\t/**\n\t * Delete data stores and its objects that are sweep ready.\n\t * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should\n\t * be deleted.\n\t * @returns The routes of data stores and its objects that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(sweepReadyDataStoreRoutes: readonly string[]): readonly string[] {\n\t\tfor (const route of sweepReadyDataStoreRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tconst dataStoreId = pathParts[1];\n\n\t\t\t// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only\n\t\t\t// need to delete the data store.\n\t\t\t// These routes will still be returned below as among the deleted routes\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst dataStoreContext = this.contexts.get(dataStoreId);\n\t\t\tif (dataStoreContext === undefined) {\n\t\t\t\t// If the data store hasn't already been deleted, log an error because this should never happen.\n\t\t\t\t// If the data store has already been deleted, log a telemetry event. This can happen because multiple GC\n\t\t\t\t// sweep ops can contain the same data store. It would be interesting to track how often this happens.\n\t\t\t\tconst alreadyDeleted = this.isDataStoreDeleted(`/${dataStoreId}`);\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"DeletedDataStoreNotFound\",\n\t\t\t\t\tcategory: alreadyDeleted ? \"generic\" : \"error\",\n\t\t\t\t\t...tagCodeArtifacts({ id: dataStoreId }),\n\t\t\t\t\tdetails: { alreadyDeleted },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.deleteChild(dataStoreId);\n\t\t}\n\t\treturn Array.from(sweepReadyDataStoreRoutes);\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are tombstones.\n\t *\n\t * A Tombstoned object has been unreferenced long enough that GC knows it won't be referenced again.\n\t * Tombstoned objects are eventually deleted by GC.\n\t *\n\t * @param tombstonedRoutes - The routes that are tombstones in all data stores in this Container.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {\n\t\tconst tombstonedDataStoresSet: Set<string> = new Set();\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Tombstone data store only if its route (/datastoreId) is directly in tombstoneRoutes.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);\n\t\t\ttombstonedDataStoresSet.add(dataStoreId);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.setTombstone(tombstonedDataStoresSet.has(contextId));\n\t\t}\n\t}\n\n\t/**\n\t * Returns the outbound routes of this channel. Only root data stores are considered referenced and their paths are\n\t * part of outbound routes.\n\t */\n\tprivate async getOutboundRoutes(): Promise<string[]> {\n\t\tconst outboundRoutes: string[] = [];\n\t\t// Getting this information is a performance optimization that reduces network calls for virtualized datastores\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tconst isRootDataStore = await context.isRoot(this.aliasedDataStores);\n\t\t\tif (isRootDataStore) {\n\t\t\t\toutboundRoutes.push(`/${contextId}`);\n\t\t\t}\n\t\t}\n\t\treturn outboundRoutes;\n\t}\n\n\t/**\n\t * Called by GC to retrieve the package path of a data store node with the given path.\n\t */\n\tpublic async getDataStorePackagePath(nodePath: string): Promise<readonly string[] | undefined> {\n\t\t// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the\n\t\t// data store that contains it.\n\t\tconst context = this.contexts.get(nodePath.split(\"/\")[1]);\n\t\treturn (await context?.getInitialSnapshotDetails())?.pkg;\n\t}\n\n\t/**\n\t * Called by GC to determine if a node is for a data store or for an object within a data store (for e.g. DDS).\n\t * @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.\n\t */\n\tpublic getGCNodeType(nodePath: string): GCNodeType | undefined {\n\t\tconst pathParts = nodePath.split(\"/\");\n\t\tif (!this.contexts.has(pathParts[1])) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Data stores paths are of the format \"/dataStoreId\".\n\t\t// Sub data store paths are of the format \"/dataStoreId/subPath/...\".\n\t\tif (pathParts.length === 2) {\n\t\t\treturn GCNodeType.DataStore;\n\t\t}\n\t\treturn GCNodeType.SubDataStore;\n\t}\n\n\tpublic internalId(maybeAlias: string): string {\n\t\treturn this.aliases.get(maybeAlias) ?? maybeAlias;\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\tconst requestParser = RequestParser.create(request);\n\t\tconst id = requestParser.pathParts[0];\n\n\t\t// Differentiate between requesting the dataStore directly, or one of its children\n\t\tconst requestForChild = !requestParser.isLeaf(1);\n\n\t\tconst headerData: RuntimeHeaderData = {};\n\t\tif (typeof request.headers?.[RuntimeHeaders.wait] === \"boolean\") {\n\t\t\theaderData.wait = request.headers[RuntimeHeaders.wait];\n\t\t}\n\t\tif (typeof request.headers?.[RuntimeHeaders.viaHandle] === \"boolean\") {\n\t\t\theaderData.viaHandle = request.headers[RuntimeHeaders.viaHandle];\n\t\t}\n\t\tif (typeof request.headers?.[AllowTombstoneRequestHeaderKey] === \"boolean\") {\n\t\t\theaderData.allowTombstone = request.headers[AllowTombstoneRequestHeaderKey];\n\t\t}\n\t\tif (typeof request.headers?.[AllowInactiveRequestHeaderKey] === \"boolean\") {\n\t\t\theaderData.allowInactive = request.headers[AllowInactiveRequestHeaderKey];\n\t\t}\n\n\t\t// We allow Tombstone requests for sub-DataStore objects\n\t\tif (requestForChild) {\n\t\t\theaderData.allowTombstone = true;\n\t\t}\n\n\t\tawait this.waitIfPendingAlias(id);\n\t\tconst internalId = this.internalId(id);\n\t\tconst dataStoreContext = await this.getDataStore(internalId, headerData);\n\n\t\t// Remove query params, leading and trailing slashes from the url. This is done to make sure the format is\n\t\t// the same as GC nodes id.\n\t\tconst urlWithoutQuery = trimLeadingAndTrailingSlashes(request.url.split(\"?\")[0]);\n\t\t// Get the initial snapshot details which contain the data store package path.\n\t\tconst details = await dataStoreContext.getInitialSnapshotDetails();\n\n\t\t// Note that this will throw if the data store is inactive or tombstoned and throwing on incorrect usage\n\t\t// is configured.\n\t\tthis.gcNodeUpdated(\n\t\t\t`/${urlWithoutQuery}`,\n\t\t\t\"Loaded\",\n\t\t\tundefined /* timestampMs */,\n\t\t\tdetails.pkg,\n\t\t\trequest,\n\t\t\theaderData,\n\t\t);\n\t\tconst dataStore = await dataStoreContext.realize();\n\n\t\tconst subRequest = requestParser.createSubRequest(1);\n\t\t// We always expect createSubRequest to include a leading slash, but asserting here to protect against\n\t\t// unintentionally modifying the url if that changes.\n\t\tassert(\n\t\t\tsubRequest.url.startsWith(\"/\"),\n\t\t\t0x126 /* \"Expected createSubRequest url to include a leading slash\" */,\n\t\t);\n\n\t\treturn dataStore.request(subRequest);\n\t}\n}\n\nexport function getSummaryForDatastores(\n\tsnapshot: ISnapshotTree | undefined,\n\tmetadata?: IContainerRuntimeMetadata,\n): ISnapshotTree | undefined {\n\tif (!snapshot) {\n\t\treturn undefined;\n\t}\n\n\tif (rootHasIsolatedChannels(metadata)) {\n\t\tconst datastoresSnapshot = snapshot.trees[channelsTreeName];\n\t\tassert(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);\n\t\treturn datastoresSnapshot;\n\t} else {\n\t\t// back-compat: strip out all non-datastore paths before giving to DataStores object.\n\t\tconst datastoresTrees: ISnapshotTree[\"trees\"] = {};\n\t\tfor (const [key, value] of Object.entries(snapshot.trees)) {\n\t\t\tif (!nonDataStorePaths.includes(key)) {\n\t\t\t\tdatastoresTrees[key] = value;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...snapshot,\n\t\t\ttrees: datastoresTrees,\n\t\t};\n\t}\n}\n\n/**\n * Traverse this op's contents and detect any outbound routes that were added by this op.\n *\n * @internal\n */\nexport function detectOutboundReferences(\n\taddress: string,\n\tcontents: unknown,\n\taddedOutboundReference: (fromNodePath: string, toNodePath: string) => void,\n): void {\n\t// These will be built up as we traverse the envelope contents\n\tconst outboundPaths: string[] = [];\n\tlet ddsAddress: string | undefined;\n\n\tfunction recursivelyFindHandles(obj: unknown) {\n\t\tif (typeof obj === \"object\" && obj !== null) {\n\t\t\tfor (const [key, value] of Object.entries(obj)) {\n\t\t\t\t// If 'value' is a serialized IFluidHandle, it represents a new outbound route.\n\t\t\t\tif (isSerializedHandle(value)) {\n\t\t\t\t\toutboundPaths.push(value.url);\n\t\t\t\t}\n\n\t\t\t\t// NOTE: This is taking a hard dependency on the fact that in our DataStore implementation,\n\t\t\t\t// the address of the DDS is stored in a property called \"address\". This is not ideal.\n\t\t\t\t// An alternative would be for the op envelope to include the absolute path (built up as it is submitted)\n\t\t\t\tif (key === \"address\" && ddsAddress === undefined) {\n\t\t\t\t\tddsAddress = value;\n\t\t\t\t}\n\n\t\t\t\trecursivelyFindHandles(value);\n\t\t\t}\n\t\t}\n\t}\n\n\trecursivelyFindHandles(contents);\n\n\t// GC node paths are all absolute paths, hence the \"\" prefix.\n\t// e.g. this will yield \"/dataStoreId/ddsId\"\n\tconst fromPath = [\"\", address, ddsAddress].join(\"/\");\n\toutboundPaths.forEach((toPath) => addedOutboundReference(fromPath, toPath));\n}\n\n/** @internal */\nexport class ChannelCollectionFactory<T extends ChannelCollection = ChannelCollection>\n\timplements IFluidDataStoreFactory\n{\n\tpublic readonly type = \"ChannelCollectionChannel\";\n\n\tpublic IFluidDataStoreRegistry: IFluidDataStoreRegistry;\n\n\tconstructor(\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\t// ADO:7302 We need a better type here\n\t\tprivate readonly provideEntryPoint: (\n\t\t\truntime: IFluidDataStoreChannel,\n\t\t) => Promise<FluidObject>,\n\t\tprivate readonly ctor: (...args: ConstructorParameters<typeof ChannelCollection>) => T,\n\t) {\n\t\tthis.IFluidDataStoreRegistry = new FluidDataStoreRegistry(registryEntries);\n\t}\n\n\tpublic get IFluidDataStoreFactory() {\n\t\treturn this;\n\t}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\t_existing: boolean,\n\t): Promise<IFluidDataStoreChannel> {\n\t\tconst runtime = this.ctor(\n\t\t\tcontext.baseSnapshot,\n\t\t\tcontext, // parentContext\n\t\t\tcontext.logger,\n\t\t\t() => {}, // gcNodeUpdated\n\t\t\t(_nodePath: string) => false, // isDataStoreDeleted\n\t\t\tnew Map(), // aliasMap\n\t\t\tthis.provideEntryPoint,\n\t\t);\n\n\t\treturn runtime;\n\t}\n}\n"]}
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
6
5
  import { IDeltaManager } from "@fluidframework/container-definitions";
7
- import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
8
- import { IContainerRuntimeEvents } from "@fluidframework/container-runtime-definitions";
6
+ import { IContainerRuntimeEvents } from "@fluidframework/container-runtime-definitions/internal";
9
7
  import { IEventProvider } from "@fluidframework/core-interfaces";
8
+ import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
9
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
10
10
  /**
11
11
  * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.
12
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"connectionTelemetry.d.ts","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,mBAAmB,EAInB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAgWrC,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,EACxE,sBAAsB,EAAE,cAAc,CAAC,uBAAuB,CAAC,EAC/D,MAAM,EAAE,mBAAmB,GACzB,IAAI,CAEN"}
1
+ {"version":3,"file":"connectionTelemetry.d.ts","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAStE;;GAEG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAgWrC,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,EACxE,sBAAsB,EAAE,cAAc,CAAC,uBAAuB,CAAC,EAC/D,MAAM,EAAE,mBAAmB,GACzB,IAAI,CAEN"}
@@ -5,10 +5,10 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ReportOpPerfTelemetry = exports.latencyThreshold = void 0;
8
- const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
9
- const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
10
- const core_utils_1 = require("@fluidframework/core-utils");
11
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
+ const internal_1 = require("@fluidframework/core-utils/internal");
10
+ const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
11
+ const internal_2 = require("@fluidframework/telemetry-utils/internal");
12
12
  /**
13
13
  * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.
14
14
  */
@@ -52,7 +52,7 @@ class OpPerfTelemetry {
52
52
  this.bootTime = client_utils_1.performance.now();
53
53
  this.connectionStartTime = 0;
54
54
  this.gap = 0;
55
- this.logger = (0, telemetry_utils_1.createChildLogger)({ logger, namespace: "OpPerf" });
55
+ this.logger = (0, internal_2.createChildLogger)({ logger, namespace: "OpPerf" });
56
56
  const deltaLatencyEventSampler = (() => {
57
57
  let eventCount = -1;
58
58
  return {
@@ -66,11 +66,11 @@ class OpPerfTelemetry {
66
66
  },
67
67
  };
68
68
  })();
69
- this.deltaLatencyLogger = (0, telemetry_utils_1.createSampledLogger)(logger, deltaLatencyEventSampler);
69
+ this.deltaLatencyLogger = (0, internal_2.createSampledLogger)(logger, deltaLatencyEventSampler);
70
70
  // The SampledLogger here is used get access to the isSamplingDisabled property derived from
71
71
  // telemetry config properties. The actual sampling logic for op messages happens outside this SampledLogger
72
72
  // due to complexity of the different asynchronus scenarios of the op message lifecycle.
73
- this.opLatencyLogger = (0, telemetry_utils_1.createSampledLogger)(logger);
73
+ this.opLatencyLogger = (0, internal_2.createSampledLogger)(logger);
74
74
  this.deltaManager.on("pong", (latency) => this.recordPingTime(latency));
75
75
  this.deltaManager.on("submitOp", (message) => this.beforeOpSubmit(message));
76
76
  this.deltaManager.on("op", (message) => this.afterProcessingOp(message));
@@ -99,12 +99,12 @@ class OpPerfTelemetry {
99
99
  this.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber)) {
100
100
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
101
101
  const latencyStats = this.latencyStatistics.get(msg.clientSequenceNumber);
102
- (0, core_utils_1.assert)(latencyStats !== undefined, 0x7c2 /* Latency stats for op should exist */);
103
- (0, core_utils_1.assert)(latencyStats.opProcessingTimes.outboundPushEventTime === undefined, 0x2c8 /* "outboundPushEventTime should be undefined" */);
104
- (0, core_utils_1.assert)(latencyStats.opPerfData.durationNetwork === undefined, 0x2c9 /* "durationNetwork should be undefined" */);
102
+ (0, internal_1.assert)(latencyStats !== undefined, 0x7c2 /* Latency stats for op should exist */);
103
+ (0, internal_1.assert)(latencyStats.opProcessingTimes.outboundPushEventTime === undefined, 0x2c8 /* "outboundPushEventTime should be undefined" */);
104
+ (0, internal_1.assert)(latencyStats.opPerfData.durationNetwork === undefined, 0x2c9 /* "durationNetwork should be undefined" */);
105
105
  latencyStats.opProcessingTimes.outboundPushEventTime = Date.now();
106
- (0, core_utils_1.assert)(latencyStats.opPerfData.durationOutboundBatching === undefined, 0x2ca /* "durationOutboundBatching should be undefined" */);
107
- (0, core_utils_1.assert)(latencyStats.opProcessingTimes.submitOpEventTime !== undefined, 0x2cb /* "submitOpEventTime should be undefined" */);
106
+ (0, internal_1.assert)(latencyStats.opPerfData.durationOutboundBatching === undefined, 0x2ca /* "durationOutboundBatching should be undefined" */);
107
+ (0, internal_1.assert)(latencyStats.opProcessingTimes.submitOpEventTime !== undefined, 0x2cb /* "submitOpEventTime should be undefined" */);
108
108
  latencyStats.opPerfData.durationOutboundBatching =
109
109
  latencyStats.opProcessingTimes.outboundPushEventTime -
110
110
  latencyStats.opProcessingTimes.submitOpEventTime;
@@ -119,7 +119,7 @@ class OpPerfTelemetry {
119
119
  // We do an explicit check for undefined right after this
120
120
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
121
121
  const latencyStats = this.latencyStatistics.get(message.clientSequenceNumber);
122
- (0, core_utils_1.assert)(latencyStats !== undefined, 0x7c3 /* Latency stats for op should exist */);
122
+ (0, internal_1.assert)(latencyStats !== undefined, 0x7c3 /* Latency stats for op should exist */);
123
123
  if (latencyStats.opProcessingTimes.outboundPushEventTime !== undefined) {
124
124
  latencyStats.opProcessingTimes.inboundPushEventTime = Date.now();
125
125
  latencyStats.opPerfData.durationNetwork =
@@ -156,7 +156,7 @@ class OpPerfTelemetry {
156
156
  ops: this.gap,
157
157
  // track time to connect only for first connection.
158
158
  timeToConnect: this.firstConnection
159
- ? (0, telemetry_utils_1.formatTick)(this.connectionStartTime - this.bootTime)
159
+ ? (0, internal_2.formatTick)(this.connectionStartTime - this.bootTime)
160
160
  : undefined,
161
161
  firstConnection: this.firstConnection,
162
162
  });
@@ -183,7 +183,7 @@ class OpPerfTelemetry {
183
183
  if (this.opLatencyLogger.isSamplingDisabled ||
184
184
  (this.clientSequenceNumberForLatencyStatistics === undefined &&
185
185
  message.clientSequenceNumber % OpPerfTelemetry.OP_LATENCY_SAMPLE_RATE === 1)) {
186
- (0, core_utils_1.assert)(this.latencyStatistics.get(message.clientSequenceNumber) === undefined, 0x7c4 /* Existing op perf data for client sequence number */);
186
+ (0, internal_1.assert)(this.latencyStatistics.get(message.clientSequenceNumber) === undefined, 0x7c4 /* Existing op perf data for client sequence number */);
187
187
  this.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;
188
188
  this.latencyStatistics.set(message.clientSequenceNumber, {
189
189
  opProcessingTimes: {
@@ -205,7 +205,7 @@ class OpPerfTelemetry {
205
205
  }
206
206
  if (this.sequenceNumberForMsnTracking !== undefined &&
207
207
  message.minimumSequenceNumber >= this.sequenceNumberForMsnTracking) {
208
- (0, core_utils_1.assert)(this.msnTrackingTimestamp !== undefined, 0x2ce /* "msnTrackingTimestamp should not be undefined" */);
208
+ (0, internal_1.assert)(this.msnTrackingTimestamp !== undefined, 0x2ce /* "msnTrackingTimestamp should not be undefined" */);
209
209
  this.logger.sendPerformanceEvent({
210
210
  eventName: "MsnStatistics",
211
211
  sequenceNumber,
@@ -220,8 +220,8 @@ class OpPerfTelemetry {
220
220
  // We do an explicit check for undefined right after this
221
221
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
222
222
  const latencyData = this.latencyStatistics.get(message.clientSequenceNumber);
223
- (0, core_utils_1.assert)(latencyData !== undefined, 0x7c5 /* Undefined latency statistics for op */);
224
- (0, core_utils_1.assert)(latencyData.opProcessingTimes.submitOpEventTime !== undefined, 0x120 /* "Undefined latency statistics for op (op send time)" */);
223
+ (0, internal_1.assert)(latencyData !== undefined, 0x7c5 /* Undefined latency statistics for op */);
224
+ (0, internal_1.assert)(latencyData.opProcessingTimes.submitOpEventTime !== undefined, 0x120 /* "Undefined latency statistics for op (op send time)" */);
225
225
  const currentTime = Date.now();
226
226
  if (latencyData.opProcessingTimes.inboundPushEventTime !== undefined) {
227
227
  latencyData.opPerfData.durationInboundToProcessing =