@fluidframework/container-runtime 2.20.0 → 2.21.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 (333) hide show
  1. package/.eslintrc.cjs +36 -6
  2. package/CHANGELOG.md +38 -0
  3. package/api-report/container-runtime.legacy.alpha.api.md +31 -31
  4. package/dist/batchTracker.d.ts +1 -2
  5. package/dist/batchTracker.d.ts.map +1 -1
  6. package/dist/batchTracker.js +1 -1
  7. package/dist/batchTracker.js.map +1 -1
  8. package/dist/blobManager/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager/blobManager.js +14 -11
  10. package/dist/blobManager/blobManager.js.map +1 -1
  11. package/dist/blobManager/blobManagerSnapSum.d.ts +1 -0
  12. package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
  13. package/dist/blobManager/blobManagerSnapSum.js +7 -5
  14. package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
  15. package/dist/channelCollection.d.ts.map +1 -1
  16. package/dist/channelCollection.js +63 -41
  17. package/dist/channelCollection.js.map +1 -1
  18. package/dist/connectionTelemetry.d.ts +2 -2
  19. package/dist/connectionTelemetry.d.ts.map +1 -1
  20. package/dist/connectionTelemetry.js +4 -4
  21. package/dist/connectionTelemetry.js.map +1 -1
  22. package/dist/containerRuntime.d.ts +14 -30
  23. package/dist/containerRuntime.d.ts.map +1 -1
  24. package/dist/containerRuntime.js +264 -194
  25. package/dist/containerRuntime.js.map +1 -1
  26. package/dist/dataStore.js +6 -3
  27. package/dist/dataStore.js.map +1 -1
  28. package/dist/dataStoreContext.d.ts.map +1 -1
  29. package/dist/dataStoreContext.js +16 -11
  30. package/dist/dataStoreContext.js.map +1 -1
  31. package/dist/dataStoreContexts.d.ts.map +1 -1
  32. package/dist/dataStoreContexts.js +1 -0
  33. package/dist/dataStoreContexts.js.map +1 -1
  34. package/dist/deltaScheduler.d.ts.map +1 -1
  35. package/dist/deltaScheduler.js +5 -5
  36. package/dist/deltaScheduler.js.map +1 -1
  37. package/dist/gc/garbageCollection.d.ts.map +1 -1
  38. package/dist/gc/garbageCollection.js +36 -14
  39. package/dist/gc/garbageCollection.js.map +1 -1
  40. package/dist/gc/gcConfigs.d.ts.map +1 -1
  41. package/dist/gc/gcConfigs.js +2 -0
  42. package/dist/gc/gcConfigs.js.map +1 -1
  43. package/dist/gc/gcDefinitions.d.ts +8 -0
  44. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  45. package/dist/gc/gcDefinitions.js +1 -0
  46. package/dist/gc/gcDefinitions.js.map +1 -1
  47. package/dist/gc/gcHelpers.d.ts.map +1 -1
  48. package/dist/gc/gcHelpers.js +8 -5
  49. package/dist/gc/gcHelpers.js.map +1 -1
  50. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  51. package/dist/gc/gcSummaryStateTracker.js +2 -1
  52. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  53. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  54. package/dist/gc/gcTelemetry.js +29 -15
  55. package/dist/gc/gcTelemetry.js.map +1 -1
  56. package/dist/inboundBatchAggregator.js +3 -3
  57. package/dist/inboundBatchAggregator.js.map +1 -1
  58. package/dist/layerCompatState.d.ts +19 -0
  59. package/dist/layerCompatState.d.ts.map +1 -0
  60. package/dist/layerCompatState.js +64 -0
  61. package/dist/layerCompatState.js.map +1 -0
  62. package/dist/messageTypes.d.ts.map +1 -1
  63. package/dist/messageTypes.js.map +1 -1
  64. package/dist/opLifecycle/duplicateBatchDetector.js +2 -2
  65. package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
  66. package/dist/opLifecycle/opCompressor.d.ts +3 -2
  67. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  68. package/dist/opLifecycle/opCompressor.js +13 -19
  69. package/dist/opLifecycle/opCompressor.js.map +1 -1
  70. package/dist/opLifecycle/opDecompressor.d.ts +3 -0
  71. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  72. package/dist/opLifecycle/opDecompressor.js +4 -1
  73. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  74. package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
  75. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  76. package/dist/opLifecycle/opGroupingManager.js +5 -3
  77. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  78. package/dist/opLifecycle/opSplitter.d.ts +13 -10
  79. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  80. package/dist/opLifecycle/opSplitter.js +14 -11
  81. package/dist/opLifecycle/opSplitter.js.map +1 -1
  82. package/dist/opLifecycle/outbox.d.ts +3 -3
  83. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  84. package/dist/opLifecycle/outbox.js +11 -15
  85. package/dist/opLifecycle/outbox.js.map +1 -1
  86. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  87. package/dist/opLifecycle/remoteMessageProcessor.js +3 -1
  88. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  89. package/dist/packageVersion.d.ts +1 -1
  90. package/dist/packageVersion.js +1 -1
  91. package/dist/packageVersion.js.map +1 -1
  92. package/dist/pendingStateManager.d.ts +3 -4
  93. package/dist/pendingStateManager.d.ts.map +1 -1
  94. package/dist/pendingStateManager.js +11 -10
  95. package/dist/pendingStateManager.js.map +1 -1
  96. package/dist/summary/documentSchema.d.ts +7 -0
  97. package/dist/summary/documentSchema.d.ts.map +1 -1
  98. package/dist/summary/documentSchema.js +6 -4
  99. package/dist/summary/documentSchema.js.map +1 -1
  100. package/dist/summary/orderedClientElection.d.ts +1 -0
  101. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  102. package/dist/summary/orderedClientElection.js +13 -11
  103. package/dist/summary/orderedClientElection.js.map +1 -1
  104. package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -0
  105. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  106. package/dist/summary/runWhileConnectedCoordinator.js +7 -2
  107. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  108. package/dist/summary/runningSummarizer.d.ts +2 -2
  109. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  110. package/dist/summary/runningSummarizer.js +38 -17
  111. package/dist/summary/runningSummarizer.js.map +1 -1
  112. package/dist/summary/summarizer.d.ts +1 -0
  113. package/dist/summary/summarizer.d.ts.map +1 -1
  114. package/dist/summary/summarizer.js +18 -9
  115. package/dist/summary/summarizer.js.map +1 -1
  116. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  117. package/dist/summary/summarizerClientElection.js +1 -0
  118. package/dist/summary/summarizerClientElection.js.map +1 -1
  119. package/dist/summary/summarizerHeuristics.js +1 -1
  120. package/dist/summary/summarizerHeuristics.js.map +1 -1
  121. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  122. package/dist/summary/summarizerNode/index.js.map +1 -1
  123. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  124. package/dist/summary/summarizerNode/summarizerNode.js +30 -31
  125. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  126. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -1
  127. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
  128. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  129. package/dist/summary/summarizerTypes.d.ts +7 -0
  130. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  131. package/dist/summary/summarizerTypes.js.map +1 -1
  132. package/dist/summary/summaryCollection.d.ts +3 -4
  133. package/dist/summary/summaryCollection.d.ts.map +1 -1
  134. package/dist/summary/summaryCollection.js +9 -6
  135. package/dist/summary/summaryCollection.js.map +1 -1
  136. package/dist/summary/summaryFormat.d.ts +4 -1
  137. package/dist/summary/summaryFormat.d.ts.map +1 -1
  138. package/dist/summary/summaryFormat.js +3 -2
  139. package/dist/summary/summaryFormat.js.map +1 -1
  140. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  141. package/dist/summary/summaryGenerator.js +19 -8
  142. package/dist/summary/summaryGenerator.js.map +1 -1
  143. package/dist/summary/summaryManager.d.ts.map +1 -1
  144. package/dist/summary/summaryManager.js +12 -9
  145. package/dist/summary/summaryManager.js.map +1 -1
  146. package/lib/batchTracker.d.ts +1 -2
  147. package/lib/batchTracker.d.ts.map +1 -1
  148. package/lib/batchTracker.js +2 -2
  149. package/lib/batchTracker.js.map +1 -1
  150. package/lib/blobManager/blobManager.d.ts.map +1 -1
  151. package/lib/blobManager/blobManager.js +14 -11
  152. package/lib/blobManager/blobManager.js.map +1 -1
  153. package/lib/blobManager/blobManagerSnapSum.d.ts +1 -0
  154. package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
  155. package/lib/blobManager/blobManagerSnapSum.js +7 -5
  156. package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
  157. package/lib/channelCollection.d.ts.map +1 -1
  158. package/lib/channelCollection.js +66 -42
  159. package/lib/channelCollection.js.map +1 -1
  160. package/lib/connectionTelemetry.d.ts +2 -2
  161. package/lib/connectionTelemetry.d.ts.map +1 -1
  162. package/lib/connectionTelemetry.js +5 -5
  163. package/lib/connectionTelemetry.js.map +1 -1
  164. package/lib/containerRuntime.d.ts +14 -30
  165. package/lib/containerRuntime.d.ts.map +1 -1
  166. package/lib/containerRuntime.js +271 -196
  167. package/lib/containerRuntime.js.map +1 -1
  168. package/lib/dataStore.js +6 -3
  169. package/lib/dataStore.js.map +1 -1
  170. package/lib/dataStoreContext.d.ts.map +1 -1
  171. package/lib/dataStoreContext.js +16 -11
  172. package/lib/dataStoreContext.js.map +1 -1
  173. package/lib/dataStoreContexts.d.ts.map +1 -1
  174. package/lib/dataStoreContexts.js +1 -0
  175. package/lib/dataStoreContexts.js.map +1 -1
  176. package/lib/deltaScheduler.d.ts.map +1 -1
  177. package/lib/deltaScheduler.js +6 -6
  178. package/lib/deltaScheduler.js.map +1 -1
  179. package/lib/gc/garbageCollection.d.ts.map +1 -1
  180. package/lib/gc/garbageCollection.js +39 -15
  181. package/lib/gc/garbageCollection.js.map +1 -1
  182. package/lib/gc/gcConfigs.d.ts.map +1 -1
  183. package/lib/gc/gcConfigs.js +2 -0
  184. package/lib/gc/gcConfigs.js.map +1 -1
  185. package/lib/gc/gcDefinitions.d.ts +8 -0
  186. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  187. package/lib/gc/gcDefinitions.js +1 -0
  188. package/lib/gc/gcDefinitions.js.map +1 -1
  189. package/lib/gc/gcHelpers.d.ts.map +1 -1
  190. package/lib/gc/gcHelpers.js +8 -5
  191. package/lib/gc/gcHelpers.js.map +1 -1
  192. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  193. package/lib/gc/gcSummaryStateTracker.js +2 -1
  194. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  195. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  196. package/lib/gc/gcTelemetry.js +32 -16
  197. package/lib/gc/gcTelemetry.js.map +1 -1
  198. package/lib/inboundBatchAggregator.js +4 -4
  199. package/lib/inboundBatchAggregator.js.map +1 -1
  200. package/lib/layerCompatState.d.ts +19 -0
  201. package/lib/layerCompatState.d.ts.map +1 -0
  202. package/lib/layerCompatState.js +60 -0
  203. package/lib/layerCompatState.js.map +1 -0
  204. package/lib/messageTypes.d.ts.map +1 -1
  205. package/lib/messageTypes.js.map +1 -1
  206. package/lib/opLifecycle/duplicateBatchDetector.js +2 -2
  207. package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
  208. package/lib/opLifecycle/opCompressor.d.ts +3 -2
  209. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  210. package/lib/opLifecycle/opCompressor.js +13 -19
  211. package/lib/opLifecycle/opCompressor.js.map +1 -1
  212. package/lib/opLifecycle/opDecompressor.d.ts +3 -0
  213. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  214. package/lib/opLifecycle/opDecompressor.js +4 -1
  215. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  216. package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
  217. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  218. package/lib/opLifecycle/opGroupingManager.js +5 -3
  219. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  220. package/lib/opLifecycle/opSplitter.d.ts +13 -10
  221. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  222. package/lib/opLifecycle/opSplitter.js +14 -11
  223. package/lib/opLifecycle/opSplitter.js.map +1 -1
  224. package/lib/opLifecycle/outbox.d.ts +3 -3
  225. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  226. package/lib/opLifecycle/outbox.js +11 -15
  227. package/lib/opLifecycle/outbox.js.map +1 -1
  228. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  229. package/lib/opLifecycle/remoteMessageProcessor.js +3 -1
  230. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  231. package/lib/packageVersion.d.ts +1 -1
  232. package/lib/packageVersion.js +1 -1
  233. package/lib/packageVersion.js.map +1 -1
  234. package/lib/pendingStateManager.d.ts +3 -4
  235. package/lib/pendingStateManager.d.ts.map +1 -1
  236. package/lib/pendingStateManager.js +12 -11
  237. package/lib/pendingStateManager.js.map +1 -1
  238. package/lib/summary/documentSchema.d.ts +7 -0
  239. package/lib/summary/documentSchema.d.ts.map +1 -1
  240. package/lib/summary/documentSchema.js +6 -4
  241. package/lib/summary/documentSchema.js.map +1 -1
  242. package/lib/summary/orderedClientElection.d.ts +1 -0
  243. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  244. package/lib/summary/orderedClientElection.js +13 -11
  245. package/lib/summary/orderedClientElection.js.map +1 -1
  246. package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -0
  247. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  248. package/lib/summary/runWhileConnectedCoordinator.js +7 -2
  249. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  250. package/lib/summary/runningSummarizer.d.ts +2 -2
  251. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  252. package/lib/summary/runningSummarizer.js +38 -17
  253. package/lib/summary/runningSummarizer.js.map +1 -1
  254. package/lib/summary/summarizer.d.ts +1 -0
  255. package/lib/summary/summarizer.d.ts.map +1 -1
  256. package/lib/summary/summarizer.js +18 -9
  257. package/lib/summary/summarizer.js.map +1 -1
  258. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  259. package/lib/summary/summarizerClientElection.js +1 -0
  260. package/lib/summary/summarizerClientElection.js.map +1 -1
  261. package/lib/summary/summarizerHeuristics.js +1 -1
  262. package/lib/summary/summarizerHeuristics.js.map +1 -1
  263. package/lib/summary/summarizerNode/index.d.ts.map +1 -1
  264. package/lib/summary/summarizerNode/index.js.map +1 -1
  265. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  266. package/lib/summary/summarizerNode/summarizerNode.js +30 -31
  267. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  268. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -1
  269. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
  270. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  271. package/lib/summary/summarizerTypes.d.ts +7 -0
  272. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  273. package/lib/summary/summarizerTypes.js.map +1 -1
  274. package/lib/summary/summaryCollection.d.ts +3 -4
  275. package/lib/summary/summaryCollection.d.ts.map +1 -1
  276. package/lib/summary/summaryCollection.js +9 -6
  277. package/lib/summary/summaryCollection.js.map +1 -1
  278. package/lib/summary/summaryFormat.d.ts +4 -1
  279. package/lib/summary/summaryFormat.d.ts.map +1 -1
  280. package/lib/summary/summaryFormat.js +2 -2
  281. package/lib/summary/summaryFormat.js.map +1 -1
  282. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  283. package/lib/summary/summaryGenerator.js +19 -8
  284. package/lib/summary/summaryGenerator.js.map +1 -1
  285. package/lib/summary/summaryManager.d.ts.map +1 -1
  286. package/lib/summary/summaryManager.js +12 -9
  287. package/lib/summary/summaryManager.js.map +1 -1
  288. package/package.json +21 -43
  289. package/src/batchTracker.ts +3 -3
  290. package/src/blobManager/blobManager.ts +16 -14
  291. package/src/blobManager/blobManagerSnapSum.ts +8 -8
  292. package/src/channelCollection.ts +63 -44
  293. package/src/connectionTelemetry.ts +12 -6
  294. package/src/containerRuntime.ts +306 -235
  295. package/src/dataStore.ts +6 -3
  296. package/src/dataStoreContext.ts +16 -16
  297. package/src/dataStoreContexts.ts +1 -0
  298. package/src/deltaScheduler.ts +6 -6
  299. package/src/gc/garbageCollection.ts +47 -20
  300. package/src/gc/gcConfigs.ts +9 -1
  301. package/src/gc/gcDefinitions.ts +12 -0
  302. package/src/gc/gcHelpers.ts +9 -4
  303. package/src/gc/gcSummaryStateTracker.ts +3 -1
  304. package/src/gc/gcTelemetry.ts +26 -11
  305. package/src/inboundBatchAggregator.ts +4 -4
  306. package/src/layerCompatState.ts +75 -0
  307. package/src/messageTypes.ts +2 -0
  308. package/src/opLifecycle/README.md +43 -34
  309. package/src/opLifecycle/duplicateBatchDetector.ts +2 -2
  310. package/src/opLifecycle/opCompressor.ts +16 -23
  311. package/src/opLifecycle/opDecompressor.ts +4 -1
  312. package/src/opLifecycle/opGroupingManager.ts +5 -4
  313. package/src/opLifecycle/opSplitter.ts +14 -11
  314. package/src/opLifecycle/outbox.ts +13 -20
  315. package/src/opLifecycle/remoteMessageProcessor.ts +3 -1
  316. package/src/packageVersion.ts +1 -1
  317. package/src/pendingStateManager.ts +15 -10
  318. package/src/summary/documentSchema.ts +11 -4
  319. package/src/summary/orderedClientElection.ts +14 -11
  320. package/src/summary/runWhileConnectedCoordinator.ts +6 -0
  321. package/src/summary/runningSummarizer.ts +43 -19
  322. package/src/summary/summarizer.ts +24 -11
  323. package/src/summary/summarizerClientElection.ts +2 -0
  324. package/src/summary/summarizerHeuristics.ts +1 -1
  325. package/src/summary/summarizerNode/index.ts +1 -0
  326. package/src/summary/summarizerNode/summarizerNode.ts +32 -31
  327. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +4 -4
  328. package/src/summary/summarizerTypes.ts +7 -0
  329. package/src/summary/summaryCollection.ts +19 -8
  330. package/src/summary/summaryFormat.ts +10 -5
  331. package/src/summary/summaryGenerator.ts +25 -10
  332. package/src/summary/summaryManager.ts +14 -12
  333. package/container-runtime.test-files.tar +0 -0
@@ -10,11 +10,14 @@ import { CreateSummarizerNodeSource, channelsTreeName, gcDataBlobKey, } from "@f
10
10
  import { GCDataBuilder, RequestParser, SummaryTreeBuilder, addBlobToSummary, convertSnapshotTreeToSummaryTree, convertSummaryTreeToITree, create404Response, createResponseError, encodeCompactIdToString, isSerializedHandle, processAttachMessageGCData, responseToException, unpackChildNodesUsedRoutes, } from "@fluidframework/runtime-utils/internal";
11
11
  import { DataCorruptionError, DataProcessingError, LoggingError, createChildLogger, createChildMonitoringContext, extractSafePropertiesFromMessage, tagCodeArtifacts, } from "@fluidframework/telemetry-utils/internal";
12
12
  import { v4 as uuid } from "uuid";
13
- import { DeletedResponseHeaderKey, defaultRuntimeHeaderData, } from "./containerRuntime.js";
13
+ import {
14
+ // eslint-disable-next-line import/no-deprecated
15
+ DeletedResponseHeaderKey, defaultRuntimeHeaderData, } from "./containerRuntime.js";
14
16
  import { channelToDataStore, isDataStoreAliasMessage, } from "./dataStore.js";
15
17
  import { LocalDetachedFluidDataStoreContext, LocalFluidDataStoreContext, RemoteFluidDataStoreContext, createAttributesBlob, } from "./dataStoreContext.js";
16
18
  import { DataStoreContexts } from "./dataStoreContexts.js";
17
19
  import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
20
+ // eslint-disable-next-line import/no-deprecated
18
21
  import { GCNodeType, urlToGCNodePath } from "./gc/index.js";
19
22
  import { ContainerMessageType } from "./messageTypes.js";
20
23
  import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs.js";
@@ -160,6 +163,7 @@ export class ChannelCollection {
160
163
  this.pendingAttach = new Map();
161
164
  // 0.24 back-compat attachingBeforeSummary
162
165
  this.attachOpFiredForDataStore = new Set();
166
+ // eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
163
167
  this.disposeOnce = new Lazy(() => this.contexts.dispose());
164
168
  this.pendingAliasMap = new Map();
165
169
  /**
@@ -188,42 +192,42 @@ export class ChannelCollection {
188
192
  unreferencedDataStoreCount++;
189
193
  }
190
194
  // If we have a detached container, then create local data store contexts.
191
- if (this.parentContext.attachState !== AttachState.Detached) {
192
- let snapshotForRemoteFluidDatastoreContext = value;
193
- if (isInstanceOfISnapshot(baseSnapshot)) {
194
- snapshotForRemoteFluidDatastoreContext = {
195
- ...baseSnapshot,
196
- snapshotTree: value,
197
- };
195
+ if (this.parentContext.attachState === AttachState.Detached) {
196
+ if (typeof value !== "object") {
197
+ throw new LoggingError("Snapshot should be there to load from!!");
198
198
  }
199
- dataStoreContext = new RemoteFluidDataStoreContext({
199
+ const snapshotTree = value;
200
+ dataStoreContext = new LocalFluidDataStoreContext({
200
201
  id: key,
201
- snapshot: snapshotForRemoteFluidDatastoreContext,
202
+ pkg: undefined,
202
203
  parentContext: this.wrapContextForInnerChannel(key),
203
204
  storage: this.parentContext.storage,
204
205
  scope: this.parentContext.scope,
205
206
  createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
206
207
  type: CreateSummarizerNodeSource.FromSummary,
207
208
  }),
208
- loadingGroupId: value.groupId,
209
+ makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),
210
+ snapshotTree,
209
211
  });
210
212
  }
211
213
  else {
212
- if (typeof value !== "object") {
213
- throw new LoggingError("Snapshot should be there to load from!!");
214
+ let snapshotForRemoteFluidDatastoreContext = value;
215
+ if (isInstanceOfISnapshot(baseSnapshot)) {
216
+ snapshotForRemoteFluidDatastoreContext = {
217
+ ...baseSnapshot,
218
+ snapshotTree: value,
219
+ };
214
220
  }
215
- const snapshotTree = value;
216
- dataStoreContext = new LocalFluidDataStoreContext({
221
+ dataStoreContext = new RemoteFluidDataStoreContext({
217
222
  id: key,
218
- pkg: undefined,
223
+ snapshot: snapshotForRemoteFluidDatastoreContext,
219
224
  parentContext: this.wrapContextForInnerChannel(key),
220
225
  storage: this.parentContext.storage,
221
226
  scope: this.parentContext.scope,
222
227
  createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
223
228
  type: CreateSummarizerNodeSource.FromSummary,
224
229
  }),
225
- makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),
226
- snapshotTree,
230
+ loadingGroupId: value.groupId,
227
231
  });
228
232
  }
229
233
  this.contexts.addBoundOrRemoted(dataStoreContext);
@@ -486,13 +490,16 @@ export class ChannelCollection {
486
490
  reSubmit(type, content, localOpMetadata) {
487
491
  switch (type) {
488
492
  case ContainerMessageType.Attach:
489
- case ContainerMessageType.Alias:
493
+ case ContainerMessageType.Alias: {
490
494
  this.parentContext.submitMessage(type, content, localOpMetadata);
491
495
  return;
492
- case ContainerMessageType.FluidDataStoreOp:
496
+ }
497
+ case ContainerMessageType.FluidDataStoreOp: {
493
498
  return this.reSubmitChannelOp(type, content, localOpMetadata);
494
- default:
499
+ }
500
+ default: {
495
501
  assert(false, 0x907 /* unknown op type */);
502
+ }
496
503
  }
497
504
  }
498
505
  reSubmitChannelOp(type, content, localOpMetadata) {
@@ -529,14 +536,18 @@ export class ChannelCollection {
529
536
  async applyStashedOp(content) {
530
537
  const opContents = content;
531
538
  switch (opContents.type) {
532
- case ContainerMessageType.Attach:
539
+ case ContainerMessageType.Attach: {
533
540
  return this.applyStashedAttachOp(opContents.contents);
534
- case ContainerMessageType.Alias:
541
+ }
542
+ case ContainerMessageType.Alias: {
535
543
  return;
536
- case ContainerMessageType.FluidDataStoreOp:
544
+ }
545
+ case ContainerMessageType.FluidDataStoreOp: {
537
546
  return this.applyStashedChannelChannelOp(opContents.contents);
538
- default:
547
+ }
548
+ default: {
539
549
  assert(false, 0x908 /* unknon type of op */);
550
+ }
540
551
  }
541
552
  }
542
553
  async applyStashedChannelChannelOp(envelope) {
@@ -584,7 +595,7 @@ export class ChannelCollection {
584
595
  // if the client is not detached put in the pending attach list
585
596
  // so that on ack of the stashed op, the context is found.
586
597
  // detached client don't send ops, so should not expect and ack.
587
- this.pendingAttach.set(message.id, message);
598
+ this.pendingAttach.set(id, message);
588
599
  }
589
600
  }
590
601
  /**
@@ -593,17 +604,21 @@ export class ChannelCollection {
593
604
  */
594
605
  processMessages(messageCollection) {
595
606
  switch (messageCollection.envelope.type) {
596
- case ContainerMessageType.FluidDataStoreOp:
607
+ case ContainerMessageType.FluidDataStoreOp: {
597
608
  this.processChannelMessages(messageCollection);
598
609
  break;
599
- case ContainerMessageType.Attach:
610
+ }
611
+ case ContainerMessageType.Attach: {
600
612
  this.processAttachMessages(messageCollection);
601
613
  break;
602
- case ContainerMessageType.Alias:
614
+ }
615
+ case ContainerMessageType.Alias: {
603
616
  this.processAliasMessages(messageCollection);
604
617
  break;
605
- default:
618
+ }
619
+ default: {
606
620
  assert(false, 0x8e9 /* unreached */);
621
+ }
607
622
  }
608
623
  }
609
624
  /**
@@ -630,7 +645,7 @@ export class ChannelCollection {
630
645
  * @param messageCollection - The collection of messages to process.
631
646
  */
632
647
  processChannelMessages(messageCollection) {
633
- const { messagesContent, local } = messageCollection;
648
+ const { envelope, messagesContent, local } = messageCollection;
634
649
  let currentMessageState;
635
650
  let currentMessagesContent = [];
636
651
  // Helper that sends the current bunch of messages to the data store. It validates that the data stores exists.
@@ -642,7 +657,7 @@ export class ChannelCollection {
642
657
  const currentContext = this.contexts.get(currentMessageState.address);
643
658
  assert(!!currentContext, 0xa66 /* Context not found */);
644
659
  currentContext.processMessages({
645
- envelope: { ...messageCollection.envelope, type: currentMessageState.type },
660
+ envelope: { ...envelope, type: currentMessageState.type },
646
661
  messagesContent: currentMessagesContent,
647
662
  local,
648
663
  });
@@ -664,10 +679,10 @@ export class ChannelCollection {
664
679
  }
665
680
  if (context === undefined) {
666
681
  // Former assert 0x162
667
- throw DataProcessingError.create("No context for op", "processFluidDataStoreOp", messageCollection.envelope, {
682
+ throw DataProcessingError.create("No context for op", "processFluidDataStoreOp", envelope, {
668
683
  local,
669
684
  messageDetails: JSON.stringify({
670
- type: messageCollection.envelope.type,
685
+ type: envelope.type,
671
686
  contentType: typeof contents,
672
687
  }),
673
688
  ...tagCodeArtifacts({ address }),
@@ -689,10 +704,10 @@ export class ChannelCollection {
689
704
  this.gcNodeUpdated({
690
705
  node: { type: "DataStore", path: `/${address}` },
691
706
  reason: "Changed",
692
- timestampMs: messageCollection.envelope.timestamp,
707
+ timestampMs: envelope.timestamp,
693
708
  packagePath: context.isLoaded ? context.packagePath : undefined,
694
709
  });
695
- detectOutboundReferences(address, contextContents, (fromPath, toPath) => this.parentContext.addedGCOutboundRoute(fromPath, toPath, messageCollection.envelope.timestamp));
710
+ detectOutboundReferences(address, contextContents, (fromPath, toPath) => this.parentContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp));
696
711
  }
697
712
  // Process the last bunch of messages, if any. Note that there may not be any messages in case all of them are
698
713
  // ignored because the data store is deleted.
@@ -703,6 +718,7 @@ export class ChannelCollection {
703
718
  if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData, originalRequest)) {
704
719
  // The requested data store has been deleted by gc. Create a 404 response exception.
705
720
  throw responseToException(createResponseError(404, "DataStore was deleted", originalRequest, {
721
+ // eslint-disable-next-line import/no-deprecated
706
722
  [DeletedResponseHeaderKey]: true,
707
723
  }), originalRequest);
708
724
  }
@@ -744,7 +760,7 @@ export class ChannelCollection {
744
760
  if (!this.isDataStoreDeleted(dataStoreNodePath)) {
745
761
  return false;
746
762
  }
747
- const idToLog = originalRequest !== undefined ? urlToGCNodePath(originalRequest.url) : dataStoreNodePath;
763
+ const idToLog = originalRequest === undefined ? dataStoreNodePath : urlToGCNodePath(originalRequest.url);
748
764
  // Log the package details asynchronously since getInitialSnapshotDetails is async
749
765
  const recentlyDeletedContext = this.contexts.getRecentlyDeletedContext(id);
750
766
  if (recentlyDeletedContext !== undefined) {
@@ -867,7 +883,7 @@ export class ChannelCollection {
867
883
  builder.prefixAndAddNodes(contextId, contextGCData.gcNodes);
868
884
  });
869
885
  // Get the outbound routes (aliased data stores) and add a GC node for this channel.
870
- builder.addNode("/", Array.from(this.aliasedDataStores));
886
+ builder.addNode("/", [...this.aliasedDataStores]);
871
887
  return builder.getGCData();
872
888
  }
873
889
  /**
@@ -1032,7 +1048,7 @@ export class ChannelCollection {
1032
1048
  }
1033
1049
  this.deleteChild(dataStoreId);
1034
1050
  }
1035
- return Array.from(sweepReadyDataStoreRoutes);
1051
+ return [...sweepReadyDataStoreRoutes];
1036
1052
  }
1037
1053
  /**
1038
1054
  * This is called to update objects whose routes are tombstones.
@@ -1081,12 +1097,14 @@ export class ChannelCollection {
1081
1097
  // If the node belongs to a data store, return its package path. For DDSes, we return the package path of the
1082
1098
  // data store that contains it.
1083
1099
  const context = this.contexts.get(nodePath.split("/")[1]);
1084
- return (await context?.getInitialSnapshotDetails())?.pkg;
1100
+ const initialSnapshotDetails = await context?.getInitialSnapshotDetails();
1101
+ return initialSnapshotDetails?.pkg;
1085
1102
  }
1086
1103
  /**
1087
1104
  * 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).
1088
1105
  * @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.
1089
1106
  */
1107
+ // eslint-disable-next-line import/no-deprecated
1090
1108
  getGCNodeType(nodePath) {
1091
1109
  const pathParts = nodePath.split("/");
1092
1110
  if (!this.contexts.has(pathParts[1])) {
@@ -1095,8 +1113,10 @@ export class ChannelCollection {
1095
1113
  // Data stores paths are of the format "/dataStoreId".
1096
1114
  // Sub data store paths are of the format "/dataStoreId/subPath/...".
1097
1115
  if (pathParts.length === 2) {
1116
+ // eslint-disable-next-line import/no-deprecated
1098
1117
  return GCNodeType.DataStore;
1099
1118
  }
1119
+ // eslint-disable-next-line import/no-deprecated
1100
1120
  return GCNodeType.SubDataStore;
1101
1121
  }
1102
1122
  internalId(maybeAlias) {
@@ -1144,7 +1164,9 @@ export class ChannelCollection {
1144
1164
  return dataStore.request(subRequest);
1145
1165
  }
1146
1166
  }
1147
- export function getSummaryForDatastores(snapshot, metadata) {
1167
+ export function getSummaryForDatastores(snapshot,
1168
+ // eslint-disable-next-line import/no-deprecated
1169
+ metadata) {
1148
1170
  if (!snapshot) {
1149
1171
  return undefined;
1150
1172
  }
@@ -1197,7 +1219,9 @@ export function detectOutboundReferences(address, contents, addedOutboundReferen
1197
1219
  // GC node paths are all absolute paths, hence the "" prefix.
1198
1220
  // e.g. this will yield "/dataStoreId/ddsId"
1199
1221
  const fromPath = ["", address, ddsAddress].join("/");
1200
- outboundPaths.forEach((toPath) => addedOutboundReference(fromPath, toPath));
1222
+ for (const toPath of outboundPaths) {
1223
+ addedOutboundReference(fromPath, toPath);
1224
+ }
1201
1225
  }
1202
1226
  /**
1203
1227
  * @internal