@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
@@ -3,7 +3,7 @@ import { assert, delay, LazyPromise } from "@fluidframework/core-utils";
3
3
  import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils";
4
4
  import { createChildLogger, createChildMonitoringContext, DataCorruptionError, DataProcessingError, GenericError, raiseConnectedEvent, PerformanceEvent,
5
5
  // eslint-disable-next-line import/no-deprecated
6
- TaggedLoggerAdapter, wrapError, UsageError, } from "@fluidframework/telemetry-utils";
6
+ TaggedLoggerAdapter, wrapError, UsageError, LoggingError, } from "@fluidframework/telemetry-utils";
7
7
  import { DriverHeader, FetchSource, } from "@fluidframework/driver-definitions";
8
8
  import { readAndParse } from "@fluidframework/driver-utils";
9
9
  import { MessageType, SummaryType, } from "@fluidframework/protocol-definitions";
@@ -19,7 +19,7 @@ import { BlobManager } from "./blobManager";
19
19
  import { DataStores, getSummaryForDatastores } from "./dataStores";
20
20
  import { aliasBlobName, blobsTreeName, chunksBlobName, createRootSummarizerNodeWithGC, electedSummarizerBlobName, extractSummaryMetadataMessage, idCompressorBlobName, metadataBlobName, Summarizer, SummaryManager, wrapSummaryInChannelsTree, SummaryCollection, OrderedClientCollection, OrderedClientElection, SummarizerClientElection, summarizerClientType, RunWhileConnectedCoordinator, RetriableSummaryError, } from "./summary";
21
21
  import { formExponentialFn, Throttler } from "./throttler";
22
- import { GarbageCollector, GCNodeType, gcTombstoneGenerationOptionName, trimLeadingAndTrailingSlashes, } from "./gc";
22
+ import { GarbageCollector, GCNodeType, gcGenerationOptionName, trimLeadingAndTrailingSlashes, } from "./gc";
23
23
  import { channelToDataStore, isDataStoreAliasMessage } from "./dataStore";
24
24
  import { BindBatchTracker } from "./batchTracker";
25
25
  import { ScheduleManager } from "./scheduleManager";
@@ -39,7 +39,7 @@ function compatBehaviorAllowsMessageType(_unknownContainerRuntimeMessageType, co
39
39
  return compatBehavior === "Ignore";
40
40
  }
41
41
  /**
42
- * @public
42
+ * @internal
43
43
  */
44
44
  export const DefaultSummaryConfiguration = {
45
45
  state: "enabled",
@@ -57,7 +57,7 @@ export const DefaultSummaryConfiguration = {
57
57
  };
58
58
  /**
59
59
  * Accepted header keys for requests coming to the runtime.
60
- * @public
60
+ * @internal
61
61
  */
62
62
  export var RuntimeHeaders;
63
63
  (function (RuntimeHeaders) {
@@ -67,22 +67,22 @@ export var RuntimeHeaders;
67
67
  RuntimeHeaders["viaHandle"] = "viaHandle";
68
68
  })(RuntimeHeaders || (RuntimeHeaders = {}));
69
69
  /** True if a tombstoned object should be returned without erroring
70
- * @public
70
+ * @internal
71
71
  */
72
72
  export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
73
73
  /**
74
74
  * [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
75
- * @public
75
+ * @internal
76
76
  */
77
77
  export const AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
78
78
  /**
79
79
  * Tombstone error responses will have this header set to true
80
- * @public
80
+ * @internal
81
81
  */
82
82
  export const TombstoneResponseHeaderKey = "isTombstoned";
83
83
  /**
84
84
  * Inactive error responses will have this header set to true
85
- * @public
85
+ * @internal
86
86
  */
87
87
  export const InactiveResponseHeaderKey = "isInactive";
88
88
  /** Default values for Runtime Headers */
@@ -94,7 +94,7 @@ export const defaultRuntimeHeaderData = {
94
94
  };
95
95
  /**
96
96
  * Available compression algorithms for op compression.
97
- * @public
97
+ * @alpha
98
98
  */
99
99
  export var CompressionAlgorithms;
100
100
  (function (CompressionAlgorithms) {
@@ -125,7 +125,7 @@ export const defaultPendingOpsRetryDelayMs = 1000;
125
125
  const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
126
126
  /**
127
127
  * @deprecated use ContainerRuntimeMessageType instead
128
- * @public
128
+ * @internal
129
129
  */
130
130
  export var RuntimeMessage;
131
131
  (function (RuntimeMessage) {
@@ -139,7 +139,7 @@ export var RuntimeMessage;
139
139
  })(RuntimeMessage || (RuntimeMessage = {}));
140
140
  /**
141
141
  * @deprecated please use version in driver-utils
142
- * @public
142
+ * @internal
143
143
  */
144
144
  export function isRuntimeMessage(message) {
145
145
  return Object.values(RuntimeMessage).includes(message.type);
@@ -148,7 +148,7 @@ export function isRuntimeMessage(message) {
148
148
  * Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
149
149
  * special-case for document dirty state. Ultimately we should have no special-cases from the
150
150
  * ContainerRuntime's perspective.
151
- * @public
151
+ * @internal
152
152
  */
153
153
  export const agentSchedulerId = "_scheduler";
154
154
  // safely check navigator and get the hardware spec value
@@ -203,7 +203,9 @@ async function createSummarizer(loader, url) {
203
203
  fluidObject = await resolvedContainer.getEntryPoint();
204
204
  }
205
205
  else {
206
- const response = await resolvedContainer.request({ url: `/${summarizerRequestUrl}` });
206
+ const response = await resolvedContainer.request({
207
+ url: `/${summarizerRequestUrl}`,
208
+ });
207
209
  if (response.status !== 200 || response.mimeType !== "fluid/object") {
208
210
  throw responseToException(response, request);
209
211
  }
@@ -214,54 +216,12 @@ async function createSummarizer(loader, url) {
214
216
  }
215
217
  return fluidObject.ISummarizer;
216
218
  }
217
- /**
218
- * This function is not supported publicly and exists for e2e testing
219
- * @internal
220
- */
221
- export async function TEST_requestSummarizer(loader, url) {
222
- return createSummarizer(loader, url);
223
- }
224
219
  /**
225
220
  * Represents the runtime of the container. Contains helper functions/state of the container.
226
221
  * It will define the store level mappings.
227
- * @public
222
+ * @alpha
228
223
  */
229
224
  export class ContainerRuntime extends TypedEventEmitter {
230
- /**
231
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
232
- */
233
- get IFluidRouter() {
234
- return this;
235
- }
236
- /**
237
- * @deprecated use loadRuntime instead.
238
- * Load the stores from a snapshot and returns the runtime.
239
- * @param context - Context of the container.
240
- * @param registryEntries - Mapping to the stores.
241
- * @param requestHandler - Request handlers for the container runtime
242
- * @param runtimeOptions - Additional options to be passed to the runtime
243
- * @param existing - (optional) When loading from an existing snapshot. Precedes context.existing if provided
244
- * @param containerRuntimeCtor - (optional) Constructor to use to create the ContainerRuntime instance. This
245
- * allows mixin classes to leverage this method to define their own async initializer.
246
- */
247
- static async load(context, registryEntries, requestHandler, runtimeOptions = {}, containerScope = context.scope, existing, containerRuntimeCtor = ContainerRuntime) {
248
- let existingFlag = true;
249
- if (!existing) {
250
- existingFlag = false;
251
- }
252
- return this.loadRuntime({
253
- context,
254
- registryEntries,
255
- existing: existingFlag,
256
- runtimeOptions,
257
- containerScope,
258
- containerRuntimeCtor,
259
- requestHandler,
260
- provideEntryPoint: () => {
261
- throw new UsageError("ContainerRuntime.load is deprecated and should no longer be used");
262
- },
263
- });
264
- }
265
225
  /**
266
226
  * Load the stores from a snapshot and returns the runtime.
267
227
  * @param params - An object housing the runtime properties:
@@ -341,16 +301,16 @@ export class ContainerRuntime extends TypedEventEmitter {
341
301
  const idCompressorEnabled = metadata?.idCompressorEnabled ?? runtimeOptions.enableRuntimeIdCompressor ?? false;
342
302
  let idCompressor;
343
303
  if (idCompressorEnabled) {
344
- const { IdCompressor, createSessionId } = await import("./id-compressor");
304
+ const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import("@fluidframework/id-compressor");
345
305
  const pendingLocalState = context.pendingLocalState;
346
306
  if (pendingLocalState?.pendingIdCompressorState !== undefined) {
347
- idCompressor = IdCompressor.deserialize(pendingLocalState.pendingIdCompressorState);
307
+ idCompressor = deserializeIdCompressor(pendingLocalState.pendingIdCompressorState);
348
308
  }
349
309
  else if (serializedIdCompressor !== undefined) {
350
- idCompressor = IdCompressor.deserialize(serializedIdCompressor, createSessionId());
310
+ idCompressor = deserializeIdCompressor(serializedIdCompressor, createSessionId());
351
311
  }
352
312
  else {
353
- idCompressor = IdCompressor.create(logger);
313
+ idCompressor = createIdCompressor(logger);
354
314
  }
355
315
  }
356
316
  const runtime = new containerRuntimeCtor(context, registry, metadata, electedSummarizerData, chunks ?? [], aliases ?? [], {
@@ -453,9 +413,7 @@ export class ContainerRuntime extends TypedEventEmitter {
453
413
  get gcThrowOnTombstoneUsage() {
454
414
  return this.garbageCollector.throwOnTombstoneUsage;
455
415
  }
456
- /**
457
- * @internal
458
- */
416
+ /***/
459
417
  constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, idCompressor, provideEntryPoint, requestHandler, summaryConfiguration = {
460
418
  // the defaults
461
419
  ...DefaultSummaryConfiguration,
@@ -470,6 +428,7 @@ export class ContainerRuntime extends TypedEventEmitter {
470
428
  this._storage = _storage;
471
429
  this.requestHandler = requestHandler;
472
430
  this.summaryConfiguration = summaryConfiguration;
431
+ this.imminentClosure = false;
473
432
  this.defaultMaxConsecutiveReconnects = 7;
474
433
  this._orderSequentiallyCalls = 0;
475
434
  this.flushTaskExists = false;
@@ -561,7 +520,7 @@ export class ContainerRuntime extends TypedEventEmitter {
561
520
  eventName: "GCFeatureMatrix",
562
521
  metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
563
522
  inputs: JSON.stringify({
564
- gcOptions_gcTombstoneGeneration: this.runtimeOptions.gcOptions[gcTombstoneGenerationOptionName],
523
+ gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gcGenerationOptionName],
565
524
  }),
566
525
  });
567
526
  this.telemetryDocumentId = metadata?.telemetryDocumentId ?? uuid();
@@ -627,6 +586,7 @@ export class ContainerRuntime extends TypedEventEmitter {
627
586
  // GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
628
587
  // delta manager would always return false for summarizer client.
629
588
  activeConnection: () => this.innerDeltaManager.active,
589
+ submitMessage: (message) => this.submit(message),
630
590
  });
631
591
  const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
632
592
  this.summarizerNode = createRootSummarizerNodeWithGC(createChildLogger({ logger: this.logger, namespace: "SummarizerNode" }),
@@ -834,8 +794,9 @@ export class ContainerRuntime extends TypedEventEmitter {
834
794
  /**
835
795
  * Notifies this object about the request made to the container.
836
796
  * @param request - Request made to the handler.
837
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
797
+ * @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".
838
798
  */
799
+ // @ts-expect-error expected to be used by LTS Loaders and Containers
839
800
  async request(request) {
840
801
  try {
841
802
  const parser = RequestParser.create(request);
@@ -1079,6 +1040,9 @@ export class ContainerRuntime extends TypedEventEmitter {
1079
1040
  throw new Error("chunkedOp not expected here");
1080
1041
  case ContainerMessageType.Rejoin:
1081
1042
  throw new Error("rejoin not expected here");
1043
+ case ContainerMessageType.GC:
1044
+ // GC op is only sent in summarizer which should never have stashed ops.
1045
+ throw new LoggingError("GC op not expected to be stashed in summarizer");
1082
1046
  default: {
1083
1047
  // This should be extremely rare for stashed ops.
1084
1048
  // It would require a newer runtime stashing ops and then an older one applying them,
@@ -1263,6 +1227,9 @@ export class ContainerRuntime extends TypedEventEmitter {
1263
1227
  this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
1264
1228
  }
1265
1229
  break;
1230
+ case ContainerMessageType.GC:
1231
+ this.garbageCollector.processMessage(messageWithContext.message, local);
1232
+ break;
1266
1233
  case ContainerMessageType.ChunkedOp:
1267
1234
  case ContainerMessageType.Rejoin:
1268
1235
  break;
@@ -1346,23 +1313,6 @@ export class ContainerRuntime extends TypedEventEmitter {
1346
1313
  }
1347
1314
  this.dataStores.processSignal(envelope.address, transformed, local);
1348
1315
  }
1349
- /**
1350
- * Returns the runtime of the data store.
1351
- * @param id - Id supplied during creating the data store.
1352
- * @param wait - True if you want to wait for it.
1353
- * @deprecated Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
1354
- */
1355
- // eslint-disable-next-line import/no-deprecated
1356
- async getRootDataStore(id, wait = true) {
1357
- return this.getRootDataStoreChannel(id, wait);
1358
- }
1359
- async getRootDataStoreChannel(id, wait = true) {
1360
- await this.dataStores.waitIfPendingAlias(id);
1361
- const internalId = this.internalId(id);
1362
- const context = await this.dataStores.getDataStore(internalId, { wait });
1363
- assert(await context.isRoot(), 0x12b /* "did not get root data store" */);
1364
- return context.realize();
1365
- }
1366
1316
  /**
1367
1317
  * Flush the pending ops manually.
1368
1318
  * This method is expected to be called at the end of a batch.
@@ -1452,7 +1402,6 @@ export class ContainerRuntime extends TypedEventEmitter {
1452
1402
  }
1453
1403
  /**
1454
1404
  * @deprecated 0.16 Issue #1537, #3631
1455
- * @internal
1456
1405
  */
1457
1406
  async _createDataStoreWithProps(pkg, props, id = uuid()) {
1458
1407
  return channelToDataStore(await this.dataStores
@@ -1462,7 +1411,7 @@ export class ContainerRuntime extends TypedEventEmitter {
1462
1411
  canSendOps() {
1463
1412
  // Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
1464
1413
  // container runtime's ability to send ops depend on the actual readonly state of the delta manager.
1465
- return this.connected && !this.innerDeltaManager.readOnlyInfo.readonly;
1414
+ return (this.connected && !this.innerDeltaManager.readOnlyInfo.readonly && !this.imminentClosure);
1466
1415
  }
1467
1416
  /**
1468
1417
  * Are we in the middle of batching ops together?
@@ -1484,19 +1433,28 @@ export class ContainerRuntime extends TypedEventEmitter {
1484
1433
  return this.dirtyContainer;
1485
1434
  }
1486
1435
  isContainerMessageDirtyable({ type, contents }) {
1487
- // For legacy purposes, exclude the old built-in AgentScheduler from dirty consideration as a special-case.
1488
- // Ultimately we should have no special-cases from the ContainerRuntime's perspective.
1489
- if (type === ContainerMessageType.Attach) {
1490
- const attachMessage = contents;
1491
- if (attachMessage.id === agentSchedulerId) {
1492
- return false;
1436
+ // Certain container runtime messages should not mark the container dirty such as the old built-in
1437
+ // AgentScheduler and Garbage collector messages.
1438
+ switch (type) {
1439
+ case ContainerMessageType.Attach: {
1440
+ const attachMessage = contents;
1441
+ if (attachMessage.id === agentSchedulerId) {
1442
+ return false;
1443
+ }
1444
+ break;
1493
1445
  }
1494
- }
1495
- else if (type === ContainerMessageType.FluidDataStoreOp) {
1496
- const envelope = contents;
1497
- if (envelope.address === agentSchedulerId) {
1446
+ case ContainerMessageType.FluidDataStoreOp: {
1447
+ const envelope = contents;
1448
+ if (envelope.address === agentSchedulerId) {
1449
+ return false;
1450
+ }
1451
+ break;
1452
+ }
1453
+ case ContainerMessageType.GC: {
1498
1454
  return false;
1499
1455
  }
1456
+ default:
1457
+ break;
1500
1458
  }
1501
1459
  return true;
1502
1460
  }
@@ -1787,10 +1745,10 @@ export class ContainerRuntime extends TypedEventEmitter {
1787
1745
  properties: { all: { safeSummary: true } },
1788
1746
  }));
1789
1747
  }
1790
- // If there are pending (unacked ops), the summary will not be eventual consistent and it may even be
1791
- // incorrect. So, wait for the container to be saved with a timeout. If the container is not saved
1792
- // within the timeout, check if it should be failed or can continue.
1793
- if (this.validateSummaryBeforeUpload && this.hasPendingMessages()) {
1748
+ // If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
1749
+ // and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
1750
+ // saved within the timeout, check if it should be failed or can continue.
1751
+ if (this.validateSummaryBeforeUpload && this.isDirty) {
1794
1752
  const countBefore = this.pendingMessagesCount;
1795
1753
  // The timeout for waiting for pending ops can be overridden via configurations.
1796
1754
  const pendingOpsTimeout = this.mc.config.getNumber("Fluid.Summarizer.waitForPendingOpsTimeoutMs") ??
@@ -1810,7 +1768,7 @@ export class ContainerRuntime extends TypedEventEmitter {
1810
1768
  // happens, whether we attempted to wait for these ops to be acked and what was the result.
1811
1769
  summaryNumberLogger.sendTelemetryEvent({
1812
1770
  eventName: "PendingOpsWhileSummarizing",
1813
- saved: this.hasPendingMessages() ? false : true,
1771
+ saved: !this.isDirty,
1814
1772
  timeout: pendingOpsTimeout,
1815
1773
  countBefore,
1816
1774
  countAfter: this.pendingMessagesCount,
@@ -2035,7 +1993,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2035
1993
  }
2036
1994
  }
2037
1995
  /**
2038
- * This helper is called during summarization. If there are pending ops, it will return a failed summarize result
1996
+ * This helper is called during summarization. If the container is dirty, it will return a failed summarize result
2039
1997
  * (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
2040
1998
  * @param logger - The logger to be used for sending telemetry.
2041
1999
  * @param referenceSequenceNumber - The reference sequence number of the summary attempt.
@@ -2045,7 +2003,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2045
2003
  * @returns failed summarize result (IBaseSummarizeResult) if summary should be failed, undefined otherwise.
2046
2004
  */
2047
2005
  async shouldFailSummaryOnPendingOps(logger, referenceSequenceNumber, minimumSequenceNumber, finalAttempt, beforeSummaryGeneration) {
2048
- if (!this.hasPendingMessages()) {
2006
+ if (!this.isDirty) {
2049
2007
  return;
2050
2008
  }
2051
2009
  // If "SkipFailingIncorrectSummary" option is true, don't fail the summary in the last attempt.
@@ -2315,6 +2273,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2315
2273
  /**
2316
2274
  * Finds the right store and asks it to resubmit the message. This typically happens when we
2317
2275
  * reconnect and there are pending messages.
2276
+ * ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
2318
2277
  * @param message - The original LocalContainerRuntimeMessage.
2319
2278
  * @param localOpMetadata - The local metadata associated with the original message.
2320
2279
  */
@@ -2339,6 +2298,9 @@ export class ContainerRuntime extends TypedEventEmitter {
2339
2298
  case ContainerMessageType.Rejoin:
2340
2299
  this.submit(message);
2341
2300
  break;
2301
+ case ContainerMessageType.GC:
2302
+ // GC op is only sent in summarizer which should never reconnect.
2303
+ throw new LoggingError("GC op not expected to be resubmitted in summarizer");
2342
2304
  default: {
2343
2305
  // This case should be very rare - it would imply an op was stashed from a
2344
2306
  // future version of runtime code and now is being applied on an older version
@@ -2473,14 +2435,17 @@ export class ContainerRuntime extends TypedEventEmitter {
2473
2435
  };
2474
2436
  });
2475
2437
  }
2476
- notifyAttaching() { } // do nothing (deprecated method)
2477
2438
  async getPendingLocalState(props) {
2478
2439
  return PerformanceEvent.timedExecAsync(this.mc.logger, {
2479
2440
  eventName: "getPendingLocalState",
2480
2441
  notifyImminentClosure: props?.notifyImminentClosure,
2481
2442
  }, async (event) => {
2482
2443
  this.verifyNotClosed();
2483
- const waitBlobsToAttach = props?.notifyImminentClosure;
2444
+ // in case imminentClosure is set to true by future code, we don't
2445
+ // try to change its value
2446
+ if (!this.imminentClosure) {
2447
+ this.imminentClosure = props?.notifyImminentClosure ?? this.imminentClosure;
2448
+ }
2484
2449
  const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
2485
2450
  if (this._orderSequentiallyCalls !== 0) {
2486
2451
  throw new UsageError("can't get state during orderSequentially");
@@ -2489,7 +2454,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2489
2454
  // getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
2490
2455
  // to close current batch.
2491
2456
  this.flush();
2492
- const pendingAttachmentBlobs = waitBlobsToAttach
2457
+ const pendingAttachmentBlobs = this.imminentClosure
2493
2458
  ? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
2494
2459
  : undefined;
2495
2460
  const pending = this.pendingStateManager.getLocalState();