@fluidframework/container-runtime 2.0.0-internal.7.2.2 → 2.0.0-internal.7.4.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 (302) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -2
  3. package/api-extractor-lint.json +13 -0
  4. package/api-extractor.json +9 -1
  5. package/api-report/container-runtime.api.md +124 -107
  6. package/dist/batchTracker.d.ts +1 -0
  7. package/dist/batchTracker.d.ts.map +1 -1
  8. package/dist/blobManager.d.ts +4 -4
  9. package/dist/blobManager.d.ts.map +1 -1
  10. package/dist/blobManager.js.map +1 -1
  11. package/dist/connectionTelemetry.js +1 -1
  12. package/dist/connectionTelemetry.js.map +1 -1
  13. package/dist/container-runtime-alpha.d.ts +1473 -0
  14. package/dist/container-runtime-beta.d.ts +300 -0
  15. package/dist/container-runtime-public.d.ts +300 -0
  16. package/dist/container-runtime-untrimmed.d.ts +1836 -0
  17. package/dist/containerRuntime.d.ts +34 -40
  18. package/dist/containerRuntime.d.ts.map +1 -1
  19. package/dist/containerRuntime.js +79 -67
  20. package/dist/containerRuntime.js.map +1 -1
  21. package/dist/dataStoreRegistry.d.ts +1 -1
  22. package/dist/dataStoreRegistry.js +1 -1
  23. package/dist/dataStoreRegistry.js.map +1 -1
  24. package/dist/dataStores.d.ts +10 -15
  25. package/dist/dataStores.d.ts.map +1 -1
  26. package/dist/dataStores.js +77 -40
  27. package/dist/dataStores.js.map +1 -1
  28. package/dist/gc/garbageCollection.d.ts +41 -13
  29. package/dist/gc/garbageCollection.d.ts.map +1 -1
  30. package/dist/gc/garbageCollection.js +215 -78
  31. package/dist/gc/garbageCollection.js.map +1 -1
  32. package/dist/gc/gcConfigs.d.ts.map +1 -1
  33. package/dist/gc/gcConfigs.js +34 -37
  34. package/dist/gc/gcConfigs.js.map +1 -1
  35. package/dist/gc/gcDefinitions.d.ts +121 -46
  36. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  37. package/dist/gc/gcDefinitions.js +26 -18
  38. package/dist/gc/gcDefinitions.js.map +1 -1
  39. package/dist/gc/gcHelpers.d.ts +18 -25
  40. package/dist/gc/gcHelpers.d.ts.map +1 -1
  41. package/dist/gc/gcHelpers.js +29 -45
  42. package/dist/gc/gcHelpers.js.map +1 -1
  43. package/dist/gc/gcTelemetry.d.ts +0 -5
  44. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  45. package/dist/gc/gcTelemetry.js +14 -42
  46. package/dist/gc/gcTelemetry.js.map +1 -1
  47. package/dist/gc/gcUnreferencedStateTracker.d.ts +11 -5
  48. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  49. package/dist/gc/gcUnreferencedStateTracker.js +43 -19
  50. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  51. package/dist/gc/index.d.ts +1 -1
  52. package/dist/gc/index.d.ts.map +1 -1
  53. package/dist/gc/index.js +4 -5
  54. package/dist/gc/index.js.map +1 -1
  55. package/dist/index.d.ts +14 -2
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +16 -5
  58. package/dist/index.js.map +1 -1
  59. package/dist/messageTypes.d.ts +16 -11
  60. package/dist/messageTypes.d.ts.map +1 -1
  61. package/dist/messageTypes.js +6 -1
  62. package/dist/messageTypes.js.map +1 -1
  63. package/dist/metadata.d.ts +6 -0
  64. package/dist/metadata.d.ts.map +1 -1
  65. package/dist/metadata.js.map +1 -1
  66. package/dist/opLifecycle/definitions.d.ts +1 -1
  67. package/dist/opLifecycle/definitions.js.map +1 -1
  68. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  69. package/dist/opLifecycle/opGroupingManager.js +10 -1
  70. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  71. package/dist/opLifecycle/outbox.d.ts +2 -0
  72. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  73. package/dist/opLifecycle/outbox.js +21 -0
  74. package/dist/opLifecycle/outbox.js.map +1 -1
  75. package/dist/packageVersion.d.ts +1 -1
  76. package/dist/packageVersion.js +1 -1
  77. package/dist/packageVersion.js.map +1 -1
  78. package/dist/pendingStateManager.d.ts +1 -1
  79. package/dist/pendingStateManager.d.ts.map +1 -1
  80. package/dist/pendingStateManager.js +2 -11
  81. package/dist/pendingStateManager.js.map +1 -1
  82. package/dist/scheduleManager.d.ts +1 -0
  83. package/dist/scheduleManager.d.ts.map +1 -1
  84. package/dist/summary/orderedClientElection.d.ts +1 -1
  85. package/dist/summary/orderedClientElection.js.map +1 -1
  86. package/dist/summary/runWhileConnectedCoordinator.d.ts +2 -2
  87. package/dist/summary/runWhileConnectedCoordinator.js +1 -1
  88. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  89. package/dist/summary/summarizer.d.ts +1 -1
  90. package/dist/summary/summarizer.js +1 -1
  91. package/dist/summary/summarizer.js.map +1 -1
  92. package/dist/summary/summarizerTypes.d.ts +30 -30
  93. package/dist/summary/summarizerTypes.js.map +1 -1
  94. package/dist/summary/summaryCollection.d.ts +10 -10
  95. package/dist/summary/summaryCollection.js +1 -1
  96. package/dist/summary/summaryCollection.js.map +1 -1
  97. package/dist/summary/summaryFormat.d.ts +3 -3
  98. package/dist/summary/summaryFormat.js.map +1 -1
  99. package/dist/tsdoc-metadata.json +1 -1
  100. package/lib/batchTracker.d.ts +1 -0
  101. package/lib/batchTracker.d.ts.map +1 -1
  102. package/lib/blobManager.d.ts +4 -4
  103. package/lib/blobManager.d.ts.map +1 -1
  104. package/lib/blobManager.js.map +1 -1
  105. package/lib/connectionTelemetry.js +1 -1
  106. package/lib/connectionTelemetry.js.map +1 -1
  107. package/lib/container-runtime-alpha.d.ts +1473 -0
  108. package/lib/container-runtime-beta.d.ts +300 -0
  109. package/lib/container-runtime-public.d.ts +300 -0
  110. package/lib/container-runtime-untrimmed.d.ts +1836 -0
  111. package/lib/containerRuntime.d.ts +34 -40
  112. package/lib/containerRuntime.d.ts.map +1 -1
  113. package/lib/containerRuntime.js +81 -69
  114. package/lib/containerRuntime.js.map +1 -1
  115. package/lib/dataStoreRegistry.d.ts +1 -1
  116. package/lib/dataStoreRegistry.js +1 -1
  117. package/lib/dataStoreRegistry.js.map +1 -1
  118. package/lib/dataStores.d.ts +10 -15
  119. package/lib/dataStores.d.ts.map +1 -1
  120. package/lib/dataStores.js +80 -43
  121. package/lib/dataStores.js.map +1 -1
  122. package/lib/gc/garbageCollection.d.ts +41 -13
  123. package/lib/gc/garbageCollection.d.ts.map +1 -1
  124. package/lib/gc/garbageCollection.js +217 -80
  125. package/lib/gc/garbageCollection.js.map +1 -1
  126. package/lib/gc/gcConfigs.d.ts.map +1 -1
  127. package/lib/gc/gcConfigs.js +37 -40
  128. package/lib/gc/gcConfigs.js.map +1 -1
  129. package/lib/gc/gcDefinitions.d.ts +121 -46
  130. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  131. package/lib/gc/gcDefinitions.js +25 -17
  132. package/lib/gc/gcDefinitions.js.map +1 -1
  133. package/lib/gc/gcHelpers.d.ts +18 -25
  134. package/lib/gc/gcHelpers.d.ts.map +1 -1
  135. package/lib/gc/gcHelpers.js +27 -43
  136. package/lib/gc/gcHelpers.js.map +1 -1
  137. package/lib/gc/gcTelemetry.d.ts +0 -5
  138. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  139. package/lib/gc/gcTelemetry.js +15 -43
  140. package/lib/gc/gcTelemetry.js.map +1 -1
  141. package/lib/gc/gcUnreferencedStateTracker.d.ts +11 -5
  142. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  143. package/lib/gc/gcUnreferencedStateTracker.js +43 -19
  144. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  145. package/lib/gc/index.d.ts +1 -1
  146. package/lib/gc/index.d.ts.map +1 -1
  147. package/lib/gc/index.js +1 -1
  148. package/lib/gc/index.js.map +1 -1
  149. package/lib/index.d.ts +14 -2
  150. package/lib/index.d.ts.map +1 -1
  151. package/lib/index.js +15 -1
  152. package/lib/index.js.map +1 -1
  153. package/lib/messageTypes.d.ts +16 -11
  154. package/lib/messageTypes.d.ts.map +1 -1
  155. package/lib/messageTypes.js +6 -1
  156. package/lib/messageTypes.js.map +1 -1
  157. package/lib/metadata.d.ts +6 -0
  158. package/lib/metadata.d.ts.map +1 -1
  159. package/lib/metadata.js.map +1 -1
  160. package/lib/opLifecycle/definitions.d.ts +1 -1
  161. package/lib/opLifecycle/definitions.js.map +1 -1
  162. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  163. package/lib/opLifecycle/opGroupingManager.js +10 -1
  164. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  165. package/lib/opLifecycle/outbox.d.ts +2 -0
  166. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  167. package/lib/opLifecycle/outbox.js +21 -0
  168. package/lib/opLifecycle/outbox.js.map +1 -1
  169. package/lib/packageVersion.d.ts +1 -1
  170. package/lib/packageVersion.js +1 -1
  171. package/lib/packageVersion.js.map +1 -1
  172. package/lib/pendingStateManager.d.ts +1 -1
  173. package/lib/pendingStateManager.d.ts.map +1 -1
  174. package/lib/pendingStateManager.js +2 -11
  175. package/lib/pendingStateManager.js.map +1 -1
  176. package/lib/scheduleManager.d.ts +1 -0
  177. package/lib/scheduleManager.d.ts.map +1 -1
  178. package/lib/summary/orderedClientElection.d.ts +1 -1
  179. package/lib/summary/orderedClientElection.js.map +1 -1
  180. package/lib/summary/runWhileConnectedCoordinator.d.ts +2 -2
  181. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  182. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  183. package/lib/summary/summarizer.d.ts +1 -1
  184. package/lib/summary/summarizer.js +1 -1
  185. package/lib/summary/summarizer.js.map +1 -1
  186. package/lib/summary/summarizerTypes.d.ts +30 -30
  187. package/lib/summary/summarizerTypes.js.map +1 -1
  188. package/lib/summary/summaryCollection.d.ts +10 -10
  189. package/lib/summary/summaryCollection.js +1 -1
  190. package/lib/summary/summaryCollection.js.map +1 -1
  191. package/lib/summary/summaryFormat.d.ts +3 -3
  192. package/lib/summary/summaryFormat.js.map +1 -1
  193. package/package.json +56 -29
  194. package/src/blobManager.ts +5 -5
  195. package/src/connectionTelemetry.ts +1 -1
  196. package/src/containerRuntime.ts +113 -90
  197. package/src/dataStoreRegistry.ts +1 -1
  198. package/src/dataStores.ts +140 -69
  199. package/src/gc/garbageCollection.md +14 -15
  200. package/src/gc/garbageCollection.ts +256 -96
  201. package/src/gc/gcConfigs.ts +50 -52
  202. package/src/gc/gcDefinitions.ts +137 -52
  203. package/src/gc/gcHelpers.ts +31 -52
  204. package/src/gc/gcTelemetry.ts +16 -57
  205. package/src/gc/gcUnreferencedStateTracker.ts +61 -22
  206. package/src/gc/index.ts +6 -4
  207. package/src/index.ts +19 -1
  208. package/src/messageTypes.ts +21 -11
  209. package/src/metadata.ts +7 -0
  210. package/src/opLifecycle/definitions.ts +1 -1
  211. package/src/opLifecycle/opGroupingManager.ts +10 -1
  212. package/src/opLifecycle/outbox.ts +34 -0
  213. package/src/packageVersion.ts +1 -1
  214. package/src/pendingStateManager.ts +3 -13
  215. package/src/summary/orderedClientElection.ts +1 -1
  216. package/src/summary/runWhileConnectedCoordinator.ts +2 -2
  217. package/src/summary/summarizer.ts +1 -1
  218. package/src/summary/summarizerTypes.ts +30 -30
  219. package/src/summary/summaryCollection.ts +10 -10
  220. package/src/summary/summaryFormat.ts +3 -3
  221. package/dist/id-compressor/appendOnlySortedMap.d.ts +0 -124
  222. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
  223. package/dist/id-compressor/appendOnlySortedMap.js +0 -318
  224. package/dist/id-compressor/appendOnlySortedMap.js.map +0 -1
  225. package/dist/id-compressor/finalSpace.d.ts +0 -29
  226. package/dist/id-compressor/finalSpace.d.ts.map +0 -1
  227. package/dist/id-compressor/finalSpace.js +0 -62
  228. package/dist/id-compressor/finalSpace.js.map +0 -1
  229. package/dist/id-compressor/idCompressor.d.ts +0 -54
  230. package/dist/id-compressor/idCompressor.d.ts.map +0 -1
  231. package/dist/id-compressor/idCompressor.js +0 -495
  232. package/dist/id-compressor/idCompressor.js.map +0 -1
  233. package/dist/id-compressor/identifiers.d.ts +0 -32
  234. package/dist/id-compressor/identifiers.d.ts.map +0 -1
  235. package/dist/id-compressor/identifiers.js +0 -15
  236. package/dist/id-compressor/identifiers.js.map +0 -1
  237. package/dist/id-compressor/index.d.ts +0 -13
  238. package/dist/id-compressor/index.d.ts.map +0 -1
  239. package/dist/id-compressor/index.js +0 -32
  240. package/dist/id-compressor/index.js.map +0 -1
  241. package/dist/id-compressor/persistanceUtilities.d.ts +0 -22
  242. package/dist/id-compressor/persistanceUtilities.d.ts.map +0 -1
  243. package/dist/id-compressor/persistanceUtilities.js +0 -43
  244. package/dist/id-compressor/persistanceUtilities.js.map +0 -1
  245. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
  246. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
  247. package/dist/id-compressor/sessionSpaceNormalizer.js +0 -80
  248. package/dist/id-compressor/sessionSpaceNormalizer.js.map +0 -1
  249. package/dist/id-compressor/sessions.d.ts +0 -115
  250. package/dist/id-compressor/sessions.d.ts.map +0 -1
  251. package/dist/id-compressor/sessions.js +0 -305
  252. package/dist/id-compressor/sessions.js.map +0 -1
  253. package/dist/id-compressor/utilities.d.ts +0 -52
  254. package/dist/id-compressor/utilities.d.ts.map +0 -1
  255. package/dist/id-compressor/utilities.js +0 -169
  256. package/dist/id-compressor/utilities.js.map +0 -1
  257. package/lib/id-compressor/appendOnlySortedMap.d.ts +0 -124
  258. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
  259. package/lib/id-compressor/appendOnlySortedMap.js +0 -314
  260. package/lib/id-compressor/appendOnlySortedMap.js.map +0 -1
  261. package/lib/id-compressor/finalSpace.d.ts +0 -29
  262. package/lib/id-compressor/finalSpace.d.ts.map +0 -1
  263. package/lib/id-compressor/finalSpace.js +0 -58
  264. package/lib/id-compressor/finalSpace.js.map +0 -1
  265. package/lib/id-compressor/idCompressor.d.ts +0 -54
  266. package/lib/id-compressor/idCompressor.d.ts.map +0 -1
  267. package/lib/id-compressor/idCompressor.js +0 -491
  268. package/lib/id-compressor/idCompressor.js.map +0 -1
  269. package/lib/id-compressor/identifiers.d.ts +0 -32
  270. package/lib/id-compressor/identifiers.d.ts.map +0 -1
  271. package/lib/id-compressor/identifiers.js +0 -11
  272. package/lib/id-compressor/identifiers.js.map +0 -1
  273. package/lib/id-compressor/index.d.ts +0 -13
  274. package/lib/id-compressor/index.d.ts.map +0 -1
  275. package/lib/id-compressor/index.js +0 -13
  276. package/lib/id-compressor/index.js.map +0 -1
  277. package/lib/id-compressor/persistanceUtilities.d.ts +0 -22
  278. package/lib/id-compressor/persistanceUtilities.d.ts.map +0 -1
  279. package/lib/id-compressor/persistanceUtilities.js +0 -34
  280. package/lib/id-compressor/persistanceUtilities.js.map +0 -1
  281. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
  282. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
  283. package/lib/id-compressor/sessionSpaceNormalizer.js +0 -76
  284. package/lib/id-compressor/sessionSpaceNormalizer.js.map +0 -1
  285. package/lib/id-compressor/sessions.d.ts +0 -115
  286. package/lib/id-compressor/sessions.d.ts.map +0 -1
  287. package/lib/id-compressor/sessions.js +0 -290
  288. package/lib/id-compressor/sessions.js.map +0 -1
  289. package/lib/id-compressor/utilities.d.ts +0 -52
  290. package/lib/id-compressor/utilities.d.ts.map +0 -1
  291. package/lib/id-compressor/utilities.js +0 -151
  292. package/lib/id-compressor/utilities.js.map +0 -1
  293. package/src/id-compressor/README.md +0 -3
  294. package/src/id-compressor/appendOnlySortedMap.ts +0 -366
  295. package/src/id-compressor/finalSpace.ts +0 -67
  296. package/src/id-compressor/idCompressor.ts +0 -630
  297. package/src/id-compressor/identifiers.ts +0 -42
  298. package/src/id-compressor/index.ts +0 -26
  299. package/src/id-compressor/persistanceUtilities.ts +0 -58
  300. package/src/id-compressor/sessionSpaceNormalizer.ts +0 -83
  301. package/src/id-compressor/sessions.ts +0 -405
  302. package/src/id-compressor/utilities.ts +0 -190
@@ -62,14 +62,8 @@ function compatBehaviorAllowsMessageType(_unknownContainerRuntimeMessageType, co
62
62
  // undefined defaults to same behavior as "FailToProcess"
63
63
  return compatBehavior === "Ignore";
64
64
  }
65
- function prepareLocalContainerRuntimeIdAllocationMessageForTransit(message) {
66
- // Remove the stashedState from the op if it's a stashed op
67
- if ("stashedState" in message.contents) {
68
- delete message.contents.stashedState;
69
- }
70
- }
71
65
  /**
72
- * @public
66
+ * @internal
73
67
  */
74
68
  exports.DefaultSummaryConfiguration = {
75
69
  state: "enabled",
@@ -87,7 +81,7 @@ exports.DefaultSummaryConfiguration = {
87
81
  };
88
82
  /**
89
83
  * Accepted header keys for requests coming to the runtime.
90
- * @public
84
+ * @internal
91
85
  */
92
86
  var RuntimeHeaders;
93
87
  (function (RuntimeHeaders) {
@@ -97,22 +91,22 @@ var RuntimeHeaders;
97
91
  RuntimeHeaders["viaHandle"] = "viaHandle";
98
92
  })(RuntimeHeaders || (exports.RuntimeHeaders = RuntimeHeaders = {}));
99
93
  /** True if a tombstoned object should be returned without erroring
100
- * @public
94
+ * @internal
101
95
  */
102
96
  exports.AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
103
97
  /**
104
98
  * [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
105
- * @public
99
+ * @internal
106
100
  */
107
101
  exports.AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
108
102
  /**
109
103
  * Tombstone error responses will have this header set to true
110
- * @public
104
+ * @internal
111
105
  */
112
106
  exports.TombstoneResponseHeaderKey = "isTombstoned";
113
107
  /**
114
108
  * Inactive error responses will have this header set to true
115
- * @public
109
+ * @internal
116
110
  */
117
111
  exports.InactiveResponseHeaderKey = "isInactive";
118
112
  /** Default values for Runtime Headers */
@@ -124,7 +118,7 @@ exports.defaultRuntimeHeaderData = {
124
118
  };
125
119
  /**
126
120
  * Available compression algorithms for op compression.
127
- * @public
121
+ * @alpha
128
122
  */
129
123
  var CompressionAlgorithms;
130
124
  (function (CompressionAlgorithms) {
@@ -155,7 +149,7 @@ exports.defaultPendingOpsRetryDelayMs = 1000;
155
149
  const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
156
150
  /**
157
151
  * @deprecated use ContainerRuntimeMessageType instead
158
- * @public
152
+ * @internal
159
153
  */
160
154
  var RuntimeMessage;
161
155
  (function (RuntimeMessage) {
@@ -169,7 +163,7 @@ var RuntimeMessage;
169
163
  })(RuntimeMessage || (exports.RuntimeMessage = RuntimeMessage = {}));
170
164
  /**
171
165
  * @deprecated please use version in driver-utils
172
- * @public
166
+ * @internal
173
167
  */
174
168
  function isRuntimeMessage(message) {
175
169
  return Object.values(RuntimeMessage).includes(message.type);
@@ -179,7 +173,7 @@ exports.isRuntimeMessage = isRuntimeMessage;
179
173
  * Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
180
174
  * special-case for document dirty state. Ultimately we should have no special-cases from the
181
175
  * ContainerRuntime's perspective.
182
- * @public
176
+ * @internal
183
177
  */
184
178
  exports.agentSchedulerId = "_scheduler";
185
179
  // safely check navigator and get the hardware spec value
@@ -258,7 +252,7 @@ exports.TEST_requestSummarizer = TEST_requestSummarizer;
258
252
  /**
259
253
  * Represents the runtime of the container. Contains helper functions/state of the container.
260
254
  * It will define the store level mappings.
261
- * @public
255
+ * @alpha
262
256
  */
263
257
  class ContainerRuntime extends client_utils_1.TypedEventEmitter {
264
258
  /**
@@ -375,11 +369,17 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
375
369
  const idCompressorEnabled = metadata?.idCompressorEnabled ?? runtimeOptions.enableRuntimeIdCompressor ?? false;
376
370
  let idCompressor;
377
371
  if (idCompressorEnabled) {
378
- const { IdCompressor, createSessionId } = await Promise.resolve().then(() => __importStar(require("./id-compressor")));
379
- idCompressor =
380
- serializedIdCompressor !== undefined
381
- ? IdCompressor.deserialize(serializedIdCompressor, createSessionId())
382
- : IdCompressor.create(logger);
372
+ const { createIdCompressor, deserializeIdCompressor, createSessionId } = await Promise.resolve().then(() => __importStar(require("@fluidframework/id-compressor")));
373
+ const pendingLocalState = context.pendingLocalState;
374
+ if (pendingLocalState?.pendingIdCompressorState !== undefined) {
375
+ idCompressor = deserializeIdCompressor(pendingLocalState.pendingIdCompressorState);
376
+ }
377
+ else if (serializedIdCompressor !== undefined) {
378
+ idCompressor = deserializeIdCompressor(serializedIdCompressor, createSessionId());
379
+ }
380
+ else {
381
+ idCompressor = createIdCompressor(logger);
382
+ }
383
383
  }
384
384
  const runtime = new containerRuntimeCtor(context, registry, metadata, electedSummarizerData, chunks ?? [], aliases ?? [], {
385
385
  summaryOptions,
@@ -481,9 +481,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
481
481
  get gcThrowOnTombstoneUsage() {
482
482
  return this.garbageCollector.throwOnTombstoneUsage;
483
483
  }
484
- /**
485
- * @internal
486
- */
484
+ /***/
487
485
  constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, idCompressor, provideEntryPoint, requestHandler, summaryConfiguration = {
488
486
  // the defaults
489
487
  ...exports.DefaultSummaryConfiguration,
@@ -498,6 +496,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
498
496
  this._storage = _storage;
499
497
  this.requestHandler = requestHandler;
500
498
  this.summaryConfiguration = summaryConfiguration;
499
+ this.imminentClosure = false;
501
500
  this.defaultMaxConsecutiveReconnects = 7;
502
501
  this._orderSequentiallyCalls = 0;
503
502
  this.flushTaskExists = false;
@@ -589,7 +588,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
589
588
  eventName: "GCFeatureMatrix",
590
589
  metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
591
590
  inputs: JSON.stringify({
592
- gcOptions_gcTombstoneGeneration: this.runtimeOptions.gcOptions[gc_1.gcTombstoneGenerationOptionName],
591
+ gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gc_1.gcGenerationOptionName],
593
592
  }),
594
593
  });
595
594
  this.telemetryDocumentId = metadata?.telemetryDocumentId ?? (0, uuid_1.v4)();
@@ -655,6 +654,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
655
654
  // GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
656
655
  // delta manager would always return false for summarizer client.
657
656
  activeConnection: () => this.innerDeltaManager.active,
657
+ submitMessage: (message) => this.submit(message),
658
658
  });
659
659
  const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
660
660
  this.summarizerNode = (0, summary_1.createRootSummarizerNodeWithGC)((0, telemetry_utils_1.createChildLogger)({ logger: this.logger, namespace: "SummarizerNode" }),
@@ -1078,19 +1078,6 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1078
1078
  // Officially transition from the old state to the new state.
1079
1079
  this.updateDocumentDirtyState(newState);
1080
1080
  }
1081
- /**
1082
- * Updates the runtime's IdCompressor with the stashed state present in the given op. This is a bit of a
1083
- * hack and is unnecessarily expensive. As it stands, every locally stashed op (all ops that get stored in
1084
- * the PendingStateManager) will store their serialized representation locally until ack'd. Upon receiving
1085
- * this stashed state, the IdCompressor blindly deserializes to the stashed state and assumes the session.
1086
- * Technically only the last stashed state is needed to do this correctly, but we would have to write some
1087
- * more hacky code to modify the batch before it gets sent out.
1088
- * @param content - An IdAllocationOp with "stashedState", which is a representation of un-ack'd local state.
1089
- */
1090
- async applyStashedIdAllocationOp(op) {
1091
- const { IdCompressor } = await Promise.resolve().then(() => __importStar(require("./id-compressor")));
1092
- this.idCompressor = IdCompressor.deserialize(op.stashedState);
1093
- }
1094
1081
  /**
1095
1082
  * Parse an op's type and actual content from given serialized content
1096
1083
  * ! Note: this format needs to be in-line with what is set in the "ContainerRuntime.submit(...)" method
@@ -1112,7 +1099,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1112
1099
  return this.dataStores.applyStashedAttachOp(opContents.contents);
1113
1100
  case messageTypes_1.ContainerMessageType.IdAllocation:
1114
1101
  (0, core_utils_1.assert)(this.idCompressor !== undefined, 0x67b /* IdCompressor should be defined if enabled */);
1115
- return this.applyStashedIdAllocationOp(opContents.contents);
1102
+ return;
1116
1103
  case messageTypes_1.ContainerMessageType.Alias:
1117
1104
  case messageTypes_1.ContainerMessageType.BlobAttach:
1118
1105
  return;
@@ -1120,6 +1107,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1120
1107
  throw new Error("chunkedOp not expected here");
1121
1108
  case messageTypes_1.ContainerMessageType.Rejoin:
1122
1109
  throw new Error("rejoin not expected here");
1110
+ case messageTypes_1.ContainerMessageType.GC:
1111
+ // GC op is only sent in summarizer which should never have stashed ops.
1112
+ throw new telemetry_utils_1.LoggingError("GC op not expected to be stashed in summarizer");
1123
1113
  default: {
1124
1114
  // This should be extremely rare for stashed ops.
1125
1115
  // It would require a newer runtime stashing ops and then an older one applying them,
@@ -1298,7 +1288,14 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1298
1288
  break;
1299
1289
  case messageTypes_1.ContainerMessageType.IdAllocation:
1300
1290
  (0, core_utils_1.assert)(this.idCompressor !== undefined, 0x67c /* IdCompressor should be defined if enabled */);
1301
- this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
1291
+ // Don't re-finalize the range if we're processing a "savedOp" in
1292
+ // stashed ops flow. The compressor is stashed with these ops already processed.
1293
+ if (messageWithContext.message.metadata?.savedOp !== true) {
1294
+ this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
1295
+ }
1296
+ break;
1297
+ case messageTypes_1.ContainerMessageType.GC:
1298
+ this.garbageCollector.processMessage(messageWithContext.message, local);
1302
1299
  break;
1303
1300
  case messageTypes_1.ContainerMessageType.ChunkedOp:
1304
1301
  case messageTypes_1.ContainerMessageType.Rejoin:
@@ -1489,7 +1486,6 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1489
1486
  }
1490
1487
  /**
1491
1488
  * @deprecated 0.16 Issue #1537, #3631
1492
- * @internal
1493
1489
  */
1494
1490
  async _createDataStoreWithProps(pkg, props, id = (0, uuid_1.v4)()) {
1495
1491
  return (0, dataStore_1.channelToDataStore)(await this.dataStores
@@ -1499,7 +1495,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1499
1495
  canSendOps() {
1500
1496
  // Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
1501
1497
  // container runtime's ability to send ops depend on the actual readonly state of the delta manager.
1502
- return this.connected && !this.innerDeltaManager.readOnlyInfo.readonly;
1498
+ return (this.connected && !this.innerDeltaManager.readOnlyInfo.readonly && !this.imminentClosure);
1503
1499
  }
1504
1500
  /**
1505
1501
  * Are we in the middle of batching ops together?
@@ -1521,19 +1517,28 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1521
1517
  return this.dirtyContainer;
1522
1518
  }
1523
1519
  isContainerMessageDirtyable({ type, contents }) {
1524
- // For legacy purposes, exclude the old built-in AgentScheduler from dirty consideration as a special-case.
1525
- // Ultimately we should have no special-cases from the ContainerRuntime's perspective.
1526
- if (type === messageTypes_1.ContainerMessageType.Attach) {
1527
- const attachMessage = contents;
1528
- if (attachMessage.id === exports.agentSchedulerId) {
1529
- return false;
1520
+ // Certain container runtime messages should not mark the container dirty such as the old built-in
1521
+ // AgentScheduler and Garbage collector messages.
1522
+ switch (type) {
1523
+ case messageTypes_1.ContainerMessageType.Attach: {
1524
+ const attachMessage = contents;
1525
+ if (attachMessage.id === exports.agentSchedulerId) {
1526
+ return false;
1527
+ }
1528
+ break;
1530
1529
  }
1531
- }
1532
- else if (type === messageTypes_1.ContainerMessageType.FluidDataStoreOp) {
1533
- const envelope = contents;
1534
- if (envelope.address === exports.agentSchedulerId) {
1530
+ case messageTypes_1.ContainerMessageType.FluidDataStoreOp: {
1531
+ const envelope = contents;
1532
+ if (envelope.address === exports.agentSchedulerId) {
1533
+ return false;
1534
+ }
1535
+ break;
1536
+ }
1537
+ case messageTypes_1.ContainerMessageType.GC: {
1535
1538
  return false;
1536
1539
  }
1540
+ default:
1541
+ break;
1537
1542
  }
1538
1543
  return true;
1539
1544
  }
@@ -1824,10 +1829,10 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1824
1829
  properties: { all: { safeSummary: true } },
1825
1830
  }));
1826
1831
  }
1827
- // If there are pending (unacked ops), the summary will not be eventual consistent and it may even be
1828
- // incorrect. So, wait for the container to be saved with a timeout. If the container is not saved
1829
- // within the timeout, check if it should be failed or can continue.
1830
- if (this.validateSummaryBeforeUpload && this.hasPendingMessages()) {
1832
+ // If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
1833
+ // and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
1834
+ // saved within the timeout, check if it should be failed or can continue.
1835
+ if (this.validateSummaryBeforeUpload && this.isDirty) {
1831
1836
  const countBefore = this.pendingMessagesCount;
1832
1837
  // The timeout for waiting for pending ops can be overridden via configurations.
1833
1838
  const pendingOpsTimeout = this.mc.config.getNumber("Fluid.Summarizer.waitForPendingOpsTimeoutMs") ??
@@ -1847,7 +1852,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1847
1852
  // happens, whether we attempted to wait for these ops to be acked and what was the result.
1848
1853
  summaryNumberLogger.sendTelemetryEvent({
1849
1854
  eventName: "PendingOpsWhileSummarizing",
1850
- saved: this.hasPendingMessages() ? false : true,
1855
+ saved: !this.isDirty,
1851
1856
  timeout: pendingOpsTimeout,
1852
1857
  countBefore,
1853
1858
  countAfter: this.pendingMessagesCount,
@@ -2072,7 +2077,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2072
2077
  }
2073
2078
  }
2074
2079
  /**
2075
- * This helper is called during summarization. If there are pending ops, it will return a failed summarize result
2080
+ * This helper is called during summarization. If the container is dirty, it will return a failed summarize result
2076
2081
  * (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
2077
2082
  * @param logger - The logger to be used for sending telemetry.
2078
2083
  * @param referenceSequenceNumber - The reference sequence number of the summary attempt.
@@ -2082,7 +2087,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2082
2087
  * @returns failed summarize result (IBaseSummarizeResult) if summary should be failed, undefined otherwise.
2083
2088
  */
2084
2089
  async shouldFailSummaryOnPendingOps(logger, referenceSequenceNumber, minimumSequenceNumber, finalAttempt, beforeSummaryGeneration) {
2085
- if (!this.hasPendingMessages()) {
2090
+ if (!this.isDirty) {
2086
2091
  return;
2087
2092
  }
2088
2093
  // If "SkipFailingIncorrectSummary" option is true, don't fail the summary in the last attempt.
@@ -2174,12 +2179,12 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2174
2179
  contents: JSON.stringify(idAllocationMessage),
2175
2180
  referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
2176
2181
  metadata: undefined,
2177
- localOpMetadata: this.idCompressor?.serialize(true),
2182
+ localOpMetadata: undefined,
2178
2183
  type: messageTypes_1.ContainerMessageType.IdAllocation,
2179
2184
  };
2180
2185
  }
2181
2186
  if (idAllocationBatchMessage !== undefined) {
2182
- this.outbox.submit(idAllocationBatchMessage);
2187
+ this.outbox.submitIdAllocation(idAllocationBatchMessage);
2183
2188
  }
2184
2189
  }
2185
2190
  }
@@ -2352,6 +2357,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2352
2357
  /**
2353
2358
  * Finds the right store and asks it to resubmit the message. This typically happens when we
2354
2359
  * reconnect and there are pending messages.
2360
+ * ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
2355
2361
  * @param message - The original LocalContainerRuntimeMessage.
2356
2362
  * @param localOpMetadata - The local metadata associated with the original message.
2357
2363
  */
@@ -2364,10 +2370,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2364
2370
  break;
2365
2371
  case messageTypes_1.ContainerMessageType.Attach:
2366
2372
  case messageTypes_1.ContainerMessageType.Alias:
2367
- this.submit(message, localOpMetadata);
2368
- break;
2369
2373
  case messageTypes_1.ContainerMessageType.IdAllocation: {
2370
- prepareLocalContainerRuntimeIdAllocationMessageForTransit(message);
2371
2374
  this.submit(message, localOpMetadata);
2372
2375
  break;
2373
2376
  }
@@ -2379,6 +2382,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2379
2382
  case messageTypes_1.ContainerMessageType.Rejoin:
2380
2383
  this.submit(message);
2381
2384
  break;
2385
+ case messageTypes_1.ContainerMessageType.GC:
2386
+ // GC op is only sent in summarizer which should never reconnect.
2387
+ throw new telemetry_utils_1.LoggingError("GC op not expected to be resubmitted in summarizer");
2382
2388
  default: {
2383
2389
  // This case should be very rare - it would imply an op was stashed from a
2384
2390
  // future version of runtime code and now is being applied on an older version
@@ -2520,7 +2526,11 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2520
2526
  notifyImminentClosure: props?.notifyImminentClosure,
2521
2527
  }, async (event) => {
2522
2528
  this.verifyNotClosed();
2523
- const waitBlobsToAttach = props?.notifyImminentClosure;
2529
+ // in case imminentClosure is set to true by future code, we don't
2530
+ // try to change its value
2531
+ if (!this.imminentClosure) {
2532
+ this.imminentClosure = props?.notifyImminentClosure ?? this.imminentClosure;
2533
+ }
2524
2534
  const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
2525
2535
  if (this._orderSequentiallyCalls !== 0) {
2526
2536
  throw new telemetry_utils_1.UsageError("can't get state during orderSequentially");
@@ -2529,16 +2539,18 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2529
2539
  // getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
2530
2540
  // to close current batch.
2531
2541
  this.flush();
2532
- const pendingAttachmentBlobs = waitBlobsToAttach
2542
+ const pendingAttachmentBlobs = this.imminentClosure
2533
2543
  ? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
2534
2544
  : undefined;
2535
2545
  const pending = this.pendingStateManager.getLocalState();
2536
2546
  if (!pendingAttachmentBlobs && !this.hasPendingMessages()) {
2537
2547
  return; // no pending state to save
2538
2548
  }
2549
+ const pendingIdCompressorState = this.idCompressor?.serialize(true);
2539
2550
  const pendingState = {
2540
2551
  pending,
2541
2552
  pendingAttachmentBlobs,
2553
+ pendingIdCompressorState,
2542
2554
  };
2543
2555
  event.end({
2544
2556
  attachmentBlobsSize: Object.keys(pendingAttachmentBlobs ?? {}).length,