@fluidframework/container-runtime 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +9 -1
  4. package/api-report/container-runtime.api.md +123 -123
  5. package/dist/blobManager.d.ts +4 -4
  6. package/dist/blobManager.d.ts.map +1 -1
  7. package/dist/blobManager.js.map +1 -1
  8. package/dist/container-runtime-alpha.d.ts +1444 -0
  9. package/dist/container-runtime-beta.d.ts +292 -0
  10. package/dist/container-runtime-public.d.ts +292 -0
  11. package/dist/container-runtime-untrimmed.d.ts +1792 -0
  12. package/dist/containerRuntime.d.ts +36 -66
  13. package/dist/containerRuntime.d.ts.map +1 -1
  14. package/dist/containerRuntime.js +68 -104
  15. package/dist/containerRuntime.js.map +1 -1
  16. package/dist/dataStore.js +0 -12
  17. package/dist/dataStore.js.map +1 -1
  18. package/dist/dataStoreRegistry.d.ts +1 -1
  19. package/dist/dataStoreRegistry.js +1 -1
  20. package/dist/dataStoreRegistry.js.map +1 -1
  21. package/dist/dataStores.d.ts +10 -15
  22. package/dist/dataStores.d.ts.map +1 -1
  23. package/dist/dataStores.js +77 -40
  24. package/dist/dataStores.js.map +1 -1
  25. package/dist/gc/garbageCollection.d.ts +41 -13
  26. package/dist/gc/garbageCollection.d.ts.map +1 -1
  27. package/dist/gc/garbageCollection.js +215 -78
  28. package/dist/gc/garbageCollection.js.map +1 -1
  29. package/dist/gc/gcConfigs.d.ts.map +1 -1
  30. package/dist/gc/gcConfigs.js +34 -37
  31. package/dist/gc/gcConfigs.js.map +1 -1
  32. package/dist/gc/gcDefinitions.d.ts +121 -46
  33. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  34. package/dist/gc/gcDefinitions.js +26 -18
  35. package/dist/gc/gcDefinitions.js.map +1 -1
  36. package/dist/gc/gcHelpers.d.ts +18 -25
  37. package/dist/gc/gcHelpers.d.ts.map +1 -1
  38. package/dist/gc/gcHelpers.js +29 -45
  39. package/dist/gc/gcHelpers.js.map +1 -1
  40. package/dist/gc/gcTelemetry.d.ts +0 -5
  41. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  42. package/dist/gc/gcTelemetry.js +14 -42
  43. package/dist/gc/gcTelemetry.js.map +1 -1
  44. package/dist/gc/gcUnreferencedStateTracker.d.ts +11 -5
  45. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  46. package/dist/gc/gcUnreferencedStateTracker.js +43 -19
  47. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  48. package/dist/gc/index.d.ts +1 -1
  49. package/dist/gc/index.d.ts.map +1 -1
  50. package/dist/gc/index.js +4 -5
  51. package/dist/gc/index.js.map +1 -1
  52. package/dist/index.d.ts +15 -3
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +16 -6
  55. package/dist/index.js.map +1 -1
  56. package/dist/messageTypes.d.ts +15 -7
  57. package/dist/messageTypes.d.ts.map +1 -1
  58. package/dist/messageTypes.js +6 -1
  59. package/dist/messageTypes.js.map +1 -1
  60. package/dist/opLifecycle/definitions.d.ts +1 -1
  61. package/dist/opLifecycle/definitions.js.map +1 -1
  62. package/dist/packageVersion.d.ts +1 -1
  63. package/dist/packageVersion.js +1 -1
  64. package/dist/packageVersion.js.map +1 -1
  65. package/dist/pendingStateManager.d.ts +1 -0
  66. package/dist/pendingStateManager.d.ts.map +1 -1
  67. package/dist/pendingStateManager.js +1 -0
  68. package/dist/pendingStateManager.js.map +1 -1
  69. package/dist/summary/orderedClientElection.d.ts +1 -1
  70. package/dist/summary/orderedClientElection.js.map +1 -1
  71. package/dist/summary/runWhileConnectedCoordinator.d.ts +2 -2
  72. package/dist/summary/runWhileConnectedCoordinator.js +1 -1
  73. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  74. package/dist/summary/summarizer.d.ts +1 -13
  75. package/dist/summary/summarizer.d.ts.map +1 -1
  76. package/dist/summary/summarizer.js +1 -47
  77. package/dist/summary/summarizer.js.map +1 -1
  78. package/dist/summary/summarizerTypes.d.ts +30 -30
  79. package/dist/summary/summarizerTypes.js.map +1 -1
  80. package/dist/summary/summaryCollection.d.ts +10 -10
  81. package/dist/summary/summaryCollection.js +1 -1
  82. package/dist/summary/summaryCollection.js.map +1 -1
  83. package/dist/summary/summaryFormat.d.ts +3 -3
  84. package/dist/summary/summaryFormat.js.map +1 -1
  85. package/lib/blobManager.d.ts +4 -4
  86. package/lib/blobManager.d.ts.map +1 -1
  87. package/lib/blobManager.js.map +1 -1
  88. package/lib/container-runtime-alpha.d.ts +1444 -0
  89. package/lib/container-runtime-beta.d.ts +292 -0
  90. package/lib/container-runtime-public.d.ts +292 -0
  91. package/lib/container-runtime-untrimmed.d.ts +1792 -0
  92. package/lib/containerRuntime.d.ts +36 -66
  93. package/lib/containerRuntime.d.ts.map +1 -1
  94. package/lib/containerRuntime.js +69 -104
  95. package/lib/containerRuntime.js.map +1 -1
  96. package/lib/dataStore.js +0 -12
  97. package/lib/dataStore.js.map +1 -1
  98. package/lib/dataStoreRegistry.d.ts +1 -1
  99. package/lib/dataStoreRegistry.js +1 -1
  100. package/lib/dataStoreRegistry.js.map +1 -1
  101. package/lib/dataStores.d.ts +10 -15
  102. package/lib/dataStores.d.ts.map +1 -1
  103. package/lib/dataStores.js +80 -43
  104. package/lib/dataStores.js.map +1 -1
  105. package/lib/gc/garbageCollection.d.ts +41 -13
  106. package/lib/gc/garbageCollection.d.ts.map +1 -1
  107. package/lib/gc/garbageCollection.js +217 -80
  108. package/lib/gc/garbageCollection.js.map +1 -1
  109. package/lib/gc/gcConfigs.d.ts.map +1 -1
  110. package/lib/gc/gcConfigs.js +37 -40
  111. package/lib/gc/gcConfigs.js.map +1 -1
  112. package/lib/gc/gcDefinitions.d.ts +121 -46
  113. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  114. package/lib/gc/gcDefinitions.js +25 -17
  115. package/lib/gc/gcDefinitions.js.map +1 -1
  116. package/lib/gc/gcHelpers.d.ts +18 -25
  117. package/lib/gc/gcHelpers.d.ts.map +1 -1
  118. package/lib/gc/gcHelpers.js +27 -43
  119. package/lib/gc/gcHelpers.js.map +1 -1
  120. package/lib/gc/gcTelemetry.d.ts +0 -5
  121. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  122. package/lib/gc/gcTelemetry.js +15 -43
  123. package/lib/gc/gcTelemetry.js.map +1 -1
  124. package/lib/gc/gcUnreferencedStateTracker.d.ts +11 -5
  125. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  126. package/lib/gc/gcUnreferencedStateTracker.js +43 -19
  127. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  128. package/lib/gc/index.d.ts +1 -1
  129. package/lib/gc/index.d.ts.map +1 -1
  130. package/lib/gc/index.js +1 -1
  131. package/lib/gc/index.js.map +1 -1
  132. package/lib/index.d.ts +15 -3
  133. package/lib/index.d.ts.map +1 -1
  134. package/lib/index.js +16 -2
  135. package/lib/index.js.map +1 -1
  136. package/lib/messageTypes.d.ts +15 -7
  137. package/lib/messageTypes.d.ts.map +1 -1
  138. package/lib/messageTypes.js +6 -1
  139. package/lib/messageTypes.js.map +1 -1
  140. package/lib/opLifecycle/definitions.d.ts +1 -1
  141. package/lib/opLifecycle/definitions.js.map +1 -1
  142. package/lib/packageVersion.d.ts +1 -1
  143. package/lib/packageVersion.js +1 -1
  144. package/lib/packageVersion.js.map +1 -1
  145. package/lib/pendingStateManager.d.ts +1 -0
  146. package/lib/pendingStateManager.d.ts.map +1 -1
  147. package/lib/pendingStateManager.js +1 -0
  148. package/lib/pendingStateManager.js.map +1 -1
  149. package/lib/summary/orderedClientElection.d.ts +1 -1
  150. package/lib/summary/orderedClientElection.js.map +1 -1
  151. package/lib/summary/runWhileConnectedCoordinator.d.ts +2 -2
  152. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  153. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  154. package/lib/summary/summarizer.d.ts +1 -13
  155. package/lib/summary/summarizer.d.ts.map +1 -1
  156. package/lib/summary/summarizer.js +1 -47
  157. package/lib/summary/summarizer.js.map +1 -1
  158. package/lib/summary/summarizerTypes.d.ts +30 -30
  159. package/lib/summary/summarizerTypes.js.map +1 -1
  160. package/lib/summary/summaryCollection.d.ts +10 -10
  161. package/lib/summary/summaryCollection.js +1 -1
  162. package/lib/summary/summaryCollection.js.map +1 -1
  163. package/lib/summary/summaryFormat.d.ts +3 -3
  164. package/lib/summary/summaryFormat.js.map +1 -1
  165. package/package.json +46 -19
  166. package/src/blobManager.ts +5 -5
  167. package/src/containerRuntime.ts +93 -141
  168. package/src/dataStore.ts +1 -15
  169. package/src/dataStoreRegistry.ts +1 -1
  170. package/src/dataStores.ts +140 -69
  171. package/src/gc/garbageCollection.md +14 -15
  172. package/src/gc/garbageCollection.ts +256 -96
  173. package/src/gc/gcConfigs.ts +50 -52
  174. package/src/gc/gcDefinitions.ts +137 -52
  175. package/src/gc/gcHelpers.ts +31 -52
  176. package/src/gc/gcTelemetry.ts +16 -57
  177. package/src/gc/gcUnreferencedStateTracker.ts +61 -22
  178. package/src/gc/index.ts +6 -4
  179. package/src/index.ts +19 -2
  180. package/src/messageTypes.ts +19 -4
  181. package/src/opLifecycle/definitions.ts +1 -1
  182. package/src/packageVersion.ts +1 -1
  183. package/src/pendingStateManager.ts +1 -0
  184. package/src/summary/orderedClientElection.ts +1 -1
  185. package/src/summary/runWhileConnectedCoordinator.ts +2 -2
  186. package/src/summary/summarizer.ts +2 -51
  187. package/src/summary/summarizerTypes.ts +30 -30
  188. package/src/summary/summaryCollection.ts +10 -10
  189. package/src/summary/summaryFormat.ts +3 -3
  190. package/dist/id-compressor/appendOnlySortedMap.d.ts +0 -124
  191. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
  192. package/dist/id-compressor/appendOnlySortedMap.js +0 -318
  193. package/dist/id-compressor/appendOnlySortedMap.js.map +0 -1
  194. package/dist/id-compressor/finalSpace.d.ts +0 -29
  195. package/dist/id-compressor/finalSpace.d.ts.map +0 -1
  196. package/dist/id-compressor/finalSpace.js +0 -62
  197. package/dist/id-compressor/finalSpace.js.map +0 -1
  198. package/dist/id-compressor/idCompressor.d.ts +0 -54
  199. package/dist/id-compressor/idCompressor.d.ts.map +0 -1
  200. package/dist/id-compressor/idCompressor.js +0 -495
  201. package/dist/id-compressor/idCompressor.js.map +0 -1
  202. package/dist/id-compressor/identifiers.d.ts +0 -32
  203. package/dist/id-compressor/identifiers.d.ts.map +0 -1
  204. package/dist/id-compressor/identifiers.js +0 -15
  205. package/dist/id-compressor/identifiers.js.map +0 -1
  206. package/dist/id-compressor/index.d.ts +0 -13
  207. package/dist/id-compressor/index.d.ts.map +0 -1
  208. package/dist/id-compressor/index.js +0 -32
  209. package/dist/id-compressor/index.js.map +0 -1
  210. package/dist/id-compressor/persistanceUtilities.d.ts +0 -22
  211. package/dist/id-compressor/persistanceUtilities.d.ts.map +0 -1
  212. package/dist/id-compressor/persistanceUtilities.js +0 -43
  213. package/dist/id-compressor/persistanceUtilities.js.map +0 -1
  214. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
  215. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
  216. package/dist/id-compressor/sessionSpaceNormalizer.js +0 -80
  217. package/dist/id-compressor/sessionSpaceNormalizer.js.map +0 -1
  218. package/dist/id-compressor/sessions.d.ts +0 -115
  219. package/dist/id-compressor/sessions.d.ts.map +0 -1
  220. package/dist/id-compressor/sessions.js +0 -305
  221. package/dist/id-compressor/sessions.js.map +0 -1
  222. package/dist/id-compressor/utilities.d.ts +0 -52
  223. package/dist/id-compressor/utilities.d.ts.map +0 -1
  224. package/dist/id-compressor/utilities.js +0 -169
  225. package/dist/id-compressor/utilities.js.map +0 -1
  226. package/lib/id-compressor/appendOnlySortedMap.d.ts +0 -124
  227. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
  228. package/lib/id-compressor/appendOnlySortedMap.js +0 -314
  229. package/lib/id-compressor/appendOnlySortedMap.js.map +0 -1
  230. package/lib/id-compressor/finalSpace.d.ts +0 -29
  231. package/lib/id-compressor/finalSpace.d.ts.map +0 -1
  232. package/lib/id-compressor/finalSpace.js +0 -58
  233. package/lib/id-compressor/finalSpace.js.map +0 -1
  234. package/lib/id-compressor/idCompressor.d.ts +0 -54
  235. package/lib/id-compressor/idCompressor.d.ts.map +0 -1
  236. package/lib/id-compressor/idCompressor.js +0 -491
  237. package/lib/id-compressor/idCompressor.js.map +0 -1
  238. package/lib/id-compressor/identifiers.d.ts +0 -32
  239. package/lib/id-compressor/identifiers.d.ts.map +0 -1
  240. package/lib/id-compressor/identifiers.js +0 -11
  241. package/lib/id-compressor/identifiers.js.map +0 -1
  242. package/lib/id-compressor/index.d.ts +0 -13
  243. package/lib/id-compressor/index.d.ts.map +0 -1
  244. package/lib/id-compressor/index.js +0 -13
  245. package/lib/id-compressor/index.js.map +0 -1
  246. package/lib/id-compressor/persistanceUtilities.d.ts +0 -22
  247. package/lib/id-compressor/persistanceUtilities.d.ts.map +0 -1
  248. package/lib/id-compressor/persistanceUtilities.js +0 -34
  249. package/lib/id-compressor/persistanceUtilities.js.map +0 -1
  250. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
  251. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
  252. package/lib/id-compressor/sessionSpaceNormalizer.js +0 -76
  253. package/lib/id-compressor/sessionSpaceNormalizer.js.map +0 -1
  254. package/lib/id-compressor/sessions.d.ts +0 -115
  255. package/lib/id-compressor/sessions.d.ts.map +0 -1
  256. package/lib/id-compressor/sessions.js +0 -290
  257. package/lib/id-compressor/sessions.js.map +0 -1
  258. package/lib/id-compressor/utilities.d.ts +0 -52
  259. package/lib/id-compressor/utilities.d.ts.map +0 -1
  260. package/lib/id-compressor/utilities.js +0 -151
  261. package/lib/id-compressor/utilities.js.map +0 -1
  262. package/src/id-compressor/README.md +0 -3
  263. package/src/id-compressor/appendOnlySortedMap.ts +0 -366
  264. package/src/id-compressor/finalSpace.ts +0 -67
  265. package/src/id-compressor/idCompressor.ts +0 -630
  266. package/src/id-compressor/identifiers.ts +0 -42
  267. package/src/id-compressor/index.ts +0 -26
  268. package/src/id-compressor/persistanceUtilities.ts +0 -58
  269. package/src/id-compressor/sessionSpaceNormalizer.ts +0 -83
  270. package/src/id-compressor/sessions.ts +0 -405
  271. package/src/id-compressor/utilities.ts +0 -190
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ContainerRuntime = exports.TEST_requestSummarizer = exports.makeLegacySendBatchFn = exports.getDeviceSpec = exports.agentSchedulerId = exports.isRuntimeMessage = exports.RuntimeMessage = exports.defaultPendingOpsRetryDelayMs = exports.defaultPendingOpsWaitTimeoutMs = exports.CompressionAlgorithms = exports.defaultRuntimeHeaderData = exports.InactiveResponseHeaderKey = exports.TombstoneResponseHeaderKey = exports.AllowInactiveRequestHeaderKey = exports.AllowTombstoneRequestHeaderKey = exports.RuntimeHeaders = exports.DefaultSummaryConfiguration = void 0;
26
+ exports.ContainerRuntime = exports.makeLegacySendBatchFn = exports.getDeviceSpec = exports.agentSchedulerId = exports.isRuntimeMessage = exports.RuntimeMessage = exports.defaultPendingOpsRetryDelayMs = exports.defaultPendingOpsWaitTimeoutMs = exports.CompressionAlgorithms = exports.defaultRuntimeHeaderData = exports.InactiveResponseHeaderKey = exports.TombstoneResponseHeaderKey = exports.AllowInactiveRequestHeaderKey = exports.AllowTombstoneRequestHeaderKey = exports.RuntimeHeaders = exports.DefaultSummaryConfiguration = void 0;
27
27
  const container_definitions_1 = require("@fluidframework/container-definitions");
28
28
  const core_utils_1 = require("@fluidframework/core-utils");
29
29
  const client_utils_1 = require("@fluid-internal/client-utils");
@@ -63,7 +63,7 @@ function compatBehaviorAllowsMessageType(_unknownContainerRuntimeMessageType, co
63
63
  return compatBehavior === "Ignore";
64
64
  }
65
65
  /**
66
- * @public
66
+ * @internal
67
67
  */
68
68
  exports.DefaultSummaryConfiguration = {
69
69
  state: "enabled",
@@ -81,7 +81,7 @@ exports.DefaultSummaryConfiguration = {
81
81
  };
82
82
  /**
83
83
  * Accepted header keys for requests coming to the runtime.
84
- * @public
84
+ * @internal
85
85
  */
86
86
  var RuntimeHeaders;
87
87
  (function (RuntimeHeaders) {
@@ -91,22 +91,22 @@ var RuntimeHeaders;
91
91
  RuntimeHeaders["viaHandle"] = "viaHandle";
92
92
  })(RuntimeHeaders || (exports.RuntimeHeaders = RuntimeHeaders = {}));
93
93
  /** True if a tombstoned object should be returned without erroring
94
- * @public
94
+ * @internal
95
95
  */
96
96
  exports.AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
97
97
  /**
98
98
  * [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
99
- * @public
99
+ * @internal
100
100
  */
101
101
  exports.AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
102
102
  /**
103
103
  * Tombstone error responses will have this header set to true
104
- * @public
104
+ * @internal
105
105
  */
106
106
  exports.TombstoneResponseHeaderKey = "isTombstoned";
107
107
  /**
108
108
  * Inactive error responses will have this header set to true
109
- * @public
109
+ * @internal
110
110
  */
111
111
  exports.InactiveResponseHeaderKey = "isInactive";
112
112
  /** Default values for Runtime Headers */
@@ -118,7 +118,7 @@ exports.defaultRuntimeHeaderData = {
118
118
  };
119
119
  /**
120
120
  * Available compression algorithms for op compression.
121
- * @public
121
+ * @alpha
122
122
  */
123
123
  var CompressionAlgorithms;
124
124
  (function (CompressionAlgorithms) {
@@ -149,7 +149,7 @@ exports.defaultPendingOpsRetryDelayMs = 1000;
149
149
  const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
150
150
  /**
151
151
  * @deprecated use ContainerRuntimeMessageType instead
152
- * @public
152
+ * @internal
153
153
  */
154
154
  var RuntimeMessage;
155
155
  (function (RuntimeMessage) {
@@ -163,7 +163,7 @@ var RuntimeMessage;
163
163
  })(RuntimeMessage || (exports.RuntimeMessage = RuntimeMessage = {}));
164
164
  /**
165
165
  * @deprecated please use version in driver-utils
166
- * @public
166
+ * @internal
167
167
  */
168
168
  function isRuntimeMessage(message) {
169
169
  return Object.values(RuntimeMessage).includes(message.type);
@@ -173,7 +173,7 @@ exports.isRuntimeMessage = isRuntimeMessage;
173
173
  * Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
174
174
  * special-case for document dirty state. Ultimately we should have no special-cases from the
175
175
  * ContainerRuntime's perspective.
176
- * @public
176
+ * @internal
177
177
  */
178
178
  exports.agentSchedulerId = "_scheduler";
179
179
  // safely check navigator and get the hardware spec value
@@ -230,7 +230,9 @@ async function createSummarizer(loader, url) {
230
230
  fluidObject = await resolvedContainer.getEntryPoint();
231
231
  }
232
232
  else {
233
- const response = await resolvedContainer.request({ url: `/${summarizerRequestUrl}` });
233
+ const response = await resolvedContainer.request({
234
+ url: `/${summarizerRequestUrl}`,
235
+ });
234
236
  if (response.status !== 200 || response.mimeType !== "fluid/object") {
235
237
  throw (0, runtime_utils_1.responseToException)(response, request);
236
238
  }
@@ -241,55 +243,12 @@ async function createSummarizer(loader, url) {
241
243
  }
242
244
  return fluidObject.ISummarizer;
243
245
  }
244
- /**
245
- * This function is not supported publicly and exists for e2e testing
246
- * @internal
247
- */
248
- async function TEST_requestSummarizer(loader, url) {
249
- return createSummarizer(loader, url);
250
- }
251
- exports.TEST_requestSummarizer = TEST_requestSummarizer;
252
246
  /**
253
247
  * Represents the runtime of the container. Contains helper functions/state of the container.
254
248
  * It will define the store level mappings.
255
- * @public
249
+ * @alpha
256
250
  */
257
251
  class ContainerRuntime extends client_utils_1.TypedEventEmitter {
258
- /**
259
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
260
- */
261
- get IFluidRouter() {
262
- return this;
263
- }
264
- /**
265
- * @deprecated use loadRuntime instead.
266
- * Load the stores from a snapshot and returns the runtime.
267
- * @param context - Context of the container.
268
- * @param registryEntries - Mapping to the stores.
269
- * @param requestHandler - Request handlers for the container runtime
270
- * @param runtimeOptions - Additional options to be passed to the runtime
271
- * @param existing - (optional) When loading from an existing snapshot. Precedes context.existing if provided
272
- * @param containerRuntimeCtor - (optional) Constructor to use to create the ContainerRuntime instance. This
273
- * allows mixin classes to leverage this method to define their own async initializer.
274
- */
275
- static async load(context, registryEntries, requestHandler, runtimeOptions = {}, containerScope = context.scope, existing, containerRuntimeCtor = ContainerRuntime) {
276
- let existingFlag = true;
277
- if (!existing) {
278
- existingFlag = false;
279
- }
280
- return this.loadRuntime({
281
- context,
282
- registryEntries,
283
- existing: existingFlag,
284
- runtimeOptions,
285
- containerScope,
286
- containerRuntimeCtor,
287
- requestHandler,
288
- provideEntryPoint: () => {
289
- throw new telemetry_utils_1.UsageError("ContainerRuntime.load is deprecated and should no longer be used");
290
- },
291
- });
292
- }
293
252
  /**
294
253
  * Load the stores from a snapshot and returns the runtime.
295
254
  * @param params - An object housing the runtime properties:
@@ -369,16 +328,16 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
369
328
  const idCompressorEnabled = metadata?.idCompressorEnabled ?? runtimeOptions.enableRuntimeIdCompressor ?? false;
370
329
  let idCompressor;
371
330
  if (idCompressorEnabled) {
372
- const { IdCompressor, createSessionId } = await Promise.resolve().then(() => __importStar(require("./id-compressor")));
331
+ const { createIdCompressor, deserializeIdCompressor, createSessionId } = await Promise.resolve().then(() => __importStar(require("@fluidframework/id-compressor")));
373
332
  const pendingLocalState = context.pendingLocalState;
374
333
  if (pendingLocalState?.pendingIdCompressorState !== undefined) {
375
- idCompressor = IdCompressor.deserialize(pendingLocalState.pendingIdCompressorState);
334
+ idCompressor = deserializeIdCompressor(pendingLocalState.pendingIdCompressorState);
376
335
  }
377
336
  else if (serializedIdCompressor !== undefined) {
378
- idCompressor = IdCompressor.deserialize(serializedIdCompressor, createSessionId());
337
+ idCompressor = deserializeIdCompressor(serializedIdCompressor, createSessionId());
379
338
  }
380
339
  else {
381
- idCompressor = IdCompressor.create(logger);
340
+ idCompressor = createIdCompressor(logger);
382
341
  }
383
342
  }
384
343
  const runtime = new containerRuntimeCtor(context, registry, metadata, electedSummarizerData, chunks ?? [], aliases ?? [], {
@@ -481,9 +440,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
481
440
  get gcThrowOnTombstoneUsage() {
482
441
  return this.garbageCollector.throwOnTombstoneUsage;
483
442
  }
484
- /**
485
- * @internal
486
- */
443
+ /***/
487
444
  constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, idCompressor, provideEntryPoint, requestHandler, summaryConfiguration = {
488
445
  // the defaults
489
446
  ...exports.DefaultSummaryConfiguration,
@@ -498,6 +455,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
498
455
  this._storage = _storage;
499
456
  this.requestHandler = requestHandler;
500
457
  this.summaryConfiguration = summaryConfiguration;
458
+ this.imminentClosure = false;
501
459
  this.defaultMaxConsecutiveReconnects = 7;
502
460
  this._orderSequentiallyCalls = 0;
503
461
  this.flushTaskExists = false;
@@ -589,7 +547,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
589
547
  eventName: "GCFeatureMatrix",
590
548
  metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
591
549
  inputs: JSON.stringify({
592
- gcOptions_gcTombstoneGeneration: this.runtimeOptions.gcOptions[gc_1.gcTombstoneGenerationOptionName],
550
+ gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gc_1.gcGenerationOptionName],
593
551
  }),
594
552
  });
595
553
  this.telemetryDocumentId = metadata?.telemetryDocumentId ?? (0, uuid_1.v4)();
@@ -655,6 +613,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
655
613
  // GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
656
614
  // delta manager would always return false for summarizer client.
657
615
  activeConnection: () => this.innerDeltaManager.active,
616
+ submitMessage: (message) => this.submit(message),
658
617
  });
659
618
  const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
660
619
  this.summarizerNode = (0, summary_1.createRootSummarizerNodeWithGC)((0, telemetry_utils_1.createChildLogger)({ logger: this.logger, namespace: "SummarizerNode" }),
@@ -862,8 +821,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
862
821
  /**
863
822
  * Notifies this object about the request made to the container.
864
823
  * @param request - Request made to the handler.
865
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
824
+ * @deprecated Will be removed in future major release. This method needs to stay private until LTS version of Loader moves to "2.0.0-internal.7.0.0".
866
825
  */
826
+ // @ts-expect-error expected to be used by LTS Loaders and Containers
867
827
  async request(request) {
868
828
  try {
869
829
  const parser = runtime_utils_1.RequestParser.create(request);
@@ -1107,6 +1067,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1107
1067
  throw new Error("chunkedOp not expected here");
1108
1068
  case messageTypes_1.ContainerMessageType.Rejoin:
1109
1069
  throw new Error("rejoin not expected here");
1070
+ case messageTypes_1.ContainerMessageType.GC:
1071
+ // GC op is only sent in summarizer which should never have stashed ops.
1072
+ throw new telemetry_utils_1.LoggingError("GC op not expected to be stashed in summarizer");
1110
1073
  default: {
1111
1074
  // This should be extremely rare for stashed ops.
1112
1075
  // It would require a newer runtime stashing ops and then an older one applying them,
@@ -1291,6 +1254,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1291
1254
  this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
1292
1255
  }
1293
1256
  break;
1257
+ case messageTypes_1.ContainerMessageType.GC:
1258
+ this.garbageCollector.processMessage(messageWithContext.message, local);
1259
+ break;
1294
1260
  case messageTypes_1.ContainerMessageType.ChunkedOp:
1295
1261
  case messageTypes_1.ContainerMessageType.Rejoin:
1296
1262
  break;
@@ -1374,23 +1340,6 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1374
1340
  }
1375
1341
  this.dataStores.processSignal(envelope.address, transformed, local);
1376
1342
  }
1377
- /**
1378
- * Returns the runtime of the data store.
1379
- * @param id - Id supplied during creating the data store.
1380
- * @param wait - True if you want to wait for it.
1381
- * @deprecated Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
1382
- */
1383
- // eslint-disable-next-line import/no-deprecated
1384
- async getRootDataStore(id, wait = true) {
1385
- return this.getRootDataStoreChannel(id, wait);
1386
- }
1387
- async getRootDataStoreChannel(id, wait = true) {
1388
- await this.dataStores.waitIfPendingAlias(id);
1389
- const internalId = this.internalId(id);
1390
- const context = await this.dataStores.getDataStore(internalId, { wait });
1391
- (0, core_utils_1.assert)(await context.isRoot(), 0x12b /* "did not get root data store" */);
1392
- return context.realize();
1393
- }
1394
1343
  /**
1395
1344
  * Flush the pending ops manually.
1396
1345
  * This method is expected to be called at the end of a batch.
@@ -1480,7 +1429,6 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1480
1429
  }
1481
1430
  /**
1482
1431
  * @deprecated 0.16 Issue #1537, #3631
1483
- * @internal
1484
1432
  */
1485
1433
  async _createDataStoreWithProps(pkg, props, id = (0, uuid_1.v4)()) {
1486
1434
  return (0, dataStore_1.channelToDataStore)(await this.dataStores
@@ -1490,7 +1438,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1490
1438
  canSendOps() {
1491
1439
  // Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
1492
1440
  // container runtime's ability to send ops depend on the actual readonly state of the delta manager.
1493
- return this.connected && !this.innerDeltaManager.readOnlyInfo.readonly;
1441
+ return (this.connected && !this.innerDeltaManager.readOnlyInfo.readonly && !this.imminentClosure);
1494
1442
  }
1495
1443
  /**
1496
1444
  * Are we in the middle of batching ops together?
@@ -1512,19 +1460,28 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1512
1460
  return this.dirtyContainer;
1513
1461
  }
1514
1462
  isContainerMessageDirtyable({ type, contents }) {
1515
- // For legacy purposes, exclude the old built-in AgentScheduler from dirty consideration as a special-case.
1516
- // Ultimately we should have no special-cases from the ContainerRuntime's perspective.
1517
- if (type === messageTypes_1.ContainerMessageType.Attach) {
1518
- const attachMessage = contents;
1519
- if (attachMessage.id === exports.agentSchedulerId) {
1520
- return false;
1463
+ // Certain container runtime messages should not mark the container dirty such as the old built-in
1464
+ // AgentScheduler and Garbage collector messages.
1465
+ switch (type) {
1466
+ case messageTypes_1.ContainerMessageType.Attach: {
1467
+ const attachMessage = contents;
1468
+ if (attachMessage.id === exports.agentSchedulerId) {
1469
+ return false;
1470
+ }
1471
+ break;
1521
1472
  }
1522
- }
1523
- else if (type === messageTypes_1.ContainerMessageType.FluidDataStoreOp) {
1524
- const envelope = contents;
1525
- if (envelope.address === exports.agentSchedulerId) {
1473
+ case messageTypes_1.ContainerMessageType.FluidDataStoreOp: {
1474
+ const envelope = contents;
1475
+ if (envelope.address === exports.agentSchedulerId) {
1476
+ return false;
1477
+ }
1478
+ break;
1479
+ }
1480
+ case messageTypes_1.ContainerMessageType.GC: {
1526
1481
  return false;
1527
1482
  }
1483
+ default:
1484
+ break;
1528
1485
  }
1529
1486
  return true;
1530
1487
  }
@@ -1815,10 +1772,10 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1815
1772
  properties: { all: { safeSummary: true } },
1816
1773
  }));
1817
1774
  }
1818
- // If there are pending (unacked ops), the summary will not be eventual consistent and it may even be
1819
- // incorrect. So, wait for the container to be saved with a timeout. If the container is not saved
1820
- // within the timeout, check if it should be failed or can continue.
1821
- if (this.validateSummaryBeforeUpload && this.hasPendingMessages()) {
1775
+ // If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
1776
+ // and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
1777
+ // saved within the timeout, check if it should be failed or can continue.
1778
+ if (this.validateSummaryBeforeUpload && this.isDirty) {
1822
1779
  const countBefore = this.pendingMessagesCount;
1823
1780
  // The timeout for waiting for pending ops can be overridden via configurations.
1824
1781
  const pendingOpsTimeout = this.mc.config.getNumber("Fluid.Summarizer.waitForPendingOpsTimeoutMs") ??
@@ -1838,7 +1795,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
1838
1795
  // happens, whether we attempted to wait for these ops to be acked and what was the result.
1839
1796
  summaryNumberLogger.sendTelemetryEvent({
1840
1797
  eventName: "PendingOpsWhileSummarizing",
1841
- saved: this.hasPendingMessages() ? false : true,
1798
+ saved: !this.isDirty,
1842
1799
  timeout: pendingOpsTimeout,
1843
1800
  countBefore,
1844
1801
  countAfter: this.pendingMessagesCount,
@@ -2063,7 +2020,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2063
2020
  }
2064
2021
  }
2065
2022
  /**
2066
- * This helper is called during summarization. If there are pending ops, it will return a failed summarize result
2023
+ * This helper is called during summarization. If the container is dirty, it will return a failed summarize result
2067
2024
  * (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
2068
2025
  * @param logger - The logger to be used for sending telemetry.
2069
2026
  * @param referenceSequenceNumber - The reference sequence number of the summary attempt.
@@ -2073,7 +2030,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2073
2030
  * @returns failed summarize result (IBaseSummarizeResult) if summary should be failed, undefined otherwise.
2074
2031
  */
2075
2032
  async shouldFailSummaryOnPendingOps(logger, referenceSequenceNumber, minimumSequenceNumber, finalAttempt, beforeSummaryGeneration) {
2076
- if (!this.hasPendingMessages()) {
2033
+ if (!this.isDirty) {
2077
2034
  return;
2078
2035
  }
2079
2036
  // If "SkipFailingIncorrectSummary" option is true, don't fail the summary in the last attempt.
@@ -2343,6 +2300,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2343
2300
  /**
2344
2301
  * Finds the right store and asks it to resubmit the message. This typically happens when we
2345
2302
  * reconnect and there are pending messages.
2303
+ * ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
2346
2304
  * @param message - The original LocalContainerRuntimeMessage.
2347
2305
  * @param localOpMetadata - The local metadata associated with the original message.
2348
2306
  */
@@ -2367,6 +2325,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2367
2325
  case messageTypes_1.ContainerMessageType.Rejoin:
2368
2326
  this.submit(message);
2369
2327
  break;
2328
+ case messageTypes_1.ContainerMessageType.GC:
2329
+ // GC op is only sent in summarizer which should never reconnect.
2330
+ throw new telemetry_utils_1.LoggingError("GC op not expected to be resubmitted in summarizer");
2370
2331
  default: {
2371
2332
  // This case should be very rare - it would imply an op was stashed from a
2372
2333
  // future version of runtime code and now is being applied on an older version
@@ -2501,14 +2462,17 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2501
2462
  };
2502
2463
  });
2503
2464
  }
2504
- notifyAttaching() { } // do nothing (deprecated method)
2505
2465
  async getPendingLocalState(props) {
2506
2466
  return telemetry_utils_1.PerformanceEvent.timedExecAsync(this.mc.logger, {
2507
2467
  eventName: "getPendingLocalState",
2508
2468
  notifyImminentClosure: props?.notifyImminentClosure,
2509
2469
  }, async (event) => {
2510
2470
  this.verifyNotClosed();
2511
- const waitBlobsToAttach = props?.notifyImminentClosure;
2471
+ // in case imminentClosure is set to true by future code, we don't
2472
+ // try to change its value
2473
+ if (!this.imminentClosure) {
2474
+ this.imminentClosure = props?.notifyImminentClosure ?? this.imminentClosure;
2475
+ }
2512
2476
  const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
2513
2477
  if (this._orderSequentiallyCalls !== 0) {
2514
2478
  throw new telemetry_utils_1.UsageError("can't get state during orderSequentially");
@@ -2517,7 +2481,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
2517
2481
  // getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
2518
2482
  // to close current batch.
2519
2483
  this.flush();
2520
- const pendingAttachmentBlobs = waitBlobsToAttach
2484
+ const pendingAttachmentBlobs = this.imminentClosure
2521
2485
  ? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
2522
2486
  : undefined;
2523
2487
  const pending = this.pendingStateManager.getLocalState();