@fluidframework/container-runtime 2.0.0-internal.5.4.2 → 2.0.0-internal.6.0.1

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 (196) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/batchTracker.d.ts +2 -1
  3. package/dist/batchTracker.d.ts.map +1 -1
  4. package/dist/batchTracker.js.map +1 -1
  5. package/dist/blobManager.d.ts +4 -1
  6. package/dist/blobManager.d.ts.map +1 -1
  7. package/dist/blobManager.js +61 -26
  8. package/dist/blobManager.js.map +1 -1
  9. package/dist/connectionTelemetry.js +10 -2
  10. package/dist/connectionTelemetry.js.map +1 -1
  11. package/dist/containerRuntime.d.ts +26 -11
  12. package/dist/containerRuntime.d.ts.map +1 -1
  13. package/dist/containerRuntime.js +177 -123
  14. package/dist/containerRuntime.js.map +1 -1
  15. package/dist/dataStore.js +8 -2
  16. package/dist/dataStore.js.map +1 -1
  17. package/dist/dataStoreContext.js +23 -24
  18. package/dist/dataStoreContext.js.map +1 -1
  19. package/dist/dataStores.d.ts +20 -4
  20. package/dist/dataStores.d.ts.map +1 -1
  21. package/dist/dataStores.js +107 -53
  22. package/dist/dataStores.js.map +1 -1
  23. package/dist/gc/garbageCollection.js +17 -20
  24. package/dist/gc/garbageCollection.js.map +1 -1
  25. package/dist/gc/gcConfigs.js +13 -11
  26. package/dist/gc/gcConfigs.js.map +1 -1
  27. package/dist/gc/gcHelpers.js +4 -6
  28. package/dist/gc/gcHelpers.js.map +1 -1
  29. package/dist/gc/gcSummaryStateTracker.js +4 -6
  30. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  31. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  32. package/dist/gc/gcTelemetry.js +55 -37
  33. package/dist/gc/gcTelemetry.js.map +1 -1
  34. package/dist/id-compressor/idCompressor.js +49 -51
  35. package/dist/id-compressor/idCompressor.js.map +1 -1
  36. package/dist/id-compressor/idRange.js +2 -2
  37. package/dist/id-compressor/idRange.js.map +1 -1
  38. package/dist/id-compressor/sessionIdNormalizer.js +11 -16
  39. package/dist/id-compressor/sessionIdNormalizer.js.map +1 -1
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/opLifecycle/batchManager.js +10 -6
  44. package/dist/opLifecycle/batchManager.js.map +1 -1
  45. package/dist/opLifecycle/opCompressor.js +6 -1
  46. package/dist/opLifecycle/opCompressor.js.map +1 -1
  47. package/dist/opLifecycle/opDecompressor.js +11 -9
  48. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  49. package/dist/opLifecycle/opGroupingManager.js +13 -5
  50. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  51. package/dist/opLifecycle/opSplitter.js +10 -6
  52. package/dist/opLifecycle/opSplitter.js.map +1 -1
  53. package/dist/opLifecycle/outbox.js +1 -2
  54. package/dist/opLifecycle/outbox.js.map +1 -1
  55. package/dist/opLifecycle/remoteMessageProcessor.js +1 -1
  56. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  57. package/dist/opProperties.js +1 -2
  58. package/dist/opProperties.js.map +1 -1
  59. package/dist/packageVersion.d.ts +1 -1
  60. package/dist/packageVersion.js +1 -1
  61. package/dist/packageVersion.js.map +1 -1
  62. package/dist/pendingStateManager.d.ts +2 -2
  63. package/dist/pendingStateManager.d.ts.map +1 -1
  64. package/dist/pendingStateManager.js +22 -22
  65. package/dist/pendingStateManager.js.map +1 -1
  66. package/dist/scheduleManager.js +14 -10
  67. package/dist/scheduleManager.js.map +1 -1
  68. package/dist/summary/orderedClientElection.d.ts +2 -1
  69. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  70. package/dist/summary/orderedClientElection.js +17 -18
  71. package/dist/summary/orderedClientElection.js.map +1 -1
  72. package/dist/summary/runningSummarizer.js +32 -38
  73. package/dist/summary/runningSummarizer.js.map +1 -1
  74. package/dist/summary/summarizer.js +4 -7
  75. package/dist/summary/summarizer.js.map +1 -1
  76. package/dist/summary/summarizerClientElection.js +5 -9
  77. package/dist/summary/summarizerClientElection.js.map +1 -1
  78. package/dist/summary/summarizerHeuristics.js +8 -12
  79. package/dist/summary/summarizerHeuristics.js.map +1 -1
  80. package/dist/summary/summarizerNode/summarizerNode.js +22 -15
  81. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  82. package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  83. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  84. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +17 -16
  85. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  86. package/dist/summary/summaryCollection.js +3 -5
  87. package/dist/summary/summaryCollection.js.map +1 -1
  88. package/dist/summary/summaryFormat.js +1 -2
  89. package/dist/summary/summaryFormat.js.map +1 -1
  90. package/dist/summary/summaryGenerator.js +62 -20
  91. package/dist/summary/summaryGenerator.js.map +1 -1
  92. package/dist/summary/summaryManager.js +3 -5
  93. package/dist/summary/summaryManager.js.map +1 -1
  94. package/lib/batchTracker.d.ts +2 -1
  95. package/lib/batchTracker.d.ts.map +1 -1
  96. package/lib/batchTracker.js.map +1 -1
  97. package/lib/blobManager.d.ts +4 -1
  98. package/lib/blobManager.d.ts.map +1 -1
  99. package/lib/blobManager.js +61 -26
  100. package/lib/blobManager.js.map +1 -1
  101. package/lib/connectionTelemetry.js +10 -2
  102. package/lib/connectionTelemetry.js.map +1 -1
  103. package/lib/containerRuntime.d.ts +26 -11
  104. package/lib/containerRuntime.d.ts.map +1 -1
  105. package/lib/containerRuntime.js +177 -123
  106. package/lib/containerRuntime.js.map +1 -1
  107. package/lib/dataStore.js +8 -2
  108. package/lib/dataStore.js.map +1 -1
  109. package/lib/dataStoreContext.js +23 -24
  110. package/lib/dataStoreContext.js.map +1 -1
  111. package/lib/dataStores.d.ts +20 -4
  112. package/lib/dataStores.d.ts.map +1 -1
  113. package/lib/dataStores.js +107 -53
  114. package/lib/dataStores.js.map +1 -1
  115. package/lib/gc/garbageCollection.js +17 -20
  116. package/lib/gc/garbageCollection.js.map +1 -1
  117. package/lib/gc/gcConfigs.js +13 -11
  118. package/lib/gc/gcConfigs.js.map +1 -1
  119. package/lib/gc/gcHelpers.js +4 -6
  120. package/lib/gc/gcHelpers.js.map +1 -1
  121. package/lib/gc/gcSummaryStateTracker.js +4 -6
  122. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  123. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  124. package/lib/gc/gcTelemetry.js +55 -37
  125. package/lib/gc/gcTelemetry.js.map +1 -1
  126. package/lib/id-compressor/idCompressor.js +49 -51
  127. package/lib/id-compressor/idCompressor.js.map +1 -1
  128. package/lib/id-compressor/idRange.js +2 -2
  129. package/lib/id-compressor/idRange.js.map +1 -1
  130. package/lib/id-compressor/sessionIdNormalizer.js +11 -16
  131. package/lib/id-compressor/sessionIdNormalizer.js.map +1 -1
  132. package/lib/index.d.ts +1 -1
  133. package/lib/index.d.ts.map +1 -1
  134. package/lib/index.js.map +1 -1
  135. package/lib/opLifecycle/batchManager.js +10 -6
  136. package/lib/opLifecycle/batchManager.js.map +1 -1
  137. package/lib/opLifecycle/opCompressor.js +6 -1
  138. package/lib/opLifecycle/opCompressor.js.map +1 -1
  139. package/lib/opLifecycle/opDecompressor.js +11 -9
  140. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  141. package/lib/opLifecycle/opGroupingManager.js +13 -5
  142. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  143. package/lib/opLifecycle/opSplitter.js +10 -6
  144. package/lib/opLifecycle/opSplitter.js.map +1 -1
  145. package/lib/opLifecycle/outbox.js +1 -2
  146. package/lib/opLifecycle/outbox.js.map +1 -1
  147. package/lib/opLifecycle/remoteMessageProcessor.js +1 -1
  148. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  149. package/lib/opProperties.js +1 -2
  150. package/lib/opProperties.js.map +1 -1
  151. package/lib/packageVersion.d.ts +1 -1
  152. package/lib/packageVersion.js +1 -1
  153. package/lib/packageVersion.js.map +1 -1
  154. package/lib/pendingStateManager.d.ts +2 -2
  155. package/lib/pendingStateManager.d.ts.map +1 -1
  156. package/lib/pendingStateManager.js +22 -22
  157. package/lib/pendingStateManager.js.map +1 -1
  158. package/lib/scheduleManager.js +14 -10
  159. package/lib/scheduleManager.js.map +1 -1
  160. package/lib/summary/orderedClientElection.d.ts +2 -1
  161. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  162. package/lib/summary/orderedClientElection.js +17 -18
  163. package/lib/summary/orderedClientElection.js.map +1 -1
  164. package/lib/summary/runningSummarizer.js +32 -38
  165. package/lib/summary/runningSummarizer.js.map +1 -1
  166. package/lib/summary/summarizer.js +4 -7
  167. package/lib/summary/summarizer.js.map +1 -1
  168. package/lib/summary/summarizerClientElection.js +5 -9
  169. package/lib/summary/summarizerClientElection.js.map +1 -1
  170. package/lib/summary/summarizerHeuristics.js +8 -12
  171. package/lib/summary/summarizerHeuristics.js.map +1 -1
  172. package/lib/summary/summarizerNode/summarizerNode.js +22 -15
  173. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  174. package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  175. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  176. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +17 -16
  177. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  178. package/lib/summary/summaryCollection.js +3 -5
  179. package/lib/summary/summaryCollection.js.map +1 -1
  180. package/lib/summary/summaryFormat.js +1 -2
  181. package/lib/summary/summaryFormat.js.map +1 -1
  182. package/lib/summary/summaryGenerator.js +62 -20
  183. package/lib/summary/summaryGenerator.js.map +1 -1
  184. package/lib/summary/summaryManager.js +3 -5
  185. package/lib/summary/summaryManager.js.map +1 -1
  186. package/package.json +17 -17
  187. package/src/batchTracker.ts +2 -1
  188. package/src/blobManager.ts +43 -2
  189. package/src/containerRuntime.ts +74 -51
  190. package/src/dataStore.ts +7 -1
  191. package/src/dataStores.ts +95 -55
  192. package/src/gc/gcTelemetry.ts +1 -2
  193. package/src/index.ts +0 -1
  194. package/src/packageVersion.ts +1 -1
  195. package/src/pendingStateManager.ts +12 -15
  196. package/src/summary/orderedClientElection.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # @fluidframework/container-runtime
2
2
 
3
+ ## 2.0.0-internal.6.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Removed IContainerContext.existing [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
8
+
9
+ The recommended means of checking for existing changed to the instantiateRuntime param in 2021, and the IContainerContext.existing member was formally deprecated in 2.0.0-internal.2.0.0. This member is now removed.
10
+
11
+ - `getRootDataStore` API is deprecated [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
12
+
13
+ The `getRootDataStore` API that is used to get aliased data store has been deprecated. It will be removed in a future release.
14
+ Use `getAliasedDataStoreEntryPoint` API to get aliased data stores instead. It returns the data store's entry point which is its `IFluidHandle`. To use this API `initializeEntryPoint` must be provided when creating `FluidDataStoreRuntime` [here](https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/datastore/src/dataStoreRuntime.ts#L243). `getAliasedDataStoreEntryPoint` and `initializeEntryPoint` will become required in a future release.
15
+
16
+ - Request APIs deprecated from many places [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
17
+
18
+ The `request` API (associated with the `IFluidRouter` interface) has been deprecated on a number of classes and interfaces. The following are impacted:
19
+
20
+ - `IRuntime` and `ContainerRuntime`
21
+ - `IFluidDataStoreRuntime` and `FluidDataStoreRuntime`
22
+ - `IFluidDataStoreChannel`
23
+ - `MockFluidDataStoreRuntime`
24
+ - `TestFluidObject`
25
+
26
+ Please migrate usage to the corresponding `entryPoint` or `getEntryPoint()` of the object. The value for these "entryPoint" related APIs is determined from factories (for `IRuntime` and `IFluidDataStoreRuntime`) via the `initializeEntryPoint` method. If no method is passed to the factory, the corresponding `entryPoint` and `getEntryPoint()` will be undefined.
27
+
28
+ For an example implementation of `initializeEntryPoint`, see [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/blob/next/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts#L84).
29
+
30
+ More information of the migration off the request pattern, and current status of its removal, is documented in [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md).
31
+
32
+ - `initializeEntryPoint` will become required [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
33
+
34
+ The optional `initializeEntryPoint` method has been added to a number of constructors. **This method argument will become required in an upcoming release** and a value will need to be provided to the following classes:
35
+
36
+ - `BaseContainerRuntimeFactory`
37
+ - `ContainerRuntimeFactoryWithDefaultDataStore`
38
+ - `RuntimeFactory`
39
+ - `ContainerRuntime` (constructor and `loadRuntime`)
40
+ - `FluidDataStoreRuntime`
41
+
42
+ For an example implementation of `initializeEntryPoint`, see [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts#L84).
43
+
44
+ This work will replace the request pattern. See [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md) for more info on this effort.
45
+
46
+ - New required method `getAliasedDataStoreEntryPoint` in ContainerRuntime [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
47
+
48
+ `getAliasedDataStoreEntryPoint` API has been added to ContainerRuntime. This can be used to get the entry point to an aliased data stores. To use this API `initializeEntryPoint` must be provided when creating `FluidDataStoreRuntime` [here](https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/datastore/src/dataStoreRuntime.ts#L243). `getAliasedDataStoreEntryPoint` and `initializeEntryPoint` will become required in a future release.
49
+
50
+ - `IRootSummaryTreeWithStats` removed [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
51
+
52
+ `IRootSummaryTreeWithStats` was the return type of `summarize` method on `ContainerRuntime`. It was an internal interface used only in `ContainerRuntime` class to to access `gcStats` from a call site. `gcStats` is not needed in the call site anymore so this interface is removed.
53
+
54
+ - getPendingLocalState and closeAndGetPendingLocalState are now async [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
55
+
56
+ getPendingLocalState and closeAndGetPendingLocalState are now async to allow uploading blobs to attach to a DDS (in closing scenario). There is a new parameter in those methods at the container/runtime layer "notifyImminentClosure" which is true only when closing and ensures uploading blobs fast resolve and get attached. Once we apply stashed ops to new container, blob will try to reupload and we will know where to place its references.
57
+
58
+ - Calling `ContainerRuntime.closeFn(...)` will no longer call `ContainerContext.disposeFn(...)` as well [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
59
+
60
+ This means the `ContainerRuntime` will no longer be disposed by calling this method.
61
+
62
+ If you want to dispose the `ContainerRuntime`, use the `ContainerRuntime.disposeFn` method.
63
+
64
+ For more information about close vs. dispose expectations, see the [Closure](https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/README.md#closure) section of Loader README.md.
65
+
66
+ - Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
67
+
68
+ Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
69
+
70
+ - IDeltaManager members disposed and dispose() removed [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
71
+
72
+ IDeltaManager members disposed and dispose() were deprecated in 2.0.0-internal.5.3.0 and have now been removed.
73
+
3
74
  ## 2.0.0-internal.5.4.0
4
75
 
5
76
  ### Minor Changes
@@ -4,13 +4,14 @@
4
4
  */
5
5
  import { EventEmitter } from "events";
6
6
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
+ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
8
  export declare class BatchTracker {
8
9
  private readonly batchEventEmitter;
9
10
  private readonly logger;
10
11
  private startBatchSequenceNumber;
11
12
  private trackedBatchCount;
12
13
  private batchProcessingStartTimeStamp;
13
- constructor(batchEventEmitter: EventEmitter, logger: ITelemetryLoggerExt, batchLengthThreshold: number, batchCountSamplingRate: number, dateTimeProvider?: () => number);
14
+ constructor(batchEventEmitter: EventEmitter, logger: ITelemetryBaseLogger, batchLengthThreshold: number, batchCountSamplingRate: number, dateTimeProvider?: () => number);
14
15
  }
15
16
  /**
16
17
  * Track batch sizes in terms of op counts and processing times
@@ -1 +1 @@
1
- {"version":3,"file":"batchTracker.d.ts","sourceRoot":"","sources":["../src/batchTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAqB,MAAM,iCAAiC,CAAC;AAIzF,qBAAa,YAAY;IAOvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IANnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,wBAAwB,CAAqB;IACrD,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,6BAA6B,CAAqB;gBAGxC,iBAAiB,EAAE,YAAY,EAChD,MAAM,EAAE,mBAAmB,EAC3B,oBAAoB,EAAE,MAAM,EAC5B,sBAAsB,EAAE,MAAM,EAC9B,gBAAgB,GAAE,MAAM,MAAgC;CA8CzD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,sBACT,YAAY,UACvB,mBAAmB,yBACL,MAAM,2BACJ,MAAM,iBAC+D,CAAC"}
1
+ {"version":3,"file":"batchTracker.d.ts","sourceRoot":"","sources":["../src/batchTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAqB,MAAM,iCAAiC,CAAC;AAGzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,qBAAa,YAAY;IAOvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IANnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,wBAAwB,CAAqB;IACrD,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,6BAA6B,CAAqB;gBAGxC,iBAAiB,EAAE,YAAY,EAChD,MAAM,EAAE,oBAAoB,EAC5B,oBAAoB,EAAE,MAAM,EAC5B,sBAAsB,EAAE,MAAM,EAC9B,gBAAgB,GAAE,MAAM,MAAgC;CA8CzD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,sBACT,YAAY,UACvB,mBAAmB,yBACL,MAAM,2BACJ,MAAM,iBAC+D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"batchTracker.js","sourceRoot":"","sources":["../src/batchTracker.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAAyF;AACzF,+DAAmE;AAGnE,MAAa,YAAY;IAMxB,YACkB,iBAA+B,EAChD,MAA2B,EAC3B,oBAA4B,EAC5B,sBAA8B,EAC9B,mBAAiC,GAAG,EAAE,CAAC,0BAAW,CAAC,GAAG,EAAE;QAJvC,sBAAiB,GAAjB,iBAAiB,CAAc;QAJzC,sBAA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Ac;oBAC9C,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,6BAA6B;iBACjE,CAAC,CAAC;aACH;YAED,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAC;YAC1C,IAAI,CAAC,6BAA6B,GAAG,SAAS,CAAC;QAChD,CAAC,CACD,CAAC;IACH,CAAC;CACD;AAzDD,oCAyDC;AAED;;;;;;;GAOG;AACI,MAAM,gBAAgB,GAAG,CAC/B,iBAA+B,EAC/B,MAA2B,EAC3B,uBAA+B,IAAI,EACnC,yBAAiC,IAAI,EACpC,EAAE,CAAC,IAAI,YAAY,CAAC,iBAAiB,EAAE,MAAM,EAAE,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;AALlF,QAAA,gBAAgB,oBAKkE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { ITelemetryLoggerExt, createChildLogger } from \"@fluidframework/telemetry-utils\";\nimport { assert, performance } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\n\nexport class BatchTracker {\n\tprivate readonly logger: ITelemetryLoggerExt;\n\tprivate startBatchSequenceNumber: number | undefined;\n\tprivate trackedBatchCount: number = 0;\n\tprivate batchProcessingStartTimeStamp: number | undefined;\n\n\tconstructor(\n\t\tprivate readonly batchEventEmitter: EventEmitter,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tbatchLengthThreshold: number,\n\t\tbatchCountSamplingRate: number,\n\t\tdateTimeProvider: () => number = () => performance.now(),\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"Batching\" });\n\n\t\tthis.batchEventEmitter.on(\"batchBegin\", (message: ISequencedDocumentMessage) => {\n\t\t\tthis.startBatchSequenceNumber = message.sequenceNumber;\n\t\t\tthis.batchProcessingStartTimeStamp = dateTimeProvider();\n\t\t\tthis.trackedBatchCount++;\n\t\t});\n\n\t\tthis.batchEventEmitter.on(\n\t\t\t\"batchEnd\",\n\t\t\t(error: any | undefined, message: ISequencedDocumentMessage) => {\n\t\t\t\tassert(\n\t\t\t\t\tthis.startBatchSequenceNumber !== undefined &&\n\t\t\t\t\t\tthis.batchProcessingStartTimeStamp !== undefined,\n\t\t\t\t\t0x2ba /* \"batchBegin must fire before batchEnd\" */,\n\t\t\t\t);\n\n\t\t\t\tconst length = message.sequenceNumber - this.startBatchSequenceNumber + 1;\n\t\t\t\tif (length >= batchLengthThreshold) {\n\t\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\t\teventName: \"LengthTooBig\",\n\t\t\t\t\t\tlength,\n\t\t\t\t\t\tthreshold: batchLengthThreshold,\n\t\t\t\t\t\tbatchEndSequenceNumber: message.sequenceNumber,\n\t\t\t\t\t\tduration: dateTimeProvider() - this.batchProcessingStartTimeStamp,\n\t\t\t\t\t\tbatchError: error !== undefined,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (this.trackedBatchCount % batchCountSamplingRate === 0) {\n\t\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\t\teventName: \"Length\",\n\t\t\t\t\t\tlength,\n\t\t\t\t\t\tsamplingRate: batchCountSamplingRate,\n\t\t\t\t\t\tbatchEndSequenceNumber: message.sequenceNumber,\n\t\t\t\t\t\tduration: dateTimeProvider() - this.batchProcessingStartTimeStamp,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.startBatchSequenceNumber = undefined;\n\t\t\t\tthis.batchProcessingStartTimeStamp = undefined;\n\t\t\t},\n\t\t);\n\t}\n}\n\n/**\n * Track batch sizes in terms of op counts and processing times\n *\n * @param batchEventEmitter - event emitter which tracks the lifecycle of batch operations\n * @param logger - See {@link @fluidframework/common-definitions#ITelemetryLoggerExt}\n * @param batchLengthThreshold - threshold for the length of a batch when to send an error event\n * @param batchCountSamplingRate - rate for batches for which to send an event with its characteristics\n */\nexport const BindBatchTracker = (\n\tbatchEventEmitter: EventEmitter,\n\tlogger: ITelemetryLoggerExt,\n\tbatchLengthThreshold: number = 1000,\n\tbatchCountSamplingRate: number = 1000,\n) => new BatchTracker(batchEventEmitter, logger, batchLengthThreshold, batchCountSamplingRate);\n"]}
1
+ {"version":3,"file":"batchTracker.js","sourceRoot":"","sources":["../src/batchTracker.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAAyF;AACzF,+DAAmE;AAInE,MAAa,YAAY;IAMxB,YACkB,iBAA+B,EAChD,MAA4B,EAC5B,oBAA4B,EAC5B,sBAA8B,EAC9B,mBAAiC,GAAG,EAAE,CAAC,0BAAW,CAAC,GAAG,EAAE;QAJvC,sBAAiB,GAAjB,iBAAiB,CAAc;QAJzC,sBAAiB,GAAW,CAAC,CAAC;QAUrC,IAAI,CAAC,MAAM,GAAG,IAAA,mCAAiB,EAAC,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;QAEnE,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,OAAkC,EAAE,EAAE;YAC9E,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,cAAc,CAAC;YACvD,IAAI,CAAC,6BAA6B,GAAG,gBAAgB,EAAE,CAAC;YACxD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,CAAC,EAAE,CACxB,UAAU,EACV,CAAC,KAAsB,EAAE,OAAkC,EAAE,EAAE;YAC9D,IAAA,qBAAM,EACL,IAAI,CAAC,wBAAwB,KAAK,SAAS;gBAC1C,IAAI,CAAC,6BAA6B,KAAK,SAAS,EACjD,KAAK,CAAC,4CAA4C,CAClD,CAAC;YAEF,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,wBAAwB,GAAG,CAAC,CAAC;YAC1E,IAAI,MAAM,IAAI,oBAAoB,EAAE;gBACnC,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;oBAChC,SAAS,EAAE,cAAc;oBACzB,MAAM;oBACN,SAAS,EAAE,oBAAoB;oBAC/B,sBAAsB,EAAE,OAAO,CAAC,cAAc;oBAC9C,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,6BAA6B;oBACjE,UAAU,EAAE,KAAK,KAAK,SAAS;iBAC/B,CAAC,CAAC;aACH;YAED,IAAI,IAAI,CAAC,iBAAiB,GAAG,sBAAsB,KAAK,CAAC,EAAE;gBAC1D,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;oBAChC,SAAS,EAAE,QAAQ;oBACnB,MAAM;oBACN,YAAY,EAAE,sBAAsB;oBACpC,sBAAsB,EAAE,OAAO,CAAC,cAAc;oBAC9C,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,6BAA6B;iBACjE,CAAC,CAAC;aACH;YAED,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAC;YAC1C,IAAI,CAAC,6BAA6B,GAAG,SAAS,CAAC;QAChD,CAAC,CACD,CAAC;IACH,CAAC;CACD;AAzDD,oCAyDC;AAED;;;;;;;GAOG;AACI,MAAM,gBAAgB,GAAG,CAC/B,iBAA+B,EAC/B,MAA2B,EAC3B,uBAA+B,IAAI,EACnC,yBAAiC,IAAI,EACpC,EAAE,CAAC,IAAI,YAAY,CAAC,iBAAiB,EAAE,MAAM,EAAE,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;AALlF,QAAA,gBAAgB,oBAKkE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { ITelemetryLoggerExt, createChildLogger } from \"@fluidframework/telemetry-utils\";\nimport { assert, performance } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\n\nexport class BatchTracker {\n\tprivate readonly logger: ITelemetryLoggerExt;\n\tprivate startBatchSequenceNumber: number | undefined;\n\tprivate trackedBatchCount: number = 0;\n\tprivate batchProcessingStartTimeStamp: number | undefined;\n\n\tconstructor(\n\t\tprivate readonly batchEventEmitter: EventEmitter,\n\t\tlogger: ITelemetryBaseLogger,\n\t\tbatchLengthThreshold: number,\n\t\tbatchCountSamplingRate: number,\n\t\tdateTimeProvider: () => number = () => performance.now(),\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"Batching\" });\n\n\t\tthis.batchEventEmitter.on(\"batchBegin\", (message: ISequencedDocumentMessage) => {\n\t\t\tthis.startBatchSequenceNumber = message.sequenceNumber;\n\t\t\tthis.batchProcessingStartTimeStamp = dateTimeProvider();\n\t\t\tthis.trackedBatchCount++;\n\t\t});\n\n\t\tthis.batchEventEmitter.on(\n\t\t\t\"batchEnd\",\n\t\t\t(error: any | undefined, message: ISequencedDocumentMessage) => {\n\t\t\t\tassert(\n\t\t\t\t\tthis.startBatchSequenceNumber !== undefined &&\n\t\t\t\t\t\tthis.batchProcessingStartTimeStamp !== undefined,\n\t\t\t\t\t0x2ba /* \"batchBegin must fire before batchEnd\" */,\n\t\t\t\t);\n\n\t\t\t\tconst length = message.sequenceNumber - this.startBatchSequenceNumber + 1;\n\t\t\t\tif (length >= batchLengthThreshold) {\n\t\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\t\teventName: \"LengthTooBig\",\n\t\t\t\t\t\tlength,\n\t\t\t\t\t\tthreshold: batchLengthThreshold,\n\t\t\t\t\t\tbatchEndSequenceNumber: message.sequenceNumber,\n\t\t\t\t\t\tduration: dateTimeProvider() - this.batchProcessingStartTimeStamp,\n\t\t\t\t\t\tbatchError: error !== undefined,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (this.trackedBatchCount % batchCountSamplingRate === 0) {\n\t\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\t\teventName: \"Length\",\n\t\t\t\t\t\tlength,\n\t\t\t\t\t\tsamplingRate: batchCountSamplingRate,\n\t\t\t\t\t\tbatchEndSequenceNumber: message.sequenceNumber,\n\t\t\t\t\t\tduration: dateTimeProvider() - this.batchProcessingStartTimeStamp,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.startBatchSequenceNumber = undefined;\n\t\t\t\tthis.batchProcessingStartTimeStamp = undefined;\n\t\t\t},\n\t\t);\n\t}\n}\n\n/**\n * Track batch sizes in terms of op counts and processing times\n *\n * @param batchEventEmitter - event emitter which tracks the lifecycle of batch operations\n * @param logger - See {@link @fluidframework/common-definitions#ITelemetryLoggerExt}\n * @param batchLengthThreshold - threshold for the length of a batch when to send an error event\n * @param batchCountSamplingRate - rate for batches for which to send an event with its characteristics\n */\nexport const BindBatchTracker = (\n\tbatchEventEmitter: EventEmitter,\n\tlogger: ITelemetryLoggerExt,\n\tbatchLengthThreshold: number = 1000,\n\tbatchCountSamplingRate: number = 1000,\n) => new BatchTracker(batchEventEmitter, logger, batchLengthThreshold, batchCountSamplingRate);\n"]}
@@ -47,6 +47,7 @@ export declare enum PendingBlobStatus {
47
47
  export interface IPendingBlobs {
48
48
  [id: string]: {
49
49
  blob: string;
50
+ storageId?: string;
50
51
  uploadTime?: number;
51
52
  minTTLInSeconds?: number;
52
53
  attached?: boolean;
@@ -109,6 +110,7 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
109
110
  sendBlobAttachOp: (localId: string, storageId?: string) => void, blobRequested: (blobPath: string) => void, isBlobDeleted: (blobPath: string) => boolean, runtime: IBlobManagerRuntime, stashedBlobs: IPendingBlobs | undefined, closeContainer: (error?: ICriticalContainerError) => void);
110
111
  private get pendingOfflineUploads();
111
112
  get hasPendingOfflineUploads(): boolean;
113
+ get allBlobsAttached(): boolean;
112
114
  get hasPendingBlobs(): boolean;
113
115
  private createAbortError;
114
116
  /**
@@ -120,6 +122,7 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
120
122
  * again
121
123
  */
122
124
  private onDisconnected;
125
+ private shutdownPendingBlobs;
123
126
  /**
124
127
  * Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is
125
128
  * detached or there are no (non-pending) attachment blobs in the document
@@ -202,6 +205,6 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
202
205
  */
203
206
  private verifyBlobValidity;
204
207
  setRedirectTable(table: Map<string, string>): void;
205
- getPendingBlobs(): IPendingBlobs;
208
+ getPendingBlobs(waitBlobsToAttach?: boolean): Promise<IPendingBlobs>;
206
209
  }
207
210
  //# sourceMappingURL=blobManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blobManager.d.ts","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAEN,yBAAyB,EACzB,aAAa,EACb,MAAM,sCAAsC,CAAC;AAO9C,OAAO,EAKN,iBAAiB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,iBAAiB,EACjB,uBAAuB,EACvB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAe,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAO7F,OAAO,EACN,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAA8B,MAAM,oBAAoB,CAAC;AAMlF;;;;;;GAMG;AACH,qBAAa,UAAW,YAAW,YAAY,CAAC,eAAe,CAAC;aAc9C,IAAI,EAAE,MAAM;aACZ,YAAY,EAAE,mBAAmB;IAC1C,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IAhBhC,OAAO,CAAC,QAAQ,CAAkB;IAElC,IAAW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BxD;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAiDnB,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAoBrC,eAAe,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;CAiBjF"}
@@ -38,10 +38,9 @@ class BlobHandle {
38
38
  return this.routeContext.isAttached && this.attached;
39
39
  }
40
40
  attachGraph() {
41
- var _a;
42
41
  if (!this.attached) {
43
42
  this.attached = true;
44
- (_a = this.onAttachGraph) === null || _a === void 0 ? void 0 : _a.call(this);
43
+ this.onAttachGraph?.();
45
44
  }
46
45
  }
47
46
  bind(handle) {
@@ -137,6 +136,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
137
136
  const blob = (0, common_utils_1.stringToBuffer)(entry.blob, "base64");
138
137
  const attached = entry.attached;
139
138
  const acked = entry.acked;
139
+ const storageId = entry.storageId; // entry.storageId = response.id
140
140
  if (entry.minTTLInSeconds && entry.uploadTime) {
141
141
  const timeLapseSinceLocalUpload = (Date.now() - entry.uploadTime) / 1000;
142
142
  // stashed entries with more than half-life in storage will not be reuploaded
@@ -145,6 +145,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
145
145
  blob,
146
146
  status: PendingBlobStatus.OfflinePendingOp,
147
147
  handleP: new common_utils_1.Deferred(),
148
+ storageId,
148
149
  uploadP: undefined,
149
150
  uploadTime: entry.uploadTime,
150
151
  minTTLInSeconds: entry.minTTLInSeconds,
@@ -167,7 +168,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
167
168
  const pendingEntry = this.pendingBlobs.get(localId);
168
169
  (0, common_utils_1.assert)(pendingEntry !== undefined, 0x725 /* Must have pending blob entry for upcoming op */);
169
170
  pendingEntry.opsent = true;
170
- if ((pendingEntry === null || pendingEntry === void 0 ? void 0 : pendingEntry.uploadTime) && (pendingEntry === null || pendingEntry === void 0 ? void 0 : pendingEntry.minTTLInSeconds)) {
171
+ if (pendingEntry?.uploadTime && pendingEntry?.minTTLInSeconds) {
171
172
  const secondsSinceUpload = (Date.now() - pendingEntry.uploadTime) / 1000;
172
173
  const expired = pendingEntry.minTTLInSeconds - secondsSinceUpload < 0;
173
174
  this.mc.logger.sendTelemetryEvent({
@@ -196,15 +197,23 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
196
197
  get hasPendingOfflineUploads() {
197
198
  return this.pendingOfflineUploads.length > 0;
198
199
  }
200
+ get allBlobsAttached() {
201
+ for (const [, entry] of this.pendingBlobs) {
202
+ if (entry.attached === false) {
203
+ return false;
204
+ }
205
+ }
206
+ return true;
207
+ }
199
208
  get hasPendingBlobs() {
200
209
  return ((this.runtime.attachState !== container_definitions_1.AttachState.Attached && this.redirectTable.size > 0) ||
201
210
  this.pendingBlobs.size > 0);
202
211
  }
203
212
  createAbortError(pending) {
204
213
  return new telemetry_utils_1.LoggingError("uploadBlob aborted", {
205
- acked: pending === null || pending === void 0 ? void 0 : pending.acked,
206
- status: pending === null || pending === void 0 ? void 0 : pending.status,
207
- uploadTime: pending === null || pending === void 0 ? void 0 : pending.uploadTime,
214
+ acked: pending?.acked,
215
+ status: pending?.status,
216
+ uploadTime: pending?.uploadTime,
208
217
  });
209
218
  }
210
219
  /**
@@ -231,6 +240,29 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
231
240
  }
232
241
  }
233
242
  }
243
+ async shutdownPendingBlobs() {
244
+ for (const [localId, entry] of this.pendingBlobs) {
245
+ if (entry.status === PendingBlobStatus.OnlinePendingUpload) {
246
+ this.sendBlobAttachOp(localId, entry.storageId);
247
+ entry.status = PendingBlobStatus.OfflinePendingUpload;
248
+ entry.handleP.resolve(this.getBlobHandle(localId));
249
+ }
250
+ else if (entry.status === PendingBlobStatus.OnlinePendingOp) {
251
+ entry.status = PendingBlobStatus.OfflinePendingOp;
252
+ entry.handleP.resolve(this.getBlobHandle(localId));
253
+ }
254
+ }
255
+ return new Promise((resolve) => {
256
+ if (this.allBlobsAttached) {
257
+ resolve();
258
+ }
259
+ else {
260
+ this.once("allBlobsAttached", () => {
261
+ resolve();
262
+ });
263
+ }
264
+ });
265
+ }
234
266
  /**
235
267
  * Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is
236
268
  * detached or there are no (non-pending) attachment blobs in the document
@@ -278,6 +310,9 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
278
310
  ? () => {
279
311
  pending.attached = true;
280
312
  this.deletePendingBlobMaybe(id);
313
+ if (this.allBlobsAttached) {
314
+ this.emit("allBlobsAttached");
315
+ }
281
316
  }
282
317
  : undefined;
283
318
  return new BlobHandle(`${BlobManager.basePath}/${id}`, this.routeContext, async () => this.getBlob(id), callback);
@@ -299,7 +334,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
299
334
  await new Promise((resolve) => this.runtime.once("attached", resolve));
300
335
  }
301
336
  (0, common_utils_1.assert)(this.runtime.attachState === container_definitions_1.AttachState.Attached, 0x385 /* For clarity and paranoid defense against adding future attachment states */);
302
- if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
337
+ if (signal?.aborted) {
303
338
  throw this.createAbortError();
304
339
  }
305
340
  // Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to
@@ -321,9 +356,9 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
321
356
  pendingEntry.handleP.reject(this.createAbortError(pendingEntry));
322
357
  }
323
358
  };
324
- signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener, { once: true });
359
+ signal?.addEventListener("abort", abortListener, { once: true });
325
360
  return pendingEntry.handleP.promise.finally(() => {
326
- signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
361
+ signal?.removeEventListener("abort", abortListener);
327
362
  });
328
363
  }
329
364
  async uploadBlob(localId, blob) {
@@ -339,7 +374,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
339
374
  deletePendingBlobMaybe(id) {
340
375
  if (this.pendingBlobs.has(id)) {
341
376
  const entry = this.pendingBlobs.get(id);
342
- if ((entry === null || entry === void 0 ? void 0 : entry.attached) && (entry === null || entry === void 0 ? void 0 : entry.acked)) {
377
+ if (entry?.attached && entry?.acked) {
343
378
  this.deletePendingBlob(id);
344
379
  }
345
380
  }
@@ -350,10 +385,9 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
350
385
  }
351
386
  }
352
387
  onUploadResolve(localId, response) {
353
- var _a, _b;
354
388
  const entry = this.pendingBlobs.get(localId);
355
389
  (0, common_utils_1.assert)(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);
356
- if (((_a = entry.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) === true && !entry.opsent) {
390
+ if (entry.abortSignal?.aborted === true && !entry.opsent) {
357
391
  this.deletePendingBlob(localId);
358
392
  return;
359
393
  }
@@ -382,7 +416,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
382
416
  // If there is already an op for this storage ID, append the local ID to the list. Once any op for
383
417
  // this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the
384
418
  // blob alive in storage.
385
- this.opsInFlight.set(response.id, ((_b = this.opsInFlight.get(response.id)) !== null && _b !== void 0 ? _b : []).concat(localId));
419
+ this.opsInFlight.set(response.id, (this.opsInFlight.get(response.id) ?? []).concat(localId));
386
420
  entry.status = PendingBlobStatus.OnlinePendingOp;
387
421
  }
388
422
  }
@@ -402,10 +436,9 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
402
436
  return response;
403
437
  }
404
438
  async onUploadReject(localId, error) {
405
- var _a;
406
439
  const entry = this.pendingBlobs.get(localId);
407
440
  (0, common_utils_1.assert)(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);
408
- if (((_a = entry.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) === true && !entry.opsent) {
441
+ if (entry.abortSignal?.aborted === true && !entry.opsent) {
409
442
  this.deletePendingBlob(localId);
410
443
  return;
411
444
  }
@@ -457,19 +490,18 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
457
490
  const pendingEntry = this.pendingBlobs.get(localId);
458
491
  if (!blobId) {
459
492
  // We submitted this op while offline. The blob should have been uploaded by now.
460
- (0, common_utils_1.assert)((pendingEntry === null || pendingEntry === void 0 ? void 0 : pendingEntry.status) === PendingBlobStatus.OfflinePendingOp &&
461
- !!(pendingEntry === null || pendingEntry === void 0 ? void 0 : pendingEntry.storageId), 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);
462
- return this.sendBlobAttachOp(localId, pendingEntry.storageId);
493
+ (0, common_utils_1.assert)(pendingEntry?.status === PendingBlobStatus.OfflinePendingOp &&
494
+ !!pendingEntry?.storageId, 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);
495
+ return this.sendBlobAttachOp(localId, pendingEntry?.storageId);
463
496
  }
464
497
  return this.sendBlobAttachOp(localId, blobId);
465
498
  }
466
499
  processBlobAttachOp(message, local) {
467
- var _a, _b, _c;
468
- const localId = (_a = message.metadata) === null || _a === void 0 ? void 0 : _a.localId;
469
- const blobId = (_b = message.metadata) === null || _b === void 0 ? void 0 : _b.blobId;
500
+ const localId = message.metadata?.localId;
501
+ const blobId = message.metadata?.blobId;
470
502
  if (localId) {
471
503
  const pendingEntry = this.pendingBlobs.get(localId);
472
- if ((_c = pendingEntry === null || pendingEntry === void 0 ? void 0 : pendingEntry.abortSignal) === null || _c === void 0 ? void 0 : _c.aborted) {
504
+ if (pendingEntry?.abortSignal?.aborted) {
473
505
  this.deletePendingBlob(localId);
474
506
  return;
475
507
  }
@@ -537,11 +569,10 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
537
569
  * Load a set of previously attached blob IDs and redirect table from a previous snapshot.
538
570
  */
539
571
  load(snapshot) {
540
- var _a, _b, _c;
541
572
  this.mc.logger.sendTelemetryEvent({
542
573
  eventName: "AttachmentBlobsLoaded",
543
- count: (_b = (_a = snapshot.ids) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0,
544
- redirectTable: (_c = snapshot.redirectTable) === null || _c === void 0 ? void 0 : _c.length,
574
+ count: snapshot.ids?.length ?? 0,
575
+ redirectTable: snapshot.redirectTable?.length,
545
576
  });
546
577
  const table = new Map(snapshot.redirectTable);
547
578
  if (snapshot.ids) {
@@ -728,11 +759,15 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
728
759
  this.setRedirection(storageId, storageId);
729
760
  }
730
761
  }
731
- getPendingBlobs() {
762
+ async getPendingBlobs(waitBlobsToAttach) {
763
+ if (waitBlobsToAttach) {
764
+ await this.shutdownPendingBlobs();
765
+ }
732
766
  const blobs = {};
733
767
  for (const [key, entry] of this.pendingBlobs) {
734
768
  blobs[key] = {
735
769
  blob: (0, common_utils_1.bufferToString)(entry.blob, "base64"),
770
+ storageId: entry.storageId,
736
771
  attached: entry.attached,
737
772
  acked: entry.acked,
738
773
  minTTLInSeconds: entry.minTTLInSeconds,