@fluidframework/container-runtime 2.0.0-dev-rc.5.0.0.268409 → 2.0.0-dev-rc.5.0.0.270987

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 (306) hide show
  1. package/api-report/container-runtime.alpha.api.md +3 -8
  2. package/api-report/container-runtime.beta.api.md +2 -2
  3. package/api-report/container-runtime.public.api.md +2 -2
  4. package/biome.jsonc +4 -0
  5. package/container-runtime.test-files.tar +0 -0
  6. package/dist/batchTracker.js +5 -1
  7. package/dist/batchTracker.js.map +1 -1
  8. package/dist/blobManager.d.ts +1 -18
  9. package/dist/blobManager.d.ts.map +1 -1
  10. package/dist/blobManager.js +39 -48
  11. package/dist/blobManager.js.map +1 -1
  12. package/dist/channelCollection.d.ts +8 -9
  13. package/dist/channelCollection.d.ts.map +1 -1
  14. package/dist/channelCollection.js +71 -51
  15. package/dist/channelCollection.js.map +1 -1
  16. package/dist/connectionTelemetry.d.ts +1 -2
  17. package/dist/connectionTelemetry.d.ts.map +1 -1
  18. package/dist/connectionTelemetry.js +32 -14
  19. package/dist/connectionTelemetry.js.map +1 -1
  20. package/dist/containerHandleContext.js +4 -0
  21. package/dist/containerHandleContext.js.map +1 -1
  22. package/dist/containerRuntime.d.ts +7 -18
  23. package/dist/containerRuntime.d.ts.map +1 -1
  24. package/dist/containerRuntime.js +145 -43
  25. package/dist/containerRuntime.js.map +1 -1
  26. package/dist/dataStore.js +9 -1
  27. package/dist/dataStore.js.map +1 -1
  28. package/dist/dataStoreContext.d.ts +23 -37
  29. package/dist/dataStoreContext.d.ts.map +1 -1
  30. package/dist/dataStoreContext.js +159 -133
  31. package/dist/dataStoreContext.js.map +1 -1
  32. package/dist/dataStoreContexts.js +29 -28
  33. package/dist/dataStoreContexts.js.map +1 -1
  34. package/dist/dataStoreRegistry.js +1 -0
  35. package/dist/dataStoreRegistry.js.map +1 -1
  36. package/dist/deltaManagerProxies.d.ts +4 -4
  37. package/dist/deltaManagerProxies.d.ts.map +1 -1
  38. package/dist/deltaManagerProxies.js +33 -28
  39. package/dist/deltaManagerProxies.js.map +1 -1
  40. package/dist/deltaScheduler.d.ts +1 -2
  41. package/dist/deltaScheduler.d.ts.map +1 -1
  42. package/dist/deltaScheduler.js +13 -9
  43. package/dist/deltaScheduler.js.map +1 -1
  44. package/dist/error.js +2 -1
  45. package/dist/error.js.map +1 -1
  46. package/dist/gc/garbageCollection.d.ts.map +1 -1
  47. package/dist/gc/garbageCollection.js +37 -17
  48. package/dist/gc/garbageCollection.js.map +1 -1
  49. package/dist/gc/gcDefinitions.d.ts +0 -4
  50. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  51. package/dist/gc/gcDefinitions.js +1 -3
  52. package/dist/gc/gcDefinitions.js.map +1 -1
  53. package/dist/gc/gcSummaryStateTracker.js +19 -14
  54. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  55. package/dist/gc/gcTelemetry.js +12 -5
  56. package/dist/gc/gcTelemetry.js.map +1 -1
  57. package/dist/gc/gcUnreferencedStateTracker.js +12 -1
  58. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  59. package/dist/gc/index.d.ts +1 -1
  60. package/dist/gc/index.d.ts.map +1 -1
  61. package/dist/gc/index.js +1 -2
  62. package/dist/gc/index.js.map +1 -1
  63. package/dist/messageTypes.d.ts +1 -1
  64. package/dist/messageTypes.d.ts.map +1 -1
  65. package/dist/messageTypes.js.map +1 -1
  66. package/dist/opLifecycle/batchManager.js +5 -3
  67. package/dist/opLifecycle/batchManager.js.map +1 -1
  68. package/dist/opLifecycle/opCompressor.js +1 -0
  69. package/dist/opLifecycle/opCompressor.js.map +1 -1
  70. package/dist/opLifecycle/opDecompressor.d.ts +1 -1
  71. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  72. package/dist/opLifecycle/opDecompressor.js +6 -4
  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 +3 -1
  77. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  78. package/dist/opLifecycle/opSplitter.d.ts +1 -1
  79. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  80. package/dist/opLifecycle/opSplitter.js +6 -0
  81. package/dist/opLifecycle/opSplitter.js.map +1 -1
  82. package/dist/opLifecycle/outbox.js +15 -10
  83. package/dist/opLifecycle/outbox.js.map +1 -1
  84. package/dist/opLifecycle/remoteMessageProcessor.d.ts +1 -1
  85. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  86. package/dist/opLifecycle/remoteMessageProcessor.js +3 -0
  87. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  88. package/dist/opProperties.d.ts +1 -1
  89. package/dist/opProperties.d.ts.map +1 -1
  90. package/dist/opProperties.js.map +1 -1
  91. package/dist/packageVersion.d.ts +1 -1
  92. package/dist/packageVersion.js +1 -1
  93. package/dist/packageVersion.js.map +1 -1
  94. package/dist/pendingStateManager.d.ts.map +1 -1
  95. package/dist/pendingStateManager.js +34 -18
  96. package/dist/pendingStateManager.js.map +1 -1
  97. package/dist/scheduleManager.d.ts +1 -2
  98. package/dist/scheduleManager.d.ts.map +1 -1
  99. package/dist/scheduleManager.js +15 -4
  100. package/dist/scheduleManager.js.map +1 -1
  101. package/dist/storageServiceWithAttachBlobs.js +1 -0
  102. package/dist/storageServiceWithAttachBlobs.js.map +1 -1
  103. package/dist/summary/documentSchema.js +17 -1
  104. package/dist/summary/documentSchema.js.map +1 -1
  105. package/dist/summary/orderedClientElection.js +19 -11
  106. package/dist/summary/orderedClientElection.js.map +1 -1
  107. package/dist/summary/runWhileConnectedCoordinator.js +4 -2
  108. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  109. package/dist/summary/runningSummarizer.d.ts +1 -1
  110. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  111. package/dist/summary/runningSummarizer.js +56 -38
  112. package/dist/summary/runningSummarizer.js.map +1 -1
  113. package/dist/summary/summarizer.js +17 -8
  114. package/dist/summary/summarizer.js.map +1 -1
  115. package/dist/summary/summarizerClientElection.js +18 -7
  116. package/dist/summary/summarizerClientElection.js.map +1 -1
  117. package/dist/summary/summarizerHeuristics.js +30 -25
  118. package/dist/summary/summarizerHeuristics.js.map +1 -1
  119. package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -2
  120. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  121. package/dist/summary/summarizerNode/summarizerNode.js +12 -3
  122. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  123. package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -0
  124. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  125. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +20 -6
  126. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  127. package/dist/summary/summarizerTypes.d.ts +2 -2
  128. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  129. package/dist/summary/summarizerTypes.js.map +1 -1
  130. package/dist/summary/summaryCollection.d.ts +1 -2
  131. package/dist/summary/summaryCollection.d.ts.map +1 -1
  132. package/dist/summary/summaryCollection.js +23 -11
  133. package/dist/summary/summaryCollection.js.map +1 -1
  134. package/dist/summary/summaryFormat.d.ts +1 -2
  135. package/dist/summary/summaryFormat.d.ts.map +1 -1
  136. package/dist/summary/summaryFormat.js.map +1 -1
  137. package/dist/summary/summaryGenerator.js +12 -5
  138. package/dist/summary/summaryGenerator.js.map +1 -1
  139. package/dist/summary/summaryManager.js +58 -48
  140. package/dist/summary/summaryManager.js.map +1 -1
  141. package/dist/throttler.js +4 -1
  142. package/dist/throttler.js.map +1 -1
  143. package/lib/batchTracker.js +5 -1
  144. package/lib/batchTracker.js.map +1 -1
  145. package/lib/blobManager.d.ts +1 -18
  146. package/lib/blobManager.d.ts.map +1 -1
  147. package/lib/blobManager.js +39 -48
  148. package/lib/blobManager.js.map +1 -1
  149. package/lib/channelCollection.d.ts +8 -9
  150. package/lib/channelCollection.d.ts.map +1 -1
  151. package/lib/channelCollection.js +72 -53
  152. package/lib/channelCollection.js.map +1 -1
  153. package/lib/connectionTelemetry.d.ts +1 -2
  154. package/lib/connectionTelemetry.d.ts.map +1 -1
  155. package/lib/connectionTelemetry.js +33 -15
  156. package/lib/connectionTelemetry.js.map +1 -1
  157. package/lib/containerHandleContext.js +4 -0
  158. package/lib/containerHandleContext.js.map +1 -1
  159. package/lib/containerRuntime.d.ts +7 -18
  160. package/lib/containerRuntime.d.ts.map +1 -1
  161. package/lib/containerRuntime.js +145 -43
  162. package/lib/containerRuntime.js.map +1 -1
  163. package/lib/dataStore.js +9 -1
  164. package/lib/dataStore.js.map +1 -1
  165. package/lib/dataStoreContext.d.ts +23 -37
  166. package/lib/dataStoreContext.d.ts.map +1 -1
  167. package/lib/dataStoreContext.js +162 -136
  168. package/lib/dataStoreContext.js.map +1 -1
  169. package/lib/dataStoreContexts.js +29 -28
  170. package/lib/dataStoreContexts.js.map +1 -1
  171. package/lib/dataStoreRegistry.js +1 -0
  172. package/lib/dataStoreRegistry.js.map +1 -1
  173. package/lib/deltaManagerProxies.d.ts +4 -4
  174. package/lib/deltaManagerProxies.d.ts.map +1 -1
  175. package/lib/deltaManagerProxies.js +33 -28
  176. package/lib/deltaManagerProxies.js.map +1 -1
  177. package/lib/deltaScheduler.d.ts +1 -2
  178. package/lib/deltaScheduler.d.ts.map +1 -1
  179. package/lib/deltaScheduler.js +13 -9
  180. package/lib/deltaScheduler.js.map +1 -1
  181. package/lib/error.js +2 -1
  182. package/lib/error.js.map +1 -1
  183. package/lib/gc/garbageCollection.d.ts.map +1 -1
  184. package/lib/gc/garbageCollection.js +37 -17
  185. package/lib/gc/garbageCollection.js.map +1 -1
  186. package/lib/gc/gcDefinitions.d.ts +0 -4
  187. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  188. package/lib/gc/gcDefinitions.js +0 -2
  189. package/lib/gc/gcDefinitions.js.map +1 -1
  190. package/lib/gc/gcSummaryStateTracker.js +19 -14
  191. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  192. package/lib/gc/gcTelemetry.js +12 -5
  193. package/lib/gc/gcTelemetry.js.map +1 -1
  194. package/lib/gc/gcUnreferencedStateTracker.js +12 -1
  195. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  196. package/lib/gc/index.d.ts +1 -1
  197. package/lib/gc/index.d.ts.map +1 -1
  198. package/lib/gc/index.js +1 -1
  199. package/lib/gc/index.js.map +1 -1
  200. package/lib/messageTypes.d.ts +1 -1
  201. package/lib/messageTypes.d.ts.map +1 -1
  202. package/lib/messageTypes.js.map +1 -1
  203. package/lib/opLifecycle/batchManager.js +5 -3
  204. package/lib/opLifecycle/batchManager.js.map +1 -1
  205. package/lib/opLifecycle/opCompressor.js +1 -0
  206. package/lib/opLifecycle/opCompressor.js.map +1 -1
  207. package/lib/opLifecycle/opDecompressor.d.ts +1 -1
  208. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  209. package/lib/opLifecycle/opDecompressor.js +6 -4
  210. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  211. package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
  212. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  213. package/lib/opLifecycle/opGroupingManager.js +3 -1
  214. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  215. package/lib/opLifecycle/opSplitter.d.ts +1 -1
  216. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  217. package/lib/opLifecycle/opSplitter.js +6 -0
  218. package/lib/opLifecycle/opSplitter.js.map +1 -1
  219. package/lib/opLifecycle/outbox.js +15 -10
  220. package/lib/opLifecycle/outbox.js.map +1 -1
  221. package/lib/opLifecycle/remoteMessageProcessor.d.ts +1 -1
  222. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  223. package/lib/opLifecycle/remoteMessageProcessor.js +4 -1
  224. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  225. package/lib/opProperties.d.ts +1 -1
  226. package/lib/opProperties.d.ts.map +1 -1
  227. package/lib/opProperties.js.map +1 -1
  228. package/lib/packageVersion.d.ts +1 -1
  229. package/lib/packageVersion.js +1 -1
  230. package/lib/packageVersion.js.map +1 -1
  231. package/lib/pendingStateManager.d.ts.map +1 -1
  232. package/lib/pendingStateManager.js +34 -18
  233. package/lib/pendingStateManager.js.map +1 -1
  234. package/lib/scheduleManager.d.ts +1 -2
  235. package/lib/scheduleManager.d.ts.map +1 -1
  236. package/lib/scheduleManager.js +15 -4
  237. package/lib/scheduleManager.js.map +1 -1
  238. package/lib/storageServiceWithAttachBlobs.js +1 -0
  239. package/lib/storageServiceWithAttachBlobs.js.map +1 -1
  240. package/lib/summary/documentSchema.js +17 -1
  241. package/lib/summary/documentSchema.js.map +1 -1
  242. package/lib/summary/orderedClientElection.js +19 -11
  243. package/lib/summary/orderedClientElection.js.map +1 -1
  244. package/lib/summary/runWhileConnectedCoordinator.js +4 -2
  245. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  246. package/lib/summary/runningSummarizer.d.ts +1 -1
  247. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  248. package/lib/summary/runningSummarizer.js +57 -39
  249. package/lib/summary/runningSummarizer.js.map +1 -1
  250. package/lib/summary/summarizer.js +17 -8
  251. package/lib/summary/summarizer.js.map +1 -1
  252. package/lib/summary/summarizerClientElection.js +18 -7
  253. package/lib/summary/summarizerClientElection.js.map +1 -1
  254. package/lib/summary/summarizerHeuristics.js +30 -25
  255. package/lib/summary/summarizerHeuristics.js.map +1 -1
  256. package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -2
  257. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  258. package/lib/summary/summarizerNode/summarizerNode.js +12 -3
  259. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  260. package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -0
  261. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  262. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +20 -6
  263. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  264. package/lib/summary/summarizerTypes.d.ts +2 -2
  265. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  266. package/lib/summary/summarizerTypes.js.map +1 -1
  267. package/lib/summary/summaryCollection.d.ts +1 -2
  268. package/lib/summary/summaryCollection.d.ts.map +1 -1
  269. package/lib/summary/summaryCollection.js +23 -11
  270. package/lib/summary/summaryCollection.js.map +1 -1
  271. package/lib/summary/summaryFormat.d.ts +1 -2
  272. package/lib/summary/summaryFormat.d.ts.map +1 -1
  273. package/lib/summary/summaryFormat.js.map +1 -1
  274. package/lib/summary/summaryGenerator.js +12 -5
  275. package/lib/summary/summaryGenerator.js.map +1 -1
  276. package/lib/summary/summaryManager.js +58 -48
  277. package/lib/summary/summaryManager.js.map +1 -1
  278. package/lib/throttler.js +4 -1
  279. package/lib/throttler.js.map +1 -1
  280. package/package.json +23 -20
  281. package/src/batchTracker.ts +1 -1
  282. package/src/blobManager.ts +1 -39
  283. package/src/channelCollection.ts +63 -76
  284. package/src/connectionTelemetry.ts +5 -2
  285. package/src/containerRuntime.ts +9 -32
  286. package/src/dataStoreContext.ts +38 -79
  287. package/src/deltaManagerProxies.ts +3 -5
  288. package/src/deltaScheduler.ts +4 -2
  289. package/src/gc/garbageCollection.ts +0 -2
  290. package/src/gc/gcDefinitions.ts +0 -4
  291. package/src/gc/index.ts +0 -1
  292. package/src/messageTypes.ts +1 -1
  293. package/src/opLifecycle/opDecompressor.ts +1 -1
  294. package/src/opLifecycle/opGroupingManager.ts +1 -1
  295. package/src/opLifecycle/opSplitter.ts +1 -1
  296. package/src/opLifecycle/remoteMessageProcessor.ts +4 -2
  297. package/src/opProperties.ts +4 -2
  298. package/src/packageVersion.ts +1 -1
  299. package/src/pendingStateManager.ts +16 -5
  300. package/src/scheduleManager.ts +4 -2
  301. package/src/summary/runningSummarizer.ts +5 -2
  302. package/src/summary/summarizerNode/summarizerNode.ts +5 -2
  303. package/src/summary/summarizerTypes.ts +5 -2
  304. package/src/summary/summaryCollection.ts +1 -1
  305. package/src/summary/summaryFormat.ts +2 -1
  306. package/tsconfig.json +2 -0
@@ -16,17 +16,14 @@ import {
16
16
  } from "@fluidframework/core-interfaces";
17
17
  import { type IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
18
18
  import { assert, LazyPromise, unreachableCase } from "@fluidframework/core-utils/internal";
19
- import {
20
- IClientDetails,
21
- IQuorumClients,
22
- ISequencedDocumentMessage,
23
- } from "@fluidframework/driver-definitions";
19
+ import { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
24
20
  import {
25
21
  IDocumentStorageService,
26
22
  type ISnapshot,
27
23
  IDocumentMessage,
28
24
  ISnapshotTree,
29
25
  ITreeEntry,
26
+ ISequencedDocumentMessage,
30
27
  } from "@fluidframework/driver-definitions/internal";
31
28
  import {
32
29
  BlobTreeEntry,
@@ -55,13 +52,11 @@ import {
55
52
  ISummarizerNodeWithGC,
56
53
  SummarizeInternalFn,
57
54
  channelsTreeName,
58
- gcDataBlobKey,
59
55
  IInboundSignalMessage,
60
56
  } from "@fluidframework/runtime-definitions/internal";
61
57
  import {
62
58
  addBlobToSummary,
63
59
  isSnapshotFetchRequiredForLoadingGroupId,
64
- toFluidHandleInternal,
65
60
  } from "@fluidframework/runtime-utils/internal";
66
61
  import {
67
62
  DataCorruptionError,
@@ -75,7 +70,7 @@ import {
75
70
  tagCodeArtifacts,
76
71
  } from "@fluidframework/telemetry-utils/internal";
77
72
 
78
- import { detectOutboundRoutesViaDDSKey, sendGCUnexpectedUsageEvent } from "./gc/index.js";
73
+ import { sendGCUnexpectedUsageEvent } from "./gc/index.js";
79
74
  import {
80
75
  // eslint-disable-next-line import/no-deprecated
81
76
  ReadFluidDataStoreAttributes,
@@ -119,13 +114,9 @@ export interface ISnapshotDetails {
119
114
  * @internal
120
115
  */
121
116
  export interface IFluidDataStoreContextInternal extends IFluidDataStoreContext {
122
- getAttachData(
123
- includeGCData: boolean,
124
- telemetryContext?: ITelemetryContext,
125
- ): {
126
- attachSummary: ISummaryTreeWithStats;
127
- type: string;
128
- };
117
+ getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
118
+
119
+ getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;
129
120
 
130
121
  getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
131
122
 
@@ -723,33 +714,6 @@ export abstract class FluidDataStoreContext
723
714
  }
724
715
 
725
716
  /**
726
- * @deprecated There is no replacement for this, its functionality is no longer needed at this layer.
727
- * It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
728
- *
729
- * Similar capability is exposed with from/to string paths instead of handles via @see addedGCOutboundRoute
730
- *
731
- * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
732
- * all references added in the system.
733
- * @param srcHandle - The handle of the node that added the reference.
734
- * @param outboundHandle - The handle of the outbound node that is referenced.
735
- */
736
- public addedGCOutboundReference(
737
- srcHandle: IFluidHandleInternal,
738
- outboundHandle: IFluidHandleInternal,
739
- ): void {
740
- // By default, skip this call since the ContainerRuntime will detect the outbound route directly.
741
- if (this.mc.config.getBoolean(detectOutboundRoutesViaDDSKey) === true) {
742
- // Note: The ContainerRuntime code will check this same setting to avoid double counting.
743
- this.parentContext.addedGCOutboundReference?.(
744
- toFluidHandleInternal(srcHandle),
745
- toFluidHandleInternal(outboundHandle),
746
- );
747
- }
748
- }
749
-
750
- /**
751
- * (Same as @see addedGCOutboundReference, but with string paths instead of handles)
752
- *
753
717
  * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
754
718
  * all references added in the system.
755
719
  *
@@ -757,10 +721,7 @@ export abstract class FluidDataStoreContext
757
721
  * @param toPath - The absolute path of the outbound node that is referenced.
758
722
  */
759
723
  public addedGCOutboundRoute(fromPath: string, toPath: string) {
760
- this.parentContext.addedGCOutboundReference?.(
761
- { absolutePath: fromPath },
762
- { absolutePath: toPath },
763
- );
724
+ this.parentContext.addedGCOutboundRoute(fromPath, toPath);
764
725
  }
765
726
 
766
727
  /**
@@ -927,18 +888,16 @@ export abstract class FluidDataStoreContext
927
888
  }
928
889
 
929
890
  /**
930
- * Get the data required when attaching this context's DataStore.
891
+ * Get the summary required when attaching this context's DataStore.
931
892
  * Used for both Container Attach and DataStore Attach.
932
- *
933
- * @returns the summary, type, and GC Data for this context's DataStore.
934
893
  */
935
- public abstract getAttachData(
936
- includeGCData: boolean,
937
- telemetryContext?: ITelemetryContext,
938
- ): {
939
- attachSummary: ISummaryTreeWithStats;
940
- type: string;
941
- };
894
+ public abstract getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
895
+
896
+ /**
897
+ * Get the GC Data for the initial state being attached so remote clients can learn of this DataStore's
898
+ * outbound routes.
899
+ */
900
+ public abstract getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;
942
901
 
943
902
  public abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
944
903
 
@@ -1198,12 +1157,16 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
1198
1157
  }
1199
1158
 
1200
1159
  /**
1201
- * @see FluidDataStoreContext.getAttachData
1160
+ * @see FluidDataStoreContext.getAttachSummary
1202
1161
  */
1203
- public getAttachData(includeGCData: boolean): {
1204
- attachSummary: ISummaryTreeWithStats;
1205
- type: string;
1206
- } {
1162
+ public getAttachSummary(): ISummaryTreeWithStats {
1163
+ throw new Error("Cannot attach remote store");
1164
+ }
1165
+
1166
+ /**
1167
+ * @see FluidDataStoreContext.getAttachGCData
1168
+ */
1169
+ public getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {
1207
1170
  throw new Error("Cannot attach remote store");
1208
1171
  }
1209
1172
  }
@@ -1279,15 +1242,9 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
1279
1242
  }
1280
1243
 
1281
1244
  /**
1282
- * @see FluidDataStoreContext.getAttachData
1245
+ * @see FluidDataStoreContext.getAttachSummary
1283
1246
  */
1284
- public getAttachData(
1285
- includeGCData: boolean,
1286
- telemetryContext?: ITelemetryContext,
1287
- ): {
1288
- attachSummary: ISummaryTreeWithStats;
1289
- type: string;
1290
- } {
1247
+ public getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {
1291
1248
  assert(
1292
1249
  this.channel !== undefined,
1293
1250
  0x14f /* "There should be a channel when generating attach message" */,
@@ -1305,22 +1262,24 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
1305
1262
  // Add data store's attributes to the summary.
1306
1263
  const attributes = createAttributes(this.pkg, this.isInMemoryRoot());
1307
1264
  addBlobToSummary(attachSummary, dataStoreAttributesBlobName, JSON.stringify(attributes));
1308
- if (includeGCData) {
1309
- const gcData = this.channel.getAttachGCData?.(telemetryContext);
1310
- if (gcData !== undefined) {
1311
- addBlobToSummary(attachSummary, gcDataBlobKey, JSON.stringify(gcData));
1312
- }
1313
- }
1314
1265
 
1315
1266
  // Add loadingGroupId to the summary
1316
1267
  if (this.loadingGroupId !== undefined) {
1317
1268
  attachSummary.summary.groupId = this.loadingGroupId;
1318
1269
  }
1319
1270
 
1320
- return {
1321
- attachSummary,
1322
- type: this.pkg[this.pkg.length - 1],
1323
- };
1271
+ return attachSummary;
1272
+ }
1273
+
1274
+ /**
1275
+ * @see FluidDataStoreContext.getAttachGCData
1276
+ */
1277
+ public getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {
1278
+ assert(
1279
+ this.channel !== undefined,
1280
+ "There should be a channel when generating attach GC data",
1281
+ );
1282
+ return this.channel.getAttachGCData(telemetryContext);
1324
1283
  }
1325
1284
 
1326
1285
  private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
@@ -13,15 +13,13 @@ import type {
13
13
  ReadOnlyInfo,
14
14
  } from "@fluidframework/container-definitions/internal";
15
15
  import type { IErrorBase } from "@fluidframework/core-interfaces";
16
- import {
17
- IClientDetails,
18
- ISequencedDocumentMessage,
19
- ISignalMessage,
20
- } from "@fluidframework/driver-definitions";
16
+ import { IClientDetails } from "@fluidframework/driver-definitions";
21
17
  import type { IAnyDriverError } from "@fluidframework/driver-definitions/internal";
22
18
  import {
23
19
  IClientConfiguration,
24
20
  IDocumentMessage,
21
+ ISequencedDocumentMessage,
22
+ ISignalMessage,
25
23
  } from "@fluidframework/driver-definitions/internal";
26
24
 
27
25
  import type { PendingStateManager } from "./pendingStateManager.js";
@@ -5,8 +5,10 @@
5
5
 
6
6
  import { performance } from "@fluid-internal/client-utils";
7
7
  import { IDeltaManager } from "@fluidframework/container-definitions/internal";
8
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
9
- import { IDocumentMessage } from "@fluidframework/driver-definitions/internal";
8
+ import {
9
+ IDocumentMessage,
10
+ ISequencedDocumentMessage,
11
+ } from "@fluidframework/driver-definitions/internal";
10
12
  import { ITelemetryLoggerExt, formatTick } from "@fluidframework/telemetry-utils/internal";
11
13
 
12
14
  /**
@@ -517,8 +517,6 @@ export class GarbageCollector implements IGarbageCollector {
517
517
  /** Pre-GC steps */
518
518
  // Ensure that state has been initialized from the base snapshot data.
519
519
  await this.initializeGCStateFromBaseSnapshotP;
520
- // Let the runtime update its pending state before GC runs.
521
- await this.runtime.updateStateBeforeGC();
522
520
 
523
521
  /** GC step */
524
522
  const gcStats = await this.runGC(fullGC, currentReferenceTimestampMs, logger);
@@ -77,8 +77,6 @@ export const throwOnTombstoneUsageKey = "Fluid.GarbageCollection.ThrowOnTombston
77
77
  export const gcVersionUpgradeToV4Key = "Fluid.GarbageCollection.GCVersionUpgradeToV4";
78
78
  /** Config key to disable GC sweep for datastores. They'll merely be Tombstoned. */
79
79
  export const disableDatastoreSweepKey = "Fluid.GarbageCollection.DisableDataStoreSweep";
80
- /** Config key to revert new paradigm of detecting outbound routes in ContainerRuntime layer (use true) */
81
- export const detectOutboundRoutesViaDDSKey = "Fluid.GarbageCollection.DetectOutboundRoutesViaDDS";
82
80
  /** Config key to disable auto-recovery mechanism that protects Tombstones that are loaded from being swept (use true) */
83
81
  export const disableAutoRecoveryKey = "Fluid.GarbageCollection.DisableAutoRecovery";
84
82
 
@@ -300,8 +298,6 @@ export type GarbageCollectionMessage = ISweepMessage | ITombstoneLoadedMessage;
300
298
  * Defines the APIs for the runtime object to be passed to the garbage collector.
301
299
  */
302
300
  export interface IGarbageCollectionRuntime {
303
- /** Before GC runs, called to notify the runtime to update any pending GC state. */
304
- updateStateBeforeGC(): Promise<void>;
305
301
  /** Returns the garbage collection data of the runtime. */
306
302
  getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
307
303
  /** After GC has run, called to notify the runtime of routes that are used in it. */
package/src/gc/index.ts CHANGED
@@ -35,7 +35,6 @@ export {
35
35
  stableGCVersion,
36
36
  disableAutoRecoveryKey,
37
37
  disableDatastoreSweepKey,
38
- detectOutboundRoutesViaDDSKey,
39
38
  UnreferencedState,
40
39
  throwOnTombstoneLoadOverrideKey,
41
40
  GarbageCollectionMessage,
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
6
+ import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
7
7
  import type { IdCreationRange } from "@fluidframework/id-compressor/internal";
8
8
  import {
9
9
  IAttachMessage,
@@ -6,7 +6,7 @@
6
6
  import { IsoBuffer, Uint8ArrayToString } from "@fluid-internal/client-utils";
7
7
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
8
8
  import { assert } from "@fluidframework/core-utils/internal";
9
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
9
+ import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
10
10
  import { createChildLogger } from "@fluidframework/telemetry-utils/internal";
11
11
  import { decompress } from "lz4js";
12
12
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
7
  import { assert } from "@fluidframework/core-utils/internal";
8
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
8
+ import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
9
9
  import { createChildLogger } from "@fluidframework/telemetry-utils/internal";
10
10
 
11
11
  import { IBatch, type BatchMessage } from "./definitions.js";
@@ -6,7 +6,7 @@
6
6
  import { IBatchMessage } from "@fluidframework/container-definitions/internal";
7
7
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
8
8
  import { assert } from "@fluidframework/core-utils/internal";
9
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
9
+ import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
10
10
  import {
11
11
  DataCorruptionError,
12
12
  createChildLogger,
@@ -3,8 +3,10 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
7
- import { MessageType } from "@fluidframework/driver-definitions/internal";
6
+ import {
7
+ MessageType,
8
+ ISequencedDocumentMessage,
9
+ } from "@fluidframework/driver-definitions/internal";
8
10
 
9
11
  import {
10
12
  ContainerMessageType,
@@ -3,8 +3,10 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
7
- import { ISequencedDocumentSystemMessage } from "@fluidframework/driver-definitions/internal";
6
+ import {
7
+ ISequencedDocumentSystemMessage,
8
+ ISequencedDocumentMessage,
9
+ } from "@fluidframework/driver-definitions/internal";
8
10
 
9
11
  export const opSize = (op: ISequencedDocumentMessage): number => {
10
12
  // Some messages may already have string contents,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.0.0-dev-rc.5.0.0.268409";
9
+ export const pkgVersion = "2.0.0-dev-rc.5.0.0.270987";
@@ -6,7 +6,7 @@
6
6
  import { ICriticalContainerError } from "@fluidframework/container-definitions";
7
7
  import { IDisposable } from "@fluidframework/core-interfaces";
8
8
  import { assert, Lazy } from "@fluidframework/core-utils/internal";
9
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
9
+ import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
10
10
  import {
11
11
  ITelemetryLoggerExt,
12
12
  DataProcessingError,
@@ -75,6 +75,13 @@ function buildPendingMessageContent(
75
75
  return JSON.stringify({ type, contents, compatDetails });
76
76
  }
77
77
 
78
+ function withoutLocalOpMetadata(message: IPendingMessage): IPendingMessage {
79
+ return {
80
+ ...message,
81
+ localOpMetadata: undefined,
82
+ };
83
+ }
84
+
78
85
  /**
79
86
  * PendingStateManager is responsible for maintaining the messages that have not been sent or have not yet been
80
87
  * acknowledged by the server. It also maintains the batch information for both automatically and manually flushed
@@ -138,6 +145,9 @@ export class PendingStateManager implements IDisposable {
138
145
  this.initialMessages.isEmpty(),
139
146
  0x2e9 /* "Must call getLocalState() after applying initial states" */,
140
147
  );
148
+ // Using snapshot sequence number to filter ops older than our latest snapshot.
149
+ // Such ops should not be declared in pending/stashed state. Snapshot seq num will not
150
+ // be available when the container is not attached. Therefore, no filtering is needed.
141
151
  const newSavedOps = [...this.savedOps].filter((message) => {
142
152
  assert(
143
153
  message.sequenceNumber !== undefined,
@@ -154,9 +164,10 @@ export class PendingStateManager implements IDisposable {
154
164
  }
155
165
  });
156
166
  return {
157
- pendingStates: [...newSavedOps, ...this.pendingMessages.toArray()].map((message) => {
158
- return { ...message, localOpMetadata: undefined };
159
- }),
167
+ pendingStates: [
168
+ ...newSavedOps,
169
+ ...this.pendingMessages.toArray().map(withoutLocalOpMetadata),
170
+ ],
160
171
  };
161
172
  }
162
173
 
@@ -251,7 +262,7 @@ export class PendingStateManager implements IDisposable {
251
262
  0x169 /* "No pending message found for this remote message" */,
252
263
  );
253
264
  pendingMessage.sequenceNumber = message.sequenceNumber;
254
- this.savedOps.push(pendingMessage);
265
+ this.savedOps.push(withoutLocalOpMetadata(pendingMessage));
255
266
 
256
267
  this.pendingMessages.shift();
257
268
 
@@ -7,8 +7,10 @@ import type { EventEmitter } from "@fluid-internal/client-utils";
7
7
  import { performance } from "@fluid-internal/client-utils";
8
8
  import { IDeltaManager } from "@fluidframework/container-definitions/internal";
9
9
  import { assert } from "@fluidframework/core-utils/internal";
10
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
11
- import { IDocumentMessage } from "@fluidframework/driver-definitions/internal";
10
+ import {
11
+ IDocumentMessage,
12
+ ISequencedDocumentMessage,
13
+ } from "@fluidframework/driver-definitions/internal";
12
14
  import { isRuntimeMessage } from "@fluidframework/driver-utils/internal";
13
15
  import {
14
16
  ITelemetryLoggerExt,
@@ -6,8 +6,11 @@
6
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
7
  import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
8
8
  import { assert, Deferred, PromiseTimer, delay } from "@fluidframework/core-utils/internal";
9
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
10
- import { DriverErrorTypes, MessageType } from "@fluidframework/driver-definitions/internal";
9
+ import {
10
+ DriverErrorTypes,
11
+ MessageType,
12
+ ISequencedDocumentMessage,
13
+ } from "@fluidframework/driver-definitions/internal";
11
14
  import {
12
15
  MonitoringContext,
13
16
  UsageError,
@@ -5,8 +5,11 @@
5
5
 
6
6
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
7
  import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
8
- import { ISequencedDocumentMessage, SummaryType } from "@fluidframework/driver-definitions";
9
- import { ISnapshotTree } from "@fluidframework/driver-definitions/internal";
8
+ import { SummaryType } from "@fluidframework/driver-definitions";
9
+ import {
10
+ ISnapshotTree,
11
+ ISequencedDocumentMessage,
12
+ } from "@fluidframework/driver-definitions/internal";
10
13
  import {
11
14
  IExperimentalIncrementalSummaryContext,
12
15
  ITelemetryContext,
@@ -10,8 +10,11 @@ import {
10
10
  ITelemetryBaseProperties,
11
11
  ITelemetryBaseLogger,
12
12
  } from "@fluidframework/core-interfaces";
13
- import { ISequencedDocumentMessage, ISummaryTree } from "@fluidframework/driver-definitions";
14
- import { IDocumentMessage } from "@fluidframework/driver-definitions/internal";
13
+ import { ISummaryTree } from "@fluidframework/driver-definitions";
14
+ import {
15
+ IDocumentMessage,
16
+ ISequencedDocumentMessage,
17
+ } from "@fluidframework/driver-definitions/internal";
15
18
  import { ISummaryStats } from "@fluidframework/runtime-definitions/internal";
16
19
  import {
17
20
  ITelemetryLoggerExt,
@@ -7,13 +7,13 @@ import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
7
  import { IDeltaManager } from "@fluidframework/container-definitions/internal";
8
8
  import { IDisposable, IEvent } from "@fluidframework/core-interfaces";
9
9
  import { assert, Deferred } from "@fluidframework/core-utils/internal";
10
- import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
11
10
  import {
12
11
  IDocumentMessage,
13
12
  ISummaryAck,
14
13
  ISummaryContent,
15
14
  ISummaryNack,
16
15
  MessageType,
16
+ ISequencedDocumentMessage,
17
17
  } from "@fluidframework/driver-definitions/internal";
18
18
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
19
19
 
@@ -4,10 +4,11 @@
4
4
  */
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
- import { ISequencedDocumentMessage, SummaryType } from "@fluidframework/driver-definitions";
7
+ import { SummaryType } from "@fluidframework/driver-definitions";
8
8
  import {
9
9
  IDocumentStorageService,
10
10
  ISnapshotTree,
11
+ ISequencedDocumentMessage,
11
12
  } from "@fluidframework/driver-definitions/internal";
12
13
  import {
13
14
  blobHeadersBlobName as blobNameForBlobHeaders,
package/tsconfig.json CHANGED
@@ -5,5 +5,7 @@
5
5
  "compilerOptions": {
6
6
  "rootDir": "./src",
7
7
  "outDir": "./lib",
8
+ "noUncheckedIndexedAccess": false,
9
+ "exactOptionalPropertyTypes": false,
8
10
  },
9
11
  }