@fluidframework/container-runtime 2.0.0-rc.4.0.6 → 2.0.0-rc.5.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 (424) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/api-extractor/api-extractor-lint-bundle.json +5 -0
  3. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  4. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  5. package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
  6. package/api-extractor/api-extractor-lint-public.esm.json +5 -0
  7. package/api-extractor.json +1 -1
  8. package/api-report/{container-runtime.api.md → container-runtime.alpha.api.md} +33 -516
  9. package/api-report/container-runtime.beta.api.md +73 -0
  10. package/api-report/container-runtime.public.api.md +73 -0
  11. package/biome.jsonc +4 -0
  12. package/container-runtime.test-files.tar +0 -0
  13. package/dist/batchTracker.d.ts.map +1 -1
  14. package/dist/batchTracker.js.map +1 -1
  15. package/dist/blobManager.d.ts +3 -20
  16. package/dist/blobManager.d.ts.map +1 -1
  17. package/dist/blobManager.js +1 -35
  18. package/dist/blobManager.js.map +1 -1
  19. package/dist/channelCollection.d.ts +21 -12
  20. package/dist/channelCollection.d.ts.map +1 -1
  21. package/dist/channelCollection.js +113 -110
  22. package/dist/channelCollection.js.map +1 -1
  23. package/dist/connectionTelemetry.d.ts +1 -1
  24. package/dist/connectionTelemetry.d.ts.map +1 -1
  25. package/dist/connectionTelemetry.js +14 -14
  26. package/dist/connectionTelemetry.js.map +1 -1
  27. package/dist/containerHandleContext.d.ts +2 -1
  28. package/dist/containerHandleContext.d.ts.map +1 -1
  29. package/dist/containerHandleContext.js.map +1 -1
  30. package/dist/containerRuntime.d.ts +17 -34
  31. package/dist/containerRuntime.d.ts.map +1 -1
  32. package/dist/containerRuntime.js +109 -145
  33. package/dist/containerRuntime.js.map +1 -1
  34. package/dist/dataStore.d.ts.map +1 -1
  35. package/dist/dataStore.js.map +1 -1
  36. package/dist/dataStoreContext.d.ts +30 -44
  37. package/dist/dataStoreContext.d.ts.map +1 -1
  38. package/dist/dataStoreContext.js +26 -40
  39. package/dist/dataStoreContext.js.map +1 -1
  40. package/dist/dataStoreContexts.d.ts.map +1 -1
  41. package/dist/dataStoreContexts.js.map +1 -1
  42. package/dist/dataStoreRegistry.js.map +1 -1
  43. package/dist/deltaManagerProxies.d.ts +4 -3
  44. package/dist/deltaManagerProxies.d.ts.map +1 -1
  45. package/dist/deltaManagerProxies.js.map +1 -1
  46. package/dist/deltaScheduler.d.ts +1 -1
  47. package/dist/deltaScheduler.d.ts.map +1 -1
  48. package/dist/deltaScheduler.js +1 -3
  49. package/dist/deltaScheduler.js.map +1 -1
  50. package/dist/gc/garbageCollection.d.ts +5 -5
  51. package/dist/gc/garbageCollection.d.ts.map +1 -1
  52. package/dist/gc/garbageCollection.js +29 -30
  53. package/dist/gc/garbageCollection.js.map +1 -1
  54. package/dist/gc/gcConfigs.d.ts.map +1 -1
  55. package/dist/gc/gcConfigs.js +12 -31
  56. package/dist/gc/gcConfigs.js.map +1 -1
  57. package/dist/gc/gcDefinitions.d.ts +10 -38
  58. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  59. package/dist/gc/gcDefinitions.js +1 -5
  60. package/dist/gc/gcDefinitions.js.map +1 -1
  61. package/dist/gc/gcHelpers.d.ts +2 -3
  62. package/dist/gc/gcHelpers.d.ts.map +1 -1
  63. package/dist/gc/gcHelpers.js.map +1 -1
  64. package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  65. package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
  66. package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
  67. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  68. package/dist/gc/gcSummaryStateTracker.d.ts +2 -35
  69. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  70. package/dist/gc/gcSummaryStateTracker.js +9 -62
  71. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  72. package/dist/gc/gcTelemetry.d.ts +2 -2
  73. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  74. package/dist/gc/gcTelemetry.js +3 -9
  75. package/dist/gc/gcTelemetry.js.map +1 -1
  76. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  77. package/dist/gc/index.d.ts +1 -1
  78. package/dist/gc/index.d.ts.map +1 -1
  79. package/dist/gc/index.js +1 -3
  80. package/dist/gc/index.js.map +1 -1
  81. package/dist/index.d.ts +2 -2
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js.map +1 -1
  84. package/dist/legacy.d.ts +1 -1
  85. package/dist/messageTypes.d.ts +6 -22
  86. package/dist/messageTypes.d.ts.map +1 -1
  87. package/dist/messageTypes.js.map +1 -1
  88. package/dist/opLifecycle/batchManager.js.map +1 -1
  89. package/dist/opLifecycle/definitions.d.ts +2 -2
  90. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  91. package/dist/opLifecycle/definitions.js.map +1 -1
  92. package/dist/opLifecycle/index.d.ts +1 -1
  93. package/dist/opLifecycle/index.d.ts.map +1 -1
  94. package/dist/opLifecycle/index.js.map +1 -1
  95. package/dist/opLifecycle/opCompressor.d.ts +11 -1
  96. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  97. package/dist/opLifecycle/opCompressor.js +13 -2
  98. package/dist/opLifecycle/opCompressor.js.map +1 -1
  99. package/dist/opLifecycle/opDecompressor.d.ts +1 -1
  100. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  101. package/dist/opLifecycle/opDecompressor.js +1 -2
  102. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  103. package/dist/opLifecycle/opGroupingManager.d.ts +10 -3
  104. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  105. package/dist/opLifecycle/opGroupingManager.js +7 -0
  106. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  107. package/dist/opLifecycle/opSplitter.d.ts +4 -2
  108. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  109. package/dist/opLifecycle/opSplitter.js +13 -8
  110. package/dist/opLifecycle/opSplitter.js.map +1 -1
  111. package/dist/opLifecycle/outbox.d.ts +10 -0
  112. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  113. package/dist/opLifecycle/outbox.js +13 -18
  114. package/dist/opLifecycle/outbox.js.map +1 -1
  115. package/dist/opLifecycle/remoteMessageProcessor.d.ts +1 -1
  116. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  117. package/dist/opLifecycle/remoteMessageProcessor.js +2 -2
  118. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  119. package/dist/opProperties.d.ts +1 -1
  120. package/dist/opProperties.d.ts.map +1 -1
  121. package/dist/opProperties.js.map +1 -1
  122. package/dist/packageVersion.d.ts +1 -1
  123. package/dist/packageVersion.js +1 -1
  124. package/dist/packageVersion.js.map +1 -1
  125. package/dist/pendingStateManager.d.ts.map +1 -1
  126. package/dist/pendingStateManager.js +15 -5
  127. package/dist/pendingStateManager.js.map +1 -1
  128. package/dist/scheduleManager.d.ts +1 -1
  129. package/dist/scheduleManager.d.ts.map +1 -1
  130. package/dist/scheduleManager.js.map +1 -1
  131. package/dist/storageServiceWithAttachBlobs.js.map +1 -1
  132. package/dist/summary/documentSchema.d.ts.map +1 -1
  133. package/dist/summary/documentSchema.js +2 -3
  134. package/dist/summary/documentSchema.js.map +1 -1
  135. package/dist/summary/index.d.ts +2 -2
  136. package/dist/summary/index.d.ts.map +1 -1
  137. package/dist/summary/index.js.map +1 -1
  138. package/dist/summary/orderedClientElection.d.ts +4 -2
  139. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  140. package/dist/summary/orderedClientElection.js +35 -13
  141. package/dist/summary/orderedClientElection.js.map +1 -1
  142. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  143. package/dist/summary/runningSummarizer.d.ts +1 -6
  144. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  145. package/dist/summary/runningSummarizer.js +23 -110
  146. package/dist/summary/runningSummarizer.js.map +1 -1
  147. package/dist/summary/summarizer.d.ts +1 -1
  148. package/dist/summary/summarizer.d.ts.map +1 -1
  149. package/dist/summary/summarizer.js +4 -1
  150. package/dist/summary/summarizer.js.map +1 -1
  151. package/dist/summary/summarizerClientElection.d.ts +1 -1
  152. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  153. package/dist/summary/summarizerClientElection.js +2 -2
  154. package/dist/summary/summarizerClientElection.js.map +1 -1
  155. package/dist/summary/summarizerHeuristics.js.map +1 -1
  156. package/dist/summary/summarizerNode/summarizerNode.d.ts +2 -3
  157. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  158. package/dist/summary/summarizerNode/summarizerNode.js +16 -16
  159. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  160. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
  161. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  162. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  163. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -3
  164. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  165. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +5 -2
  166. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  167. package/dist/summary/summarizerTypes.d.ts +17 -29
  168. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  169. package/dist/summary/summarizerTypes.js.map +1 -1
  170. package/dist/summary/summaryCollection.d.ts +1 -1
  171. package/dist/summary/summaryCollection.d.ts.map +1 -1
  172. package/dist/summary/summaryCollection.js +11 -11
  173. package/dist/summary/summaryCollection.js.map +1 -1
  174. package/dist/summary/summaryFormat.d.ts +2 -3
  175. package/dist/summary/summaryFormat.d.ts.map +1 -1
  176. package/dist/summary/summaryFormat.js +2 -2
  177. package/dist/summary/summaryFormat.js.map +1 -1
  178. package/dist/summary/summaryGenerator.d.ts +7 -8
  179. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  180. package/dist/summary/summaryGenerator.js +27 -24
  181. package/dist/summary/summaryGenerator.js.map +1 -1
  182. package/dist/summary/summaryManager.d.ts.map +1 -1
  183. package/dist/summary/summaryManager.js +1 -2
  184. package/dist/summary/summaryManager.js.map +1 -1
  185. package/dist/throttler.d.ts.map +1 -1
  186. package/dist/throttler.js +3 -1
  187. package/dist/throttler.js.map +1 -1
  188. package/lib/batchTracker.d.ts.map +1 -1
  189. package/lib/batchTracker.js +1 -1
  190. package/lib/batchTracker.js.map +1 -1
  191. package/lib/blobManager.d.ts +3 -20
  192. package/lib/blobManager.d.ts.map +1 -1
  193. package/lib/blobManager.js +2 -36
  194. package/lib/blobManager.js.map +1 -1
  195. package/lib/channelCollection.d.ts +21 -12
  196. package/lib/channelCollection.d.ts.map +1 -1
  197. package/lib/channelCollection.js +114 -112
  198. package/lib/channelCollection.js.map +1 -1
  199. package/lib/connectionTelemetry.d.ts +1 -1
  200. package/lib/connectionTelemetry.d.ts.map +1 -1
  201. package/lib/connectionTelemetry.js +2 -2
  202. package/lib/connectionTelemetry.js.map +1 -1
  203. package/lib/containerHandleContext.d.ts +2 -1
  204. package/lib/containerHandleContext.d.ts.map +1 -1
  205. package/lib/containerHandleContext.js.map +1 -1
  206. package/lib/containerRuntime.d.ts +17 -34
  207. package/lib/containerRuntime.d.ts.map +1 -1
  208. package/lib/containerRuntime.js +106 -142
  209. package/lib/containerRuntime.js.map +1 -1
  210. package/lib/dataStore.d.ts.map +1 -1
  211. package/lib/dataStore.js.map +1 -1
  212. package/lib/dataStoreContext.d.ts +30 -44
  213. package/lib/dataStoreContext.d.ts.map +1 -1
  214. package/lib/dataStoreContext.js +29 -43
  215. package/lib/dataStoreContext.js.map +1 -1
  216. package/lib/dataStoreContexts.d.ts.map +1 -1
  217. package/lib/dataStoreContexts.js +1 -1
  218. package/lib/dataStoreContexts.js.map +1 -1
  219. package/lib/dataStoreRegistry.js.map +1 -1
  220. package/lib/deltaManagerProxies.d.ts +4 -3
  221. package/lib/deltaManagerProxies.d.ts.map +1 -1
  222. package/lib/deltaManagerProxies.js.map +1 -1
  223. package/lib/deltaScheduler.d.ts +1 -1
  224. package/lib/deltaScheduler.d.ts.map +1 -1
  225. package/lib/deltaScheduler.js +1 -3
  226. package/lib/deltaScheduler.js.map +1 -1
  227. package/lib/gc/garbageCollection.d.ts +5 -5
  228. package/lib/gc/garbageCollection.d.ts.map +1 -1
  229. package/lib/gc/garbageCollection.js +30 -31
  230. package/lib/gc/garbageCollection.js.map +1 -1
  231. package/lib/gc/gcConfigs.d.ts.map +1 -1
  232. package/lib/gc/gcConfigs.js +13 -32
  233. package/lib/gc/gcConfigs.js.map +1 -1
  234. package/lib/gc/gcDefinitions.d.ts +10 -38
  235. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  236. package/lib/gc/gcDefinitions.js +0 -4
  237. package/lib/gc/gcDefinitions.js.map +1 -1
  238. package/lib/gc/gcHelpers.d.ts +2 -3
  239. package/lib/gc/gcHelpers.d.ts.map +1 -1
  240. package/lib/gc/gcHelpers.js.map +1 -1
  241. package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  242. package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
  243. package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
  244. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  245. package/lib/gc/gcSummaryStateTracker.d.ts +2 -35
  246. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  247. package/lib/gc/gcSummaryStateTracker.js +4 -57
  248. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  249. package/lib/gc/gcTelemetry.d.ts +2 -2
  250. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  251. package/lib/gc/gcTelemetry.js +3 -9
  252. package/lib/gc/gcTelemetry.js.map +1 -1
  253. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  254. package/lib/gc/index.d.ts +1 -1
  255. package/lib/gc/index.d.ts.map +1 -1
  256. package/lib/gc/index.js +1 -1
  257. package/lib/gc/index.js.map +1 -1
  258. package/lib/index.d.ts +2 -2
  259. package/lib/index.d.ts.map +1 -1
  260. package/lib/index.js.map +1 -1
  261. package/lib/legacy.d.ts +1 -1
  262. package/lib/messageTypes.d.ts +6 -22
  263. package/lib/messageTypes.d.ts.map +1 -1
  264. package/lib/messageTypes.js.map +1 -1
  265. package/lib/opLifecycle/batchManager.js.map +1 -1
  266. package/lib/opLifecycle/definitions.d.ts +2 -2
  267. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  268. package/lib/opLifecycle/definitions.js.map +1 -1
  269. package/lib/opLifecycle/index.d.ts +1 -1
  270. package/lib/opLifecycle/index.d.ts.map +1 -1
  271. package/lib/opLifecycle/index.js +1 -1
  272. package/lib/opLifecycle/index.js.map +1 -1
  273. package/lib/opLifecycle/opCompressor.d.ts +11 -1
  274. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  275. package/lib/opLifecycle/opCompressor.js +13 -2
  276. package/lib/opLifecycle/opCompressor.js.map +1 -1
  277. package/lib/opLifecycle/opDecompressor.d.ts +1 -1
  278. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  279. package/lib/opLifecycle/opDecompressor.js +1 -2
  280. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  281. package/lib/opLifecycle/opGroupingManager.d.ts +10 -3
  282. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  283. package/lib/opLifecycle/opGroupingManager.js +7 -0
  284. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  285. package/lib/opLifecycle/opSplitter.d.ts +4 -2
  286. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  287. package/lib/opLifecycle/opSplitter.js +13 -8
  288. package/lib/opLifecycle/opSplitter.js.map +1 -1
  289. package/lib/opLifecycle/outbox.d.ts +10 -0
  290. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  291. package/lib/opLifecycle/outbox.js +13 -18
  292. package/lib/opLifecycle/outbox.js.map +1 -1
  293. package/lib/opLifecycle/remoteMessageProcessor.d.ts +1 -1
  294. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  295. package/lib/opLifecycle/remoteMessageProcessor.js +1 -1
  296. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  297. package/lib/opProperties.d.ts +1 -1
  298. package/lib/opProperties.d.ts.map +1 -1
  299. package/lib/opProperties.js.map +1 -1
  300. package/lib/packageVersion.d.ts +1 -1
  301. package/lib/packageVersion.js +1 -1
  302. package/lib/packageVersion.js.map +1 -1
  303. package/lib/pendingStateManager.d.ts.map +1 -1
  304. package/lib/pendingStateManager.js +15 -5
  305. package/lib/pendingStateManager.js.map +1 -1
  306. package/lib/scheduleManager.d.ts +1 -1
  307. package/lib/scheduleManager.d.ts.map +1 -1
  308. package/lib/scheduleManager.js.map +1 -1
  309. package/lib/storageServiceWithAttachBlobs.js.map +1 -1
  310. package/lib/summary/documentSchema.d.ts.map +1 -1
  311. package/lib/summary/documentSchema.js +2 -3
  312. package/lib/summary/documentSchema.js.map +1 -1
  313. package/lib/summary/index.d.ts +2 -2
  314. package/lib/summary/index.d.ts.map +1 -1
  315. package/lib/summary/index.js +1 -1
  316. package/lib/summary/index.js.map +1 -1
  317. package/lib/summary/orderedClientElection.d.ts +4 -2
  318. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  319. package/lib/summary/orderedClientElection.js +35 -13
  320. package/lib/summary/orderedClientElection.js.map +1 -1
  321. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  322. package/lib/summary/runningSummarizer.d.ts +1 -6
  323. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  324. package/lib/summary/runningSummarizer.js +22 -109
  325. package/lib/summary/runningSummarizer.js.map +1 -1
  326. package/lib/summary/summarizer.d.ts +1 -1
  327. package/lib/summary/summarizer.d.ts.map +1 -1
  328. package/lib/summary/summarizer.js +4 -1
  329. package/lib/summary/summarizer.js.map +1 -1
  330. package/lib/summary/summarizerClientElection.d.ts +1 -1
  331. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  332. package/lib/summary/summarizerClientElection.js +1 -1
  333. package/lib/summary/summarizerClientElection.js.map +1 -1
  334. package/lib/summary/summarizerHeuristics.js.map +1 -1
  335. package/lib/summary/summarizerNode/summarizerNode.d.ts +2 -3
  336. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  337. package/lib/summary/summarizerNode/summarizerNode.js +14 -14
  338. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  339. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
  340. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  341. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  342. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -3
  343. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  344. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +5 -2
  345. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  346. package/lib/summary/summarizerTypes.d.ts +17 -29
  347. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  348. package/lib/summary/summarizerTypes.js.map +1 -1
  349. package/lib/summary/summaryCollection.d.ts +1 -1
  350. package/lib/summary/summaryCollection.d.ts.map +1 -1
  351. package/lib/summary/summaryCollection.js +3 -3
  352. package/lib/summary/summaryCollection.js.map +1 -1
  353. package/lib/summary/summaryFormat.d.ts +2 -3
  354. package/lib/summary/summaryFormat.d.ts.map +1 -1
  355. package/lib/summary/summaryFormat.js +2 -2
  356. package/lib/summary/summaryFormat.js.map +1 -1
  357. package/lib/summary/summaryGenerator.d.ts +7 -8
  358. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  359. package/lib/summary/summaryGenerator.js +26 -23
  360. package/lib/summary/summaryGenerator.js.map +1 -1
  361. package/lib/summary/summaryManager.d.ts.map +1 -1
  362. package/lib/summary/summaryManager.js +1 -2
  363. package/lib/summary/summaryManager.js.map +1 -1
  364. package/lib/throttler.d.ts.map +1 -1
  365. package/lib/throttler.js +3 -1
  366. package/lib/throttler.js.map +1 -1
  367. package/lib/tsdoc-metadata.json +1 -1
  368. package/package.json +92 -28
  369. package/src/batchTracker.ts +5 -2
  370. package/src/blobManager.ts +21 -61
  371. package/src/channelCollection.ts +179 -186
  372. package/src/connectionTelemetry.ts +18 -12
  373. package/src/containerHandleContext.ts +2 -1
  374. package/src/containerRuntime.ts +166 -214
  375. package/src/dataStore.ts +2 -1
  376. package/src/dataStoreContext.ts +79 -98
  377. package/src/dataStoreContexts.ts +7 -2
  378. package/src/deltaManagerProxies.ts +15 -6
  379. package/src/deltaScheduler.ts +5 -4
  380. package/src/gc/garbageCollection.md +0 -8
  381. package/src/gc/garbageCollection.ts +66 -57
  382. package/src/gc/gcConfigs.ts +15 -37
  383. package/src/gc/gcDefinitions.ts +20 -39
  384. package/src/gc/gcHelpers.ts +8 -4
  385. package/src/gc/gcSummaryDefinitions.ts +1 -1
  386. package/src/gc/gcSummaryStateTracker.ts +11 -74
  387. package/src/gc/gcTelemetry.ts +4 -11
  388. package/src/gc/index.ts +0 -2
  389. package/src/index.ts +1 -2
  390. package/src/messageTypes.ts +8 -24
  391. package/src/opLifecycle/README.md +120 -160
  392. package/src/opLifecycle/definitions.ts +2 -2
  393. package/src/opLifecycle/index.ts +5 -1
  394. package/src/opLifecycle/opCompressor.ts +13 -2
  395. package/src/opLifecycle/opDecompressor.ts +3 -7
  396. package/src/opLifecycle/opGroupingManager.ts +12 -8
  397. package/src/opLifecycle/opSplitter.ts +22 -11
  398. package/src/opLifecycle/outbox.ts +14 -32
  399. package/src/opLifecycle/remoteMessageProcessor.ts +4 -1
  400. package/src/opProperties.ts +2 -2
  401. package/src/packageVersion.ts +1 -1
  402. package/src/pendingStateManager.ts +20 -7
  403. package/src/scheduleManager.ts +4 -1
  404. package/src/summary/documentSchema.ts +4 -7
  405. package/src/summary/images/appTree.png +0 -0
  406. package/src/summary/images/protocolAndAppTree.png +0 -0
  407. package/src/summary/images/summaryTree.png +0 -0
  408. package/src/summary/index.ts +5 -2
  409. package/src/summary/orderedClientElection.ts +100 -22
  410. package/src/summary/runningSummarizer.ts +54 -124
  411. package/src/summary/summarizer.ts +5 -2
  412. package/src/summary/summarizerClientElection.ts +4 -2
  413. package/src/summary/summarizerNode/summarizerNode.ts +23 -30
  414. package/src/summary/summarizerNode/summarizerNodeUtils.ts +9 -3
  415. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +11 -11
  416. package/src/summary/summarizerTypes.ts +32 -33
  417. package/src/summary/summaryCollection.ts +6 -3
  418. package/src/summary/summaryFormat.ts +18 -10
  419. package/src/summary/summaryFormats.md +160 -0
  420. package/src/summary/summaryGenerator.ts +47 -30
  421. package/src/summary/summaryManager.ts +6 -9
  422. package/src/throttler.ts +3 -1
  423. package/tsconfig.json +2 -0
  424. package/tsdoc.json +4 -0
@@ -1 +1 @@
1
- {"version":3,"file":"channelCollection.js","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AASpE,kEAAgF;AAChF,iEAAuE;AACvE,oEAI+C;AAS/C,2EAesD;AACtD,qEAagD;AAChD,uEASkD;AAElD,+DAI+B;AAC/B,iDAIwB;AACxB,+DAQ+B;AAC/B,iEAA2D;AAC3D,iEAAgE;AAChE,4CAKuB;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;;;GAGG;AACU,QAAA,6BAA6B,GAAG,eAAe,CAAC,CA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Q,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\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, Lazy, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\nimport {\n\tbuildSnapshotTree,\n\tgetSnapshotTree,\n\tisInstanceOfISnapshot,\n} from \"@fluidframework/driver-utils/internal\";\nimport type { ISnapshot } from \"@fluidframework/driver-definitions/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 {\n\tDeletedResponseHeaderKey,\n\tRuntimeHeaderData,\n\tdefaultRuntimeHeaderData,\n} 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\tIGCNodeUpdatedProps,\n\turlToGCNodePath,\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\t// back-compat, to be removed in 2.0\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: IFluidHandleInternal<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: IFluidHandleInternal;\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 | ISnapshot | undefined,\n\t\tpublic readonly parentContext: IFluidParentContext,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly gcNodeUpdated: (props: IGCNodeUpdatedProps) => 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\tconst baseSnapshotTree = getSnapshotTree(baseSnapshot);\n\t\t\tfor (const [key, value] of Object.entries(baseSnapshotTree.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\tlet snapshotForRemoteFluidDatastoreContext: ISnapshot | ISnapshotTree = value;\n\t\t\t\tif (isInstanceOfISnapshot(baseSnapshot)) {\n\t\t\t\t\tsnapshotForRemoteFluidDatastoreContext = {\n\t\t\t\t\t\t...baseSnapshot,\n\t\t\t\t\t\tsnapshotTree: value,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tsnapshot: snapshotForRemoteFluidDatastoreContext,\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 snapshot: ISnapshotTree | ISnapshot | undefined;\n\t\tif (attachMessage.snapshot) {\n\t\t\tsnapshot = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);\n\t\t\tif (isInstanceOfISnapshot(this.baseSnapshot)) {\n\t\t\t\tsnapshot = { ...this.baseSnapshot, snapshotTree: snapshot };\n\t\t\t}\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\tsnapshot,\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\tthis.submitAttachChannelOp(localContext);\n\t\t\tlocalContext.setAttachState(AttachState.Attaching);\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\tassert(loadingGroupId !== \"\", 0x974 /* loadingGroupId should not be the empty string */);\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\tnode: { type: \"DataStore\", path: `/${address}` },\n\t\t\treason: \"Changed\",\n\t\t\ttimestampMs: message.timestamp,\n\t\t\tpackagePath: context.isLoaded ? context.packagePath : undefined,\n\t\t});\n\t}\n\n\tprivate async getDataStore(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t\toriginalRequest: IRequest,\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\toriginalRequest,\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\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", originalRequest, {\n\t\t\t\t\t[DeletedResponseHeaderKey]: true,\n\t\t\t\t}),\n\t\t\t\toriginalRequest,\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 deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)\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 * @param originalRequest - The original request (could be for a child of the DataStore)\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: \"Changed\" | \"Requested\",\n\t\tcallSite: string,\n\t\trequestHeaderData?: RuntimeHeaderData,\n\t\toriginalRequest?: IRequest,\n\t) {\n\t\tconst dataStoreNodePath = `/${id}`;\n\t\tif (!this.isDataStoreDeleted(dataStoreNodePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst idToLog =\n\t\t\toriginalRequest !== undefined\n\t\t\t\t? urlToGCNodePath(originalRequest.url)\n\t\t\t\t: dataStoreNodePath;\n\n\t\t// Log the package details asynchronously since getInitialSnapshotDetails is async\n\t\tconst recentelyDeletedContext = this.contexts.getRecentlyDeletedContext(id);\n\t\tif (recentelyDeletedContext !== undefined) {\n\t\t\trecentelyDeletedContext\n\t\t\t\t.getInitialSnapshotDetails()\n\t\t\t\t.then((details) => {\n\t\t\t\t\treturn details.pkg.join(\"/\");\n\t\t\t\t})\n\t\t\t\t.then(\n\t\t\t\t\t(pkg) => ({ pkg, error: undefined }),\n\t\t\t\t\t(error) => ({ pkg: undefined, error }),\n\t\t\t\t)\n\t\t\t\t.then(({ pkg, error }) => {\n\t\t\t\t\tthis.mc.logger.sendTelemetryEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: `GC_DeletedDataStore_PathInfo`,\n\t\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\t\tid: idToLog,\n\t\t\t\t\t\t\t\tpkg,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcallSite,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t\t.catch(() => {});\n\t\t}\n\n\t\tthis.mc.logger.sendErrorEvent({\n\t\t\teventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,\n\t\t\t...tagCodeArtifacts({ id: idToLog }),\n\t\t\tcallSite,\n\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\texists: context !== undefined,\n\t\t\tdetails: {\n\t\t\t\turl: originalRequest?.url,\n\t\t\t\theaders: JSON.stringify(originalRequest?.headers),\n\t\t\t\taliased: this.aliasedDataStores.has(id),\n\t\t\t},\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\tgetSnapshotTree(this.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\tif (dataStoreContext.isLoaded) {\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"GC_DeletingLoadedDataStore\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tid: dataStoreId,\n\t\t\t\t\tpkg: dataStoreContext.packagePath.join(\"/\"),\n\t\t\t\t}),\n\t\t\t});\n\t\t}\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/Inactive requests for sub-DataStore objects\n\t\tif (requestForChild) {\n\t\t\theaderData.allowTombstone = true;\n\t\t\theaderData.allowInactive = 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, request);\n\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// When notifying GC of this node being loaded, we only indicate the DataStore itself, not the full subDataStore url if applicable.\n\t\t// This is in case the url is to a route that Fluid doesn't understand or track for GC (e.g. if suited for a custom request handler)\n\t\tthis.gcNodeUpdated({\n\t\t\tnode: { type: \"DataStore\", path: `/${id}` },\n\t\t\treason: \"Loaded\",\n\t\t\tpackagePath: details.pkg,\n\t\t\trequest,\n\t\t\theaderData,\n\t\t});\n\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"]}
1
+ {"version":3,"file":"channelCollection.js","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AASpE,kEAAgF;AAChF,iEAAuE;AAMvE,oEAI+C;AAC/C,2EAoBsD;AACtD,qEAcgD;AAChD,uEASkD;AAElD,+DAI+B;AAC/B,iDAIwB;AACxB,+DAQ+B;AAC/B,iEAA2D;AAC3D,iEAAgE;AAChE,4CAAiF;AACjF,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;;;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,mBAAmB;QAChD,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,IAAI,QAAQ;YACX,OAAO,OAAO,CAAC,QAAQ,CAAC;QACzB,CAAC;QACD,IAAI,SAA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AAC,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,UAAU,EAClB,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\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, Lazy, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\nimport type { ISnapshot } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tbuildSnapshotTree,\n\tgetSnapshotTree,\n\tisInstanceOfISnapshot,\n} from \"@fluidframework/driver-utils/internal\";\nimport {\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tIGarbageCollectionData,\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\tIInboundSignalMessage,\n\tgcDataBlobKey,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tGCDataBuilder,\n\tRequestParser,\n\tSummaryTreeBuilder,\n\taddBlobToSummary,\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 {\n\tDeletedResponseHeaderKey,\n\tRuntimeHeaderData,\n\tdefaultRuntimeHeaderData,\n} 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 { GCNodeType, IGCNodeUpdatedProps, urlToGCNodePath } 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\tbaseLogger: context.baseLogger,\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\t// back-compat, to be removed in 2.0\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\taddedGCOutboundRoute: (...args) => {\n\t\t\treturn context.addedGCOutboundRoute(...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 * Returns the type of the given local data store from its package path.\n */\nexport function getLocalDataStoreType(localDataStore: LocalFluidDataStoreContext) {\n\treturn localDataStore.packagePath[localDataStore.packagePath.length - 1];\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: IFluidHandleInternal<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\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 | ISnapshot | undefined,\n\t\tpublic readonly parentContext: IFluidParentContext,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly gcNodeUpdated: (props: IGCNodeUpdatedProps) => 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.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\tconst baseSnapshotTree = getSnapshotTree(baseSnapshot);\n\t\t\tfor (const [key, value] of Object.entries(baseSnapshotTree.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\tlet snapshotForRemoteFluidDatastoreContext: ISnapshot | ISnapshotTree = value;\n\t\t\t\tif (isInstanceOfISnapshot(baseSnapshot)) {\n\t\t\t\t\tsnapshotForRemoteFluidDatastoreContext = {\n\t\t\t\t\t\t...baseSnapshot,\n\t\t\t\t\t\tsnapshotTree: value,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tsnapshot: snapshotForRemoteFluidDatastoreContext,\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\t// We need to process the GC Data for both local and remote attach messages\n\t\tconst foundGCData = processAttachMessageGCData(\n\t\t\tattachMessage.snapshot,\n\t\t\t(nodeId, toPath) => {\n\t\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\t\tconst fromPath = `/${attachMessage.id}${nodeId === \"/\" ? \"\" : nodeId}`;\n\t\t\t\tthis.parentContext.addedGCOutboundRoute(fromPath, toPath, message.timestamp);\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 snapshot: ISnapshotTree | ISnapshot | undefined;\n\t\tif (attachMessage.snapshot) {\n\t\t\tsnapshot = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);\n\t\t\tif (isInstanceOfISnapshot(this.baseSnapshot)) {\n\t\t\t\tsnapshot = { ...this.baseSnapshot, snapshotTree: snapshot };\n\t\t\t}\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\tsnapshot,\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\tmessage.timestamp,\n\t\t);\n\t\tif (local) {\n\t\t\tresolve(aliasResult);\n\t\t}\n\t}\n\n\tpublic processAliasMessageCore(\n\t\tinternalId: string,\n\t\talias: string,\n\t\tmessageTimestampMs?: number,\n\t): 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\t// If message timestamp doesn't exist, this is called in a detached container. Don't notify GC in that case\n\t\t// because it doesn't run in detached container and doesn't need to know about this route.\n\t\tif (messageTimestampMs) {\n\t\t\tthis.parentContext.addedGCOutboundRoute(\"/\", `/${internalId}`, messageTimestampMs);\n\t\t}\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: LocalFluidDataStoreContext): IAttachMessage {\n\t\t// Get the attach summary.\n\t\tconst attachSummary = localContext.getAttachSummary();\n\n\t\t// Get the GC data and add it to the attach summary.\n\t\tconst attachGCData = localContext.getAttachGCData();\n\t\taddBlobToSummary(attachSummary, gcDataBlobKey, JSON.stringify(attachGCData));\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: getLocalDataStoreType(localContext),\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\tthis.submitAttachChannelOp(localContext);\n\t\t\tlocalContext.setAttachState(AttachState.Attaching);\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\tassert(loadingGroupId !== \"\", 0x974 /* loadingGroupId should not be the empty string */);\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.baseLogger }),\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) {\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// Notify GC of any outbound references that were added by this op.\n\t\t\t\tdetectOutboundReferences(\n\t\t\t\t\tenvelope.address,\n\t\t\t\t\ttransformed.contents,\n\t\t\t\t\t(fromPath: string, toPath: string) =>\n\t\t\t\t\t\tthis.parentContext.addedGCOutboundRoute(fromPath, toPath, message.timestamp),\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\tnode: { type: \"DataStore\", path: `/${address}` },\n\t\t\treason: \"Changed\",\n\t\t\ttimestampMs: message.timestamp,\n\t\t\tpackagePath: context.isLoaded ? context.packagePath : undefined,\n\t\t});\n\t}\n\n\tprivate async getDataStore(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t\toriginalRequest: IRequest,\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\toriginalRequest,\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\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", originalRequest, {\n\t\t\t\t\t[DeletedResponseHeaderKey]: true,\n\t\t\t\t}),\n\t\t\t\toriginalRequest,\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 deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)\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 * @param originalRequest - The original request (could be for a child of the DataStore)\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: \"Changed\" | \"Requested\",\n\t\tcallSite: string,\n\t\trequestHeaderData?: RuntimeHeaderData,\n\t\toriginalRequest?: IRequest,\n\t) {\n\t\tconst dataStoreNodePath = `/${id}`;\n\t\tif (!this.isDataStoreDeleted(dataStoreNodePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst idToLog =\n\t\t\toriginalRequest !== undefined ? urlToGCNodePath(originalRequest.url) : dataStoreNodePath;\n\n\t\t// Log the package details asynchronously since getInitialSnapshotDetails is async\n\t\tconst recentlyDeletedContext = this.contexts.getRecentlyDeletedContext(id);\n\t\tif (recentlyDeletedContext !== undefined) {\n\t\t\trecentlyDeletedContext\n\t\t\t\t.getInitialSnapshotDetails()\n\t\t\t\t.then((details) => {\n\t\t\t\t\treturn details.pkg.join(\"/\");\n\t\t\t\t})\n\t\t\t\t.then(\n\t\t\t\t\t(pkg) => ({ pkg, error: undefined }),\n\t\t\t\t\t(error) => ({ pkg: undefined, error }),\n\t\t\t\t)\n\t\t\t\t.then(({ pkg, error }) => {\n\t\t\t\t\tthis.mc.logger.sendTelemetryEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: `GC_DeletedDataStore_PathInfo`,\n\t\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\t\tid: idToLog,\n\t\t\t\t\t\t\t\tpkg,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcallSite,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t\t.catch(() => {});\n\t\t}\n\n\t\tthis.mc.logger.sendErrorEvent({\n\t\t\teventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,\n\t\t\t...tagCodeArtifacts({ id: idToLog }),\n\t\t\tcallSite,\n\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\texists: context !== undefined,\n\t\t\tdetails: {\n\t\t\t\turl: originalRequest?.url,\n\t\t\t\theaders: JSON.stringify(originalRequest?.headers),\n\t\t\t\taliased: this.aliasedDataStores.has(id),\n\t\t\t},\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\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\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tlet dataStoreSummary: ISummarizeResult;\n\t\t\t\tif (context.isLoaded) {\n\t\t\t\t\tdataStoreSummary = context.getAttachSummary(telemetryContext);\n\t\t\t\t} else {\n\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// which it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!this.baseSnapshot,\n\t\t\t\t\t\t0x166 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t);\n\t\t\t\t\tdataStoreSummary = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\tgetSnapshotTree(this.baseSnapshot).trees[contextId],\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbuilder.addWithStats(contextId, dataStoreSummary);\n\t\t\t},\n\t\t);\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Gets the GC data. Used when attaching or serializing a detached container.\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tconst builder = new GCDataBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextGCData = context.getAttachGCData(telemetryContext);\n\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// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t},\n\t\t);\n\t\t// Get the outbound routes (aliased data stores) and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", Array.from(this.aliasedDataStores));\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * Helper method for preparing to attach this channel.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate visitLocalBoundContextsDuringAttach(\n\t\tvisitor: (contextId: string, context: FluidDataStoreContext) => void,\n\t): void {\n\t\tconst visitedContexts = new Set<string>();\n\t\tlet visitedLength = -1;\n\t\tlet notBoundContextsLength = -1;\n\t\twhile (\n\t\t\tvisitedLength !== visitedContexts.size &&\n\t\t\tnotBoundContextsLength !== this.contexts.notBoundLength()\n\t\t) {\n\t\t\t// detect changes in the visitedContexts set, as on visiting a context\n\t\t\t// it could could make contexts available by removing other contexts\n\t\t\t// from the not bound context list, so we need to ensure those get processed as well.\n\t\t\t// only once the loop can run with no new contexts added to the visitedContexts set do we\n\t\t\t// know for sure all possible contexts have been visited.\n\t\t\tvisitedLength = visitedContexts.size;\n\t\t\tnotBoundContextsLength = this.contexts.notBoundLength();\n\t\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\t\tif (\n\t\t\t\t\t!(\n\t\t\t\t\t\tvisitedContexts.has(contextId) ||\n\t\t\t\t\t\tthis.contexts.isNotBound(contextId) ||\n\t\t\t\t\t\tthis.attachOpFiredForDataStore.has(contextId)\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tvisitor(contextId, context);\n\t\t\t\t\tvisitedContexts.add(contextId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Helper method for preparing to summarize this channel.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate async visitContextsDuringSummary(\n\t\tvisitor: (contextId: string, context: FluidDataStoreContext) => Promise<void>,\n\t): Promise<void> {\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\t// Summarizer client and hence GC works only with clients with no local changes. A data store in\n\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// had not yet round tripped back to the client.\n\t\t\t// Formerly assert 0x589\n\t\t\tif (context.attachState === AttachState.Attaching) {\n\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\"Local data store detected in attaching state\",\n\t\t\t\t\t\"summarize/getGCData\",\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tif (context.attachState === AttachState.Attached) {\n\t\t\t\tawait visitor(contextId, context);\n\t\t\t}\n\t\t}\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\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextSummary = await context.summarize(fullTree, trackState, telemetryContext);\n\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t},\n\t\t);\n\t\treturn summaryBuilder.getSummaryTree();\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\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\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// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\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\tif (dataStoreContext.isLoaded) {\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"GC_DeletingLoadedDataStore\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tid: dataStoreId,\n\t\t\t\t\tpkg: dataStoreContext.packagePath.join(\"/\"),\n\t\t\t\t}),\n\t\t\t});\n\t\t}\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(\n\t\tsweepReadyDataStoreRoutes: readonly string[],\n\t): 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(\n\t\tnodePath: string,\n\t): 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/Inactive requests for sub-DataStore objects\n\t\tif (requestForChild) {\n\t\t\theaderData.allowTombstone = true;\n\t\t\theaderData.allowInactive = 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, request);\n\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// When notifying GC of this node being loaded, we only indicate the DataStore itself, not the full subDataStore url if applicable.\n\t\t// This is in case the url is to a route that Fluid doesn't understand or track for GC (e.g. if suited for a custom request handler)\n\t\tthis.gcNodeUpdated({\n\t\t\tnode: { type: \"DataStore\", path: `/${id}` },\n\t\t\treason: \"Loaded\",\n\t\t\tpackagePath: details.pkg,\n\t\t\trequest,\n\t\t\theaderData,\n\t\t\ttimestampMs: undefined, // This will be added by the parent context if needed.\n\t\t});\n\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.baseLogger,\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"]}
@@ -5,7 +5,7 @@
5
5
  import { IDeltaManager } from "@fluidframework/container-definitions/internal";
6
6
  import { IContainerRuntimeEvents } from "@fluidframework/container-runtime-definitions/internal";
7
7
  import { IEventProvider } from "@fluidframework/core-interfaces";
8
- import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
8
+ import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
9
9
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
10
10
  /**
11
11
  * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.
@@ -1 +1 @@
1
- {"version":3,"file":"connectionTelemetry.d.ts","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,mBAAmB,EAKnB,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAsZrC,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,gDAAgD,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EACN,gBAAgB,EAEhB,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAEN,mBAAmB,EAKnB,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AA4ZrC,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"}
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ReportOpPerfTelemetry = exports.latencyThreshold = void 0;
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
9
  const internal_1 = require("@fluidframework/core-utils/internal");
10
- const internal_2 = require("@fluidframework/driver-utils/internal");
11
- const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
12
- const internal_3 = require("@fluidframework/telemetry-utils/internal");
10
+ const internal_2 = require("@fluidframework/driver-definitions/internal");
11
+ const internal_3 = require("@fluidframework/driver-utils/internal");
12
+ const internal_4 = require("@fluidframework/telemetry-utils/internal");
13
13
  /**
14
14
  * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.
15
15
  */
@@ -57,7 +57,7 @@ class OpPerfTelemetry {
57
57
  this.noOpCountForTelemetry = 0;
58
58
  /** Cumulative size of the ops processed by this client. This variable is reset everytime the OpStats sampled event is logged */
59
59
  this.processedOpSizeForTelemetry = 0;
60
- this.logger = (0, internal_3.createChildLogger)({ logger, namespace: "OpPerf" });
60
+ this.logger = (0, internal_4.createChildLogger)({ logger, namespace: "OpPerf" });
61
61
  const deltaLatencyEventSampler = (() => {
62
62
  let eventCount = -1;
63
63
  return {
@@ -71,11 +71,11 @@ class OpPerfTelemetry {
71
71
  },
72
72
  };
73
73
  })();
74
- this.deltaLatencyLogger = (0, internal_3.createSampledLogger)(logger, deltaLatencyEventSampler);
74
+ this.deltaLatencyLogger = (0, internal_4.createSampledLogger)(logger, deltaLatencyEventSampler);
75
75
  // The SampledLogger here is used get access to the isSamplingDisabled property derived from
76
76
  // telemetry config properties. The actual sampling logic for op messages happens outside this SampledLogger
77
77
  // due to complexity of the different asynchronus scenarios of the op message lifecycle.
78
- this.opLatencyLogger = (0, internal_3.createSampledLogger)(logger);
78
+ this.opLatencyLogger = (0, internal_4.createSampledLogger)(logger);
79
79
  const opsEventSampler = (() => {
80
80
  let eventCount = 0;
81
81
  return {
@@ -91,7 +91,7 @@ class OpPerfTelemetry {
91
91
  },
92
92
  };
93
93
  })();
94
- this.opsLogger = (0, internal_3.createSampledLogger)(logger, opsEventSampler);
94
+ this.opsLogger = (0, internal_4.createSampledLogger)(logger, opsEventSampler, true /* skipLoggingWhenSamplingIsDisabled */);
95
95
  this.deltaManager.on("pong", (latency) => this.recordPingTime(latency));
96
96
  this.deltaManager.on("submitOp", (message) => this.beforeOpSubmit(message));
97
97
  this.deltaManager.on("op", (message) => this.afterProcessingOp(message));
@@ -115,7 +115,7 @@ class OpPerfTelemetry {
115
115
  });
116
116
  this.deltaManager.outbound.on("push", (messages) => {
117
117
  for (const msg of messages) {
118
- if (msg.type === protocol_definitions_1.MessageType.Operation &&
118
+ if (msg.type === internal_2.MessageType.Operation &&
119
119
  (this.opLatencyLogger.isSamplingDisabled ||
120
120
  this.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber)) {
121
121
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -134,7 +134,7 @@ class OpPerfTelemetry {
134
134
  });
135
135
  this.deltaManager.inbound.on("push", (message) => {
136
136
  if (this.clientId === message.clientId &&
137
- message.type === protocol_definitions_1.MessageType.Operation &&
137
+ message.type === internal_2.MessageType.Operation &&
138
138
  (this.opLatencyLogger.isSamplingDisabled ||
139
139
  this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)) {
140
140
  // We do an explicit check for undefined right after this
@@ -149,7 +149,7 @@ class OpPerfTelemetry {
149
149
  latencyStats.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;
150
150
  }
151
151
  }
152
- if ((0, internal_2.isRuntimeMessage)(message) && typeof message.contents === "string") {
152
+ if ((0, internal_3.isRuntimeMessage)(message) && typeof message.contents === "string") {
153
153
  this.processedOpSizeForTelemetry += message.contents.length;
154
154
  }
155
155
  });
@@ -180,7 +180,7 @@ class OpPerfTelemetry {
180
180
  ops: this.gap,
181
181
  // track time to connect only for first connection.
182
182
  timeToConnect: this.firstConnection
183
- ? (0, internal_3.formatTick)(this.connectionStartTime - this.bootTime)
183
+ ? (0, internal_4.formatTick)(this.connectionStartTime - this.bootTime)
184
184
  : undefined,
185
185
  firstConnection: this.firstConnection,
186
186
  });
@@ -216,7 +216,7 @@ class OpPerfTelemetry {
216
216
  opPerfData: {},
217
217
  });
218
218
  }
219
- if (message.type === protocol_definitions_1.MessageType.NoOp) {
219
+ if (message.type === internal_2.MessageType.NoOp) {
220
220
  // Count the number of no-ops submitted by this client.
221
221
  // The value is reset when we log the OpStats sampled event.
222
222
  this.noOpCountForTelemetry++;
@@ -244,7 +244,7 @@ class OpPerfTelemetry {
244
244
  this.sequenceNumberForMsnTracking = undefined;
245
245
  }
246
246
  if (this.clientId === message.clientId &&
247
- message.type === protocol_definitions_1.MessageType.Operation &&
247
+ message.type === internal_2.MessageType.Operation &&
248
248
  (this.opLatencyLogger.isSamplingDisabled ||
249
249
  this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)) {
250
250
  // We do an explicit check for undefined right after this
@@ -279,7 +279,7 @@ class OpPerfTelemetry {
279
279
  this.clientSequenceNumberForLatencyStatistics = undefined;
280
280
  this.latencyStatistics.delete(message.clientSequenceNumber);
281
281
  }
282
- if ((0, internal_2.isRuntimeMessage)(message)) {
282
+ if ((0, internal_3.isRuntimeMessage)(message)) {
283
283
  // Sampled logging of Ops that have been processed by the current client, the NoOp sent and the
284
284
  // size of the ops processed within one sampling window of this log event.
285
285
  // This data will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.