@fluid-experimental/tree 2.0.0-rc.2.0.1 → 2.0.0-rc.3.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 (571) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-report/experimental-tree.api.md +2 -2
  3. package/dist/ChangeCompression.d.ts +2 -2
  4. package/dist/ChangeCompression.d.ts.map +1 -1
  5. package/dist/ChangeCompression.js +1 -1
  6. package/dist/ChangeCompression.js.map +1 -1
  7. package/dist/ChangeTypes.d.ts +1 -1
  8. package/dist/ChangeTypes.d.ts.map +1 -1
  9. package/dist/ChangeTypes.js +4 -4
  10. package/dist/ChangeTypes.js.map +1 -1
  11. package/dist/Checkout.d.ts +3 -3
  12. package/dist/Checkout.d.ts.map +1 -1
  13. package/dist/Checkout.js +17 -17
  14. package/dist/Checkout.js.map +1 -1
  15. package/dist/EditLog.d.ts +1 -1
  16. package/dist/EditLog.d.ts.map +1 -1
  17. package/dist/EditLog.js +9 -9
  18. package/dist/EditLog.js.map +1 -1
  19. package/dist/EditUtilities.d.ts +3 -3
  20. package/dist/EditUtilities.d.ts.map +1 -1
  21. package/dist/EditUtilities.js +6 -6
  22. package/dist/EditUtilities.js.map +1 -1
  23. package/dist/Forest.d.ts.map +1 -1
  24. package/dist/Forest.js +23 -23
  25. package/dist/Forest.js.map +1 -1
  26. package/dist/HistoryEditFactory.d.ts +1 -1
  27. package/dist/HistoryEditFactory.d.ts.map +1 -1
  28. package/dist/HistoryEditFactory.js +7 -7
  29. package/dist/HistoryEditFactory.js.map +1 -1
  30. package/dist/IdConversion.d.ts.map +1 -1
  31. package/dist/IdConversion.js.map +1 -1
  32. package/dist/LogViewer.d.ts +2 -2
  33. package/dist/LogViewer.d.ts.map +1 -1
  34. package/dist/LogViewer.js +7 -7
  35. package/dist/LogViewer.js.map +1 -1
  36. package/dist/MergeHealth.d.ts.map +1 -1
  37. package/dist/MergeHealth.js +1 -1
  38. package/dist/MergeHealth.js.map +1 -1
  39. package/dist/NodeIdUtilities.d.ts +1 -1
  40. package/dist/NodeIdUtilities.d.ts.map +1 -1
  41. package/dist/NodeIdUtilities.js +1 -1
  42. package/dist/NodeIdUtilities.js.map +1 -1
  43. package/dist/PayloadUtilities.d.ts.map +1 -1
  44. package/dist/PayloadUtilities.js +2 -2
  45. package/dist/PayloadUtilities.js.map +1 -1
  46. package/dist/ReconciliationPath.d.ts +1 -1
  47. package/dist/ReconciliationPath.d.ts.map +1 -1
  48. package/dist/ReconciliationPath.js.map +1 -1
  49. package/dist/RevisionValueCache.d.ts.map +1 -1
  50. package/dist/RevisionValueCache.js +2 -2
  51. package/dist/RevisionValueCache.js.map +1 -1
  52. package/dist/RevisionView.d.ts +2 -2
  53. package/dist/RevisionView.d.ts.map +1 -1
  54. package/dist/RevisionView.js.map +1 -1
  55. package/dist/SerializationUtilities.d.ts +1 -1
  56. package/dist/SerializationUtilities.d.ts.map +1 -1
  57. package/dist/SerializationUtilities.js.map +1 -1
  58. package/dist/SharedTree.d.ts +8 -7
  59. package/dist/SharedTree.d.ts.map +1 -1
  60. package/dist/SharedTree.js +78 -78
  61. package/dist/SharedTree.js.map +1 -1
  62. package/dist/SharedTreeEncoder.d.ts +1 -1
  63. package/dist/SharedTreeEncoder.d.ts.map +1 -1
  64. package/dist/SharedTreeEncoder.js +31 -31
  65. package/dist/SharedTreeEncoder.js.map +1 -1
  66. package/dist/Summary.d.ts +2 -2
  67. package/dist/Summary.d.ts.map +1 -1
  68. package/dist/Summary.js +2 -2
  69. package/dist/Summary.js.map +1 -1
  70. package/dist/SummaryBackCompatibility.d.ts.map +1 -1
  71. package/dist/SummaryBackCompatibility.js.map +1 -1
  72. package/dist/SummaryTestUtilities.d.ts +1 -1
  73. package/dist/SummaryTestUtilities.d.ts.map +1 -1
  74. package/dist/SummaryTestUtilities.js.map +1 -1
  75. package/dist/Transaction.d.ts +3 -3
  76. package/dist/Transaction.d.ts.map +1 -1
  77. package/dist/Transaction.js +3 -3
  78. package/dist/Transaction.js.map +1 -1
  79. package/dist/TransactionInternal.d.ts +3 -3
  80. package/dist/TransactionInternal.d.ts.map +1 -1
  81. package/dist/TransactionInternal.js +6 -6
  82. package/dist/TransactionInternal.js.map +1 -1
  83. package/dist/TreeCompressor.d.ts +5 -1
  84. package/dist/TreeCompressor.d.ts.map +1 -1
  85. package/dist/TreeCompressor.js +5 -5
  86. package/dist/TreeCompressor.js.map +1 -1
  87. package/dist/TreeNodeHandle.d.ts +1 -1
  88. package/dist/TreeNodeHandle.d.ts.map +1 -1
  89. package/dist/TreeNodeHandle.js.map +1 -1
  90. package/dist/TreeView.d.ts +1 -1
  91. package/dist/TreeView.d.ts.map +1 -1
  92. package/dist/TreeView.js +2 -3
  93. package/dist/TreeView.js.map +1 -1
  94. package/dist/UuidUtilities.d.ts.map +1 -1
  95. package/dist/UuidUtilities.js.map +1 -1
  96. package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
  97. package/dist/id-compressor/AppendOnlySortedMap.js +3 -3
  98. package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
  99. package/dist/id-compressor/IdCompressor.d.ts +1 -1
  100. package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
  101. package/dist/id-compressor/IdCompressor.js +25 -26
  102. package/dist/id-compressor/IdCompressor.js.map +1 -1
  103. package/dist/id-compressor/IdRange.d.ts.map +1 -1
  104. package/dist/id-compressor/IdRange.js +2 -2
  105. package/dist/id-compressor/IdRange.js.map +1 -1
  106. package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
  107. package/dist/id-compressor/NumericUuid.js +2 -1
  108. package/dist/id-compressor/NumericUuid.js.map +1 -1
  109. package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
  110. package/dist/id-compressor/SessionIdNormalizer.js +8 -9
  111. package/dist/id-compressor/SessionIdNormalizer.js.map +1 -1
  112. package/dist/migration-shim/migrationDeltaHandler.d.ts +1 -1
  113. package/dist/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
  114. package/dist/migration-shim/migrationDeltaHandler.js +11 -11
  115. package/dist/migration-shim/migrationDeltaHandler.js.map +1 -1
  116. package/dist/migration-shim/migrationShim.d.ts +8 -4
  117. package/dist/migration-shim/migrationShim.d.ts.map +1 -1
  118. package/dist/migration-shim/migrationShim.js +13 -13
  119. package/dist/migration-shim/migrationShim.js.map +1 -1
  120. package/dist/migration-shim/migrationShimFactory.d.ts +2 -2
  121. package/dist/migration-shim/migrationShimFactory.d.ts.map +1 -1
  122. package/dist/migration-shim/migrationShimFactory.js +2 -2
  123. package/dist/migration-shim/migrationShimFactory.js.map +1 -1
  124. package/dist/migration-shim/packageVersion.d.ts +0 -2
  125. package/dist/migration-shim/packageVersion.d.ts.map +1 -1
  126. package/dist/migration-shim/packageVersion.js +0 -2
  127. package/dist/migration-shim/packageVersion.js.map +1 -1
  128. package/dist/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
  129. package/dist/migration-shim/sharedTreeDeltaHandler.js +8 -8
  130. package/dist/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
  131. package/dist/migration-shim/sharedTreeShim.d.ts +2 -2
  132. package/dist/migration-shim/sharedTreeShim.d.ts.map +1 -1
  133. package/dist/migration-shim/sharedTreeShim.js +8 -4
  134. package/dist/migration-shim/sharedTreeShim.js.map +1 -1
  135. package/dist/migration-shim/sharedTreeShimFactory.d.ts +1 -1
  136. package/dist/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
  137. package/dist/migration-shim/sharedTreeShimFactory.js +2 -2
  138. package/dist/migration-shim/sharedTreeShimFactory.js.map +1 -1
  139. package/dist/migration-shim/shimChannelServices.d.ts +1 -1
  140. package/dist/migration-shim/shimChannelServices.d.ts.map +1 -1
  141. package/dist/migration-shim/shimChannelServices.js.map +1 -1
  142. package/dist/migration-shim/shimDeltaConnection.d.ts +1 -1
  143. package/dist/migration-shim/shimDeltaConnection.d.ts.map +1 -1
  144. package/dist/migration-shim/shimDeltaConnection.js +2 -2
  145. package/dist/migration-shim/shimDeltaConnection.js.map +1 -1
  146. package/dist/migration-shim/shimHandle.d.ts.map +1 -1
  147. package/dist/migration-shim/shimHandle.js.map +1 -1
  148. package/dist/migration-shim/types.d.ts +1 -1
  149. package/dist/migration-shim/types.d.ts.map +1 -1
  150. package/dist/migration-shim/types.js.map +1 -1
  151. package/dist/migration-shim/utils.d.ts +1 -1
  152. package/dist/migration-shim/utils.d.ts.map +1 -1
  153. package/dist/migration-shim/utils.js.map +1 -1
  154. package/dist/persisted-types/0.0.2.d.ts +1 -1
  155. package/dist/persisted-types/0.0.2.d.ts.map +1 -1
  156. package/dist/persisted-types/0.0.2.js.map +1 -1
  157. package/dist/persisted-types/0.1.1.d.ts +1 -1
  158. package/dist/persisted-types/0.1.1.d.ts.map +1 -1
  159. package/dist/persisted-types/0.1.1.js +3 -3
  160. package/dist/persisted-types/0.1.1.js.map +1 -1
  161. package/lib/ChangeCompression.d.ts +2 -2
  162. package/lib/ChangeCompression.d.ts.map +1 -1
  163. package/lib/ChangeCompression.js +1 -1
  164. package/lib/ChangeCompression.js.map +1 -1
  165. package/lib/ChangeTypes.d.ts +1 -1
  166. package/lib/ChangeTypes.d.ts.map +1 -1
  167. package/lib/ChangeTypes.js +2 -2
  168. package/lib/ChangeTypes.js.map +1 -1
  169. package/lib/Checkout.d.ts +3 -3
  170. package/lib/Checkout.d.ts.map +1 -1
  171. package/lib/Checkout.js +4 -4
  172. package/lib/Checkout.js.map +1 -1
  173. package/lib/EditLog.d.ts +1 -1
  174. package/lib/EditLog.d.ts.map +1 -1
  175. package/lib/EditLog.js +2 -2
  176. package/lib/EditLog.js.map +1 -1
  177. package/lib/EditUtilities.d.ts +3 -3
  178. package/lib/EditUtilities.d.ts.map +1 -1
  179. package/lib/EditUtilities.js +5 -5
  180. package/lib/EditUtilities.js.map +1 -1
  181. package/lib/Forest.d.ts.map +1 -1
  182. package/lib/Forest.js +2 -2
  183. package/lib/Forest.js.map +1 -1
  184. package/lib/HistoryEditFactory.d.ts +1 -1
  185. package/lib/HistoryEditFactory.d.ts.map +1 -1
  186. package/lib/HistoryEditFactory.js +5 -5
  187. package/lib/HistoryEditFactory.js.map +1 -1
  188. package/lib/IdConversion.d.ts.map +1 -1
  189. package/lib/IdConversion.js.map +1 -1
  190. package/lib/LogViewer.d.ts +2 -2
  191. package/lib/LogViewer.d.ts.map +1 -1
  192. package/lib/LogViewer.js +3 -3
  193. package/lib/LogViewer.js.map +1 -1
  194. package/lib/MergeHealth.d.ts.map +1 -1
  195. package/lib/MergeHealth.js +1 -1
  196. package/lib/MergeHealth.js.map +1 -1
  197. package/lib/NodeIdUtilities.d.ts +1 -1
  198. package/lib/NodeIdUtilities.d.ts.map +1 -1
  199. package/lib/NodeIdUtilities.js +1 -1
  200. package/lib/NodeIdUtilities.js.map +1 -1
  201. package/lib/PayloadUtilities.d.ts.map +1 -1
  202. package/lib/PayloadUtilities.js +1 -1
  203. package/lib/PayloadUtilities.js.map +1 -1
  204. package/lib/ReconciliationPath.d.ts +1 -1
  205. package/lib/ReconciliationPath.d.ts.map +1 -1
  206. package/lib/ReconciliationPath.js.map +1 -1
  207. package/lib/RevisionValueCache.d.ts.map +1 -1
  208. package/lib/RevisionValueCache.js +2 -2
  209. package/lib/RevisionValueCache.js.map +1 -1
  210. package/lib/RevisionView.d.ts +2 -2
  211. package/lib/RevisionView.d.ts.map +1 -1
  212. package/lib/RevisionView.js.map +1 -1
  213. package/lib/SerializationUtilities.d.ts +1 -1
  214. package/lib/SerializationUtilities.d.ts.map +1 -1
  215. package/lib/SerializationUtilities.js.map +1 -1
  216. package/lib/SharedTree.d.ts +8 -7
  217. package/lib/SharedTree.d.ts.map +1 -1
  218. package/lib/SharedTree.js +13 -13
  219. package/lib/SharedTree.js.map +1 -1
  220. package/lib/SharedTreeEncoder.d.ts +1 -1
  221. package/lib/SharedTreeEncoder.d.ts.map +1 -1
  222. package/lib/SharedTreeEncoder.js +5 -5
  223. package/lib/SharedTreeEncoder.js.map +1 -1
  224. package/lib/Summary.d.ts +2 -2
  225. package/lib/Summary.d.ts.map +1 -1
  226. package/lib/Summary.js +1 -1
  227. package/lib/Summary.js.map +1 -1
  228. package/lib/SummaryBackCompatibility.d.ts.map +1 -1
  229. package/lib/SummaryBackCompatibility.js.map +1 -1
  230. package/lib/SummaryTestUtilities.d.ts +1 -1
  231. package/lib/SummaryTestUtilities.d.ts.map +1 -1
  232. package/lib/SummaryTestUtilities.js.map +1 -1
  233. package/lib/Transaction.d.ts +3 -3
  234. package/lib/Transaction.d.ts.map +1 -1
  235. package/lib/Transaction.js +3 -3
  236. package/lib/Transaction.js.map +1 -1
  237. package/lib/TransactionInternal.d.ts +3 -3
  238. package/lib/TransactionInternal.d.ts.map +1 -1
  239. package/lib/TransactionInternal.js +3 -3
  240. package/lib/TransactionInternal.js.map +1 -1
  241. package/lib/TreeCompressor.d.ts +5 -1
  242. package/lib/TreeCompressor.d.ts.map +1 -1
  243. package/lib/TreeCompressor.js +2 -2
  244. package/lib/TreeCompressor.js.map +1 -1
  245. package/lib/TreeNodeHandle.d.ts +1 -1
  246. package/lib/TreeNodeHandle.d.ts.map +1 -1
  247. package/lib/TreeNodeHandle.js.map +1 -1
  248. package/lib/TreeView.d.ts +1 -1
  249. package/lib/TreeView.d.ts.map +1 -1
  250. package/lib/TreeView.js +1 -2
  251. package/lib/TreeView.js.map +1 -1
  252. package/lib/UuidUtilities.d.ts.map +1 -1
  253. package/lib/UuidUtilities.js +1 -1
  254. package/lib/UuidUtilities.js.map +1 -1
  255. package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
  256. package/lib/id-compressor/AppendOnlySortedMap.js +1 -1
  257. package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
  258. package/lib/id-compressor/IdCompressor.d.ts +1 -1
  259. package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
  260. package/lib/id-compressor/IdCompressor.js +4 -5
  261. package/lib/id-compressor/IdCompressor.js.map +1 -1
  262. package/lib/id-compressor/IdRange.d.ts.map +1 -1
  263. package/lib/id-compressor/IdRange.js +1 -1
  264. package/lib/id-compressor/IdRange.js.map +1 -1
  265. package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
  266. package/lib/id-compressor/NumericUuid.js +2 -1
  267. package/lib/id-compressor/NumericUuid.js.map +1 -1
  268. package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
  269. package/lib/id-compressor/SessionIdNormalizer.js +1 -2
  270. package/lib/id-compressor/SessionIdNormalizer.js.map +1 -1
  271. package/lib/migration-shim/migrationDeltaHandler.d.ts +1 -1
  272. package/lib/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
  273. package/lib/migration-shim/migrationDeltaHandler.js +1 -1
  274. package/lib/migration-shim/migrationDeltaHandler.js.map +1 -1
  275. package/lib/migration-shim/migrationShim.d.ts +8 -4
  276. package/lib/migration-shim/migrationShim.d.ts.map +1 -1
  277. package/lib/migration-shim/migrationShim.js +3 -3
  278. package/lib/migration-shim/migrationShim.js.map +1 -1
  279. package/lib/migration-shim/migrationShimFactory.d.ts +2 -2
  280. package/lib/migration-shim/migrationShimFactory.d.ts.map +1 -1
  281. package/lib/migration-shim/migrationShimFactory.js +1 -1
  282. package/lib/migration-shim/migrationShimFactory.js.map +1 -1
  283. package/lib/migration-shim/packageVersion.d.ts +0 -2
  284. package/lib/migration-shim/packageVersion.d.ts.map +1 -1
  285. package/lib/migration-shim/packageVersion.js +0 -2
  286. package/lib/migration-shim/packageVersion.js.map +1 -1
  287. package/lib/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
  288. package/lib/migration-shim/sharedTreeDeltaHandler.js +1 -1
  289. package/lib/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
  290. package/lib/migration-shim/sharedTreeShim.d.ts +2 -2
  291. package/lib/migration-shim/sharedTreeShim.d.ts.map +1 -1
  292. package/lib/migration-shim/sharedTreeShim.js +6 -2
  293. package/lib/migration-shim/sharedTreeShim.js.map +1 -1
  294. package/lib/migration-shim/sharedTreeShimFactory.d.ts +1 -1
  295. package/lib/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
  296. package/lib/migration-shim/sharedTreeShimFactory.js +1 -1
  297. package/lib/migration-shim/sharedTreeShimFactory.js.map +1 -1
  298. package/lib/migration-shim/shimChannelServices.d.ts +1 -1
  299. package/lib/migration-shim/shimChannelServices.d.ts.map +1 -1
  300. package/lib/migration-shim/shimChannelServices.js.map +1 -1
  301. package/lib/migration-shim/shimDeltaConnection.d.ts +1 -1
  302. package/lib/migration-shim/shimDeltaConnection.d.ts.map +1 -1
  303. package/lib/migration-shim/shimDeltaConnection.js +1 -1
  304. package/lib/migration-shim/shimDeltaConnection.js.map +1 -1
  305. package/lib/migration-shim/shimHandle.d.ts.map +1 -1
  306. package/lib/migration-shim/shimHandle.js.map +1 -1
  307. package/lib/migration-shim/types.d.ts +1 -1
  308. package/lib/migration-shim/types.d.ts.map +1 -1
  309. package/lib/migration-shim/types.js.map +1 -1
  310. package/lib/migration-shim/utils.d.ts +1 -1
  311. package/lib/migration-shim/utils.d.ts.map +1 -1
  312. package/lib/migration-shim/utils.js.map +1 -1
  313. package/lib/persisted-types/0.0.2.d.ts +1 -1
  314. package/lib/persisted-types/0.0.2.d.ts.map +1 -1
  315. package/lib/persisted-types/0.0.2.js.map +1 -1
  316. package/lib/persisted-types/0.1.1.d.ts +1 -1
  317. package/lib/persisted-types/0.1.1.d.ts.map +1 -1
  318. package/lib/persisted-types/0.1.1.js +1 -1
  319. package/lib/persisted-types/0.1.1.js.map +1 -1
  320. package/package.json +33 -32
  321. package/src/ChangeCompression.ts +8 -8
  322. package/src/ChangeTypes.ts +5 -4
  323. package/src/Checkout.ts +9 -7
  324. package/src/EditLog.ts +4 -3
  325. package/src/EditUtilities.ts +9 -8
  326. package/src/Forest.ts +3 -2
  327. package/src/HistoryEditFactory.ts +12 -11
  328. package/src/IdConversion.ts +2 -2
  329. package/src/LogViewer.ts +5 -4
  330. package/src/MergeHealth.ts +2 -1
  331. package/src/NodeIdUtilities.ts +2 -2
  332. package/src/PayloadUtilities.ts +2 -1
  333. package/src/ReconciliationPath.ts +1 -1
  334. package/src/RevisionValueCache.ts +3 -2
  335. package/src/RevisionView.ts +3 -3
  336. package/src/SerializationUtilities.ts +1 -1
  337. package/src/SharedTree.ts +46 -49
  338. package/src/SharedTreeEncoder.ts +30 -29
  339. package/src/Summary.ts +5 -3
  340. package/src/SummaryBackCompatibility.ts +1 -0
  341. package/src/SummaryTestUtilities.ts +2 -1
  342. package/src/Transaction.ts +7 -6
  343. package/src/TransactionInternal.ts +17 -16
  344. package/src/TreeCompressor.ts +6 -4
  345. package/src/TreeNodeHandle.ts +2 -2
  346. package/src/TreeView.ts +3 -3
  347. package/src/UuidUtilities.ts +2 -1
  348. package/src/id-compressor/AppendOnlySortedMap.ts +2 -1
  349. package/src/id-compressor/IdCompressor.ts +18 -17
  350. package/src/id-compressor/IdRange.ts +2 -1
  351. package/src/id-compressor/NumericUuid.ts +1 -1
  352. package/src/id-compressor/SessionIdNormalizer.ts +3 -3
  353. package/src/migration-shim/migrationDeltaHandler.ts +3 -2
  354. package/src/migration-shim/migrationShim.ts +14 -10
  355. package/src/migration-shim/migrationShimFactory.ts +6 -4
  356. package/src/migration-shim/packageVersion.ts +0 -2
  357. package/src/migration-shim/sharedTreeDeltaHandler.ts +3 -2
  358. package/src/migration-shim/sharedTreeShim.ts +7 -5
  359. package/src/migration-shim/sharedTreeShimFactory.ts +3 -3
  360. package/src/migration-shim/shimChannelServices.ts +1 -1
  361. package/src/migration-shim/shimDeltaConnection.ts +3 -2
  362. package/src/migration-shim/shimHandle.ts +1 -0
  363. package/src/migration-shim/types.ts +3 -1
  364. package/src/migration-shim/utils.ts +2 -1
  365. package/src/persisted-types/0.0.2.ts +2 -2
  366. package/src/persisted-types/0.1.1.ts +10 -8
  367. package/dist/tree-alpha.d.ts +0 -2901
  368. package/dist/tree-beta.d.ts +0 -348
  369. package/dist/tree-public.d.ts +0 -348
  370. package/dist/tree-untrimmed.d.ts +0 -3820
  371. package/lib/test/AppendOnlySortedMap.perf.tests.d.ts +0 -6
  372. package/lib/test/AppendOnlySortedMap.perf.tests.d.ts.map +0 -1
  373. package/lib/test/AppendOnlySortedMap.perf.tests.js +0 -49
  374. package/lib/test/AppendOnlySortedMap.perf.tests.js.map +0 -1
  375. package/lib/test/AppendOnlySortedMap.tests.d.ts +0 -6
  376. package/lib/test/AppendOnlySortedMap.tests.d.ts.map +0 -1
  377. package/lib/test/AppendOnlySortedMap.tests.js +0 -213
  378. package/lib/test/AppendOnlySortedMap.tests.js.map +0 -1
  379. package/lib/test/ChangeCompression.tests.d.ts +0 -6
  380. package/lib/test/ChangeCompression.tests.d.ts.map +0 -1
  381. package/lib/test/ChangeCompression.tests.js +0 -154
  382. package/lib/test/ChangeCompression.tests.js.map +0 -1
  383. package/lib/test/Checkout.tests.d.ts +0 -10
  384. package/lib/test/Checkout.tests.d.ts.map +0 -1
  385. package/lib/test/Checkout.tests.js +0 -460
  386. package/lib/test/Checkout.tests.js.map +0 -1
  387. package/lib/test/Common.tests.d.ts +0 -6
  388. package/lib/test/Common.tests.d.ts.map +0 -1
  389. package/lib/test/Common.tests.js +0 -102
  390. package/lib/test/Common.tests.js.map +0 -1
  391. package/lib/test/EagerCheckout.tests.d.ts +0 -6
  392. package/lib/test/EagerCheckout.tests.d.ts.map +0 -1
  393. package/lib/test/EagerCheckout.tests.js +0 -20
  394. package/lib/test/EagerCheckout.tests.js.map +0 -1
  395. package/lib/test/Edit.tests.d.ts +0 -6
  396. package/lib/test/Edit.tests.d.ts.map +0 -1
  397. package/lib/test/Edit.tests.js +0 -60
  398. package/lib/test/Edit.tests.js.map +0 -1
  399. package/lib/test/EditLog.perf.tests.d.ts +0 -6
  400. package/lib/test/EditLog.perf.tests.d.ts.map +0 -1
  401. package/lib/test/EditLog.perf.tests.js +0 -41
  402. package/lib/test/EditLog.perf.tests.js.map +0 -1
  403. package/lib/test/EditLog.tests.d.ts +0 -6
  404. package/lib/test/EditLog.tests.d.ts.map +0 -1
  405. package/lib/test/EditLog.tests.js +0 -355
  406. package/lib/test/EditLog.tests.js.map +0 -1
  407. package/lib/test/EditUtilities.tests.d.ts +0 -6
  408. package/lib/test/EditUtilities.tests.d.ts.map +0 -1
  409. package/lib/test/EditUtilities.tests.js +0 -512
  410. package/lib/test/EditUtilities.tests.js.map +0 -1
  411. package/lib/test/Forest.perf.tests.d.ts +0 -6
  412. package/lib/test/Forest.perf.tests.d.ts.map +0 -1
  413. package/lib/test/Forest.perf.tests.js +0 -135
  414. package/lib/test/Forest.perf.tests.js.map +0 -1
  415. package/lib/test/Forest.tests.d.ts +0 -6
  416. package/lib/test/Forest.tests.d.ts.map +0 -1
  417. package/lib/test/Forest.tests.js +0 -213
  418. package/lib/test/Forest.tests.js.map +0 -1
  419. package/lib/test/GenericTransaction.tests.d.ts +0 -6
  420. package/lib/test/GenericTransaction.tests.d.ts.map +0 -1
  421. package/lib/test/GenericTransaction.tests.js +0 -31
  422. package/lib/test/GenericTransaction.tests.js.map +0 -1
  423. package/lib/test/HistoryEditFactory.tests.d.ts +0 -6
  424. package/lib/test/HistoryEditFactory.tests.d.ts.map +0 -1
  425. package/lib/test/HistoryEditFactory.tests.js +0 -170
  426. package/lib/test/HistoryEditFactory.tests.js.map +0 -1
  427. package/lib/test/IdCompressor.perf.tests.d.ts +0 -6
  428. package/lib/test/IdCompressor.perf.tests.d.ts.map +0 -1
  429. package/lib/test/IdCompressor.perf.tests.js +0 -290
  430. package/lib/test/IdCompressor.perf.tests.js.map +0 -1
  431. package/lib/test/IdCompressor.tests.d.ts +0 -6
  432. package/lib/test/IdCompressor.tests.d.ts.map +0 -1
  433. package/lib/test/IdCompressor.tests.js +0 -1542
  434. package/lib/test/IdCompressor.tests.js.map +0 -1
  435. package/lib/test/IdConversion.tests.d.ts +0 -6
  436. package/lib/test/IdConversion.tests.d.ts.map +0 -1
  437. package/lib/test/IdConversion.tests.js +0 -36
  438. package/lib/test/IdConversion.tests.js.map +0 -1
  439. package/lib/test/LazyCheckout.tests.d.ts +0 -6
  440. package/lib/test/LazyCheckout.tests.d.ts.map +0 -1
  441. package/lib/test/LazyCheckout.tests.js +0 -22
  442. package/lib/test/LazyCheckout.tests.js.map +0 -1
  443. package/lib/test/LogViewer.tests.d.ts +0 -6
  444. package/lib/test/LogViewer.tests.d.ts.map +0 -1
  445. package/lib/test/LogViewer.tests.js +0 -588
  446. package/lib/test/LogViewer.tests.js.map +0 -1
  447. package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts +0 -6
  448. package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +0 -1
  449. package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +0 -351
  450. package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +0 -1
  451. package/lib/test/NumericUuid.perf.tests.d.ts +0 -6
  452. package/lib/test/NumericUuid.perf.tests.d.ts.map +0 -1
  453. package/lib/test/NumericUuid.perf.tests.js +0 -68
  454. package/lib/test/NumericUuid.perf.tests.js.map +0 -1
  455. package/lib/test/NumericUuid.tests.d.ts +0 -6
  456. package/lib/test/NumericUuid.tests.d.ts.map +0 -1
  457. package/lib/test/NumericUuid.tests.js +0 -192
  458. package/lib/test/NumericUuid.tests.js.map +0 -1
  459. package/lib/test/RevisionValueCache.tests.d.ts +0 -6
  460. package/lib/test/RevisionValueCache.tests.d.ts.map +0 -1
  461. package/lib/test/RevisionValueCache.tests.js +0 -106
  462. package/lib/test/RevisionValueCache.tests.js.map +0 -1
  463. package/lib/test/RevisionView.tests.d.ts +0 -6
  464. package/lib/test/RevisionView.tests.d.ts.map +0 -1
  465. package/lib/test/RevisionView.tests.js +0 -131
  466. package/lib/test/RevisionView.tests.js.map +0 -1
  467. package/lib/test/SessionIdNormalizer.tests.d.ts +0 -6
  468. package/lib/test/SessionIdNormalizer.tests.d.ts.map +0 -1
  469. package/lib/test/SessionIdNormalizer.tests.js +0 -377
  470. package/lib/test/SessionIdNormalizer.tests.js.map +0 -1
  471. package/lib/test/SharedTree.fuzz.tests.d.ts +0 -6
  472. package/lib/test/SharedTree.fuzz.tests.d.ts.map +0 -1
  473. package/lib/test/SharedTree.fuzz.tests.js +0 -9
  474. package/lib/test/SharedTree.fuzz.tests.js.map +0 -1
  475. package/lib/test/SharedTree.perf.tests.d.ts +0 -6
  476. package/lib/test/SharedTree.perf.tests.d.ts.map +0 -1
  477. package/lib/test/SharedTree.perf.tests.js +0 -39
  478. package/lib/test/SharedTree.perf.tests.js.map +0 -1
  479. package/lib/test/SharedTree.tests.d.ts +0 -6
  480. package/lib/test/SharedTree.tests.d.ts.map +0 -1
  481. package/lib/test/SharedTree.tests.js +0 -22
  482. package/lib/test/SharedTree.tests.js.map +0 -1
  483. package/lib/test/StringInterner.tests.d.ts +0 -6
  484. package/lib/test/StringInterner.tests.d.ts.map +0 -1
  485. package/lib/test/StringInterner.tests.js +0 -73
  486. package/lib/test/StringInterner.tests.js.map +0 -1
  487. package/lib/test/Summary.tests.d.ts +0 -7
  488. package/lib/test/Summary.tests.d.ts.map +0 -1
  489. package/lib/test/Summary.tests.js +0 -386
  490. package/lib/test/Summary.tests.js.map +0 -1
  491. package/lib/test/Transaction.tests.d.ts +0 -6
  492. package/lib/test/Transaction.tests.d.ts.map +0 -1
  493. package/lib/test/Transaction.tests.js +0 -124
  494. package/lib/test/Transaction.tests.js.map +0 -1
  495. package/lib/test/TransactionInternal.tests.d.ts +0 -6
  496. package/lib/test/TransactionInternal.tests.d.ts.map +0 -1
  497. package/lib/test/TransactionInternal.tests.js +0 -576
  498. package/lib/test/TransactionInternal.tests.js.map +0 -1
  499. package/lib/test/TreeCompression.tests.d.ts +0 -6
  500. package/lib/test/TreeCompression.tests.d.ts.map +0 -1
  501. package/lib/test/TreeCompression.tests.js +0 -291
  502. package/lib/test/TreeCompression.tests.js.map +0 -1
  503. package/lib/test/TreeView.tests.d.ts +0 -6
  504. package/lib/test/TreeView.tests.d.ts.map +0 -1
  505. package/lib/test/TreeView.tests.js +0 -178
  506. package/lib/test/TreeView.tests.js.map +0 -1
  507. package/lib/test/UndoRedoHandler.tests.d.ts +0 -6
  508. package/lib/test/UndoRedoHandler.tests.d.ts.map +0 -1
  509. package/lib/test/UndoRedoHandler.tests.js +0 -37
  510. package/lib/test/UndoRedoHandler.tests.js.map +0 -1
  511. package/lib/test/fuzz/Generators.d.ts +0 -8
  512. package/lib/test/fuzz/Generators.d.ts.map +0 -1
  513. package/lib/test/fuzz/Generators.js +0 -345
  514. package/lib/test/fuzz/Generators.js.map +0 -1
  515. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +0 -23
  516. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +0 -1
  517. package/lib/test/fuzz/SharedTreeFuzzTests.js +0 -241
  518. package/lib/test/fuzz/SharedTreeFuzzTests.js.map +0 -1
  519. package/lib/test/fuzz/Types.d.ts +0 -136
  520. package/lib/test/fuzz/Types.d.ts.map +0 -1
  521. package/lib/test/fuzz/Types.js +0 -6
  522. package/lib/test/fuzz/Types.js.map +0 -1
  523. package/lib/test/utilities/IdCompressorTestUtilities.d.ts +0 -246
  524. package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +0 -1
  525. package/lib/test/utilities/IdCompressorTestUtilities.js +0 -608
  526. package/lib/test/utilities/IdCompressorTestUtilities.js.map +0 -1
  527. package/lib/test/utilities/MockTransaction.d.ts +0 -35
  528. package/lib/test/utilities/MockTransaction.d.ts.map +0 -1
  529. package/lib/test/utilities/MockTransaction.js +0 -51
  530. package/lib/test/utilities/MockTransaction.js.map +0 -1
  531. package/lib/test/utilities/PendingLocalStateTests.d.ts +0 -12
  532. package/lib/test/utilities/PendingLocalStateTests.d.ts.map +0 -1
  533. package/lib/test/utilities/PendingLocalStateTests.js +0 -223
  534. package/lib/test/utilities/PendingLocalStateTests.js.map +0 -1
  535. package/lib/test/utilities/SharedTreeTests.d.ts +0 -12
  536. package/lib/test/utilities/SharedTreeTests.d.ts.map +0 -1
  537. package/lib/test/utilities/SharedTreeTests.js +0 -949
  538. package/lib/test/utilities/SharedTreeTests.js.map +0 -1
  539. package/lib/test/utilities/SharedTreeVersioningTests.d.ts +0 -11
  540. package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +0 -1
  541. package/lib/test/utilities/SharedTreeVersioningTests.js +0 -439
  542. package/lib/test/utilities/SharedTreeVersioningTests.js.map +0 -1
  543. package/lib/test/utilities/SummaryLoadPerfTests.d.ts +0 -10
  544. package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +0 -1
  545. package/lib/test/utilities/SummaryLoadPerfTests.js +0 -105
  546. package/lib/test/utilities/SummaryLoadPerfTests.js.map +0 -1
  547. package/lib/test/utilities/SummarySizeTests.d.ts +0 -11
  548. package/lib/test/utilities/SummarySizeTests.d.ts.map +0 -1
  549. package/lib/test/utilities/SummarySizeTests.js +0 -160
  550. package/lib/test/utilities/SummarySizeTests.js.map +0 -1
  551. package/lib/test/utilities/TestCommon.d.ts +0 -13
  552. package/lib/test/utilities/TestCommon.d.ts.map +0 -1
  553. package/lib/test/utilities/TestCommon.js +0 -19
  554. package/lib/test/utilities/TestCommon.js.map +0 -1
  555. package/lib/test/utilities/TestNode.d.ts +0 -140
  556. package/lib/test/utilities/TestNode.d.ts.map +0 -1
  557. package/lib/test/utilities/TestNode.js +0 -282
  558. package/lib/test/utilities/TestNode.js.map +0 -1
  559. package/lib/test/utilities/TestSerializer.d.ts +0 -24
  560. package/lib/test/utilities/TestSerializer.d.ts.map +0 -1
  561. package/lib/test/utilities/TestSerializer.js +0 -40
  562. package/lib/test/utilities/TestSerializer.js.map +0 -1
  563. package/lib/test/utilities/TestUtilities.d.ts +0 -212
  564. package/lib/test/utilities/TestUtilities.d.ts.map +0 -1
  565. package/lib/test/utilities/TestUtilities.js +0 -413
  566. package/lib/test/utilities/TestUtilities.js.map +0 -1
  567. package/lib/test/utilities/UndoRedoTests.d.ts +0 -32
  568. package/lib/test/utilities/UndoRedoTests.d.ts.map +0 -1
  569. package/lib/test/utilities/UndoRedoTests.js +0 -317
  570. package/lib/test/utilities/UndoRedoTests.js.map +0 -1
  571. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"IdCompressorTestUtilities.js","sourceRoot":"","sources":["../../../src/test/utilities/IdCompressorTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+BAA+B;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAEN,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,kBAAkB,IAAI,sBAAsB,EAC5C,MAAM,EAEN,IAAI,GAEJ,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAa,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EACN,eAAe,EACf,iBAAiB,EAEjB,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,oCAAoC,CAAC;AAS5C,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAMxD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,2CAA2C;AAC3C,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IACjB,6BAAmB,CAAA;IACnB,6BAAmB,CAAA;IACnB,6BAAmB,CAAA;AACpB,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB;AAED,mEAAmE;AACnE,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,6CAA2B,CAAA;AAC5B,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED,2CAA2C;AAC3C,MAAM,CAAN,IAAY,UAEX;AAFD,WAAY,UAAU;IACrB,yBAAW,CAAA;AAC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A+B,EAAE,CAAC;IAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;QAC/B,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;KAC5C;IACD,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { expect, assert } from 'chai';\nimport {\n\tGenerator,\n\tcreateWeightedGenerator,\n\tinterleave,\n\tmakeRandom,\n\tperformFuzzActions as performFuzzActionsBase,\n\trepeat,\n\tSaveInfo,\n\ttake,\n\tBaseFuzzTestState,\n} from '@fluid-private/stochastic-test-utils';\nimport { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';\nimport { assertNotUndefined, ClosedMap, fail, getOrCreate } from '../../Common.js';\nimport { IdCompressor, isLocalId } from '../../id-compressor/IdCompressor.js';\nimport {\n\tcreateSessionId,\n\tensureSessionUuid,\n\tNumericUuid,\n\tnumericUuidFromStableId,\n\tstableIdFromNumericUuid,\n} from '../../id-compressor/NumericUuid.js';\nimport {\n\tFinalCompressedId,\n\tSessionId,\n\tStableId,\n\tSessionSpaceCompressedId,\n\tAttributionId,\n\tOpSpaceCompressedId,\n} from '../../Identifiers.js';\nimport { getIds } from '../../id-compressor/IdRange.js';\nimport type {\n\tIdCreationRange,\n\tSerializedIdCompressorWithOngoingSession,\n\tSerializedIdCompressorWithNoSession,\n} from '../../id-compressor/index.js';\nimport { assertIsStableId, assertIsUuidString } from '../../UuidUtilities.js';\nimport { expectDefined } from './TestCommon.js';\n\n/** Identifies a compressor in a network */\nexport enum Client {\n\tClient1 = 'Client1',\n\tClient2 = 'Client2',\n\tClient3 = 'Client3',\n}\n\n/** Identifies a compressor with respect to a specific operation */\nexport enum SemanticClient {\n\tLocalClient = 'LocalClient',\n}\n\n/** Identifies categories of compressors */\nexport enum MetaClient {\n\tAll = 'All',\n}\n\n/**\n * Used to attribute actions to clients in a distributed collaboration session.\n * `Local` implies a local and unsequenced operation. All others imply sequenced operations.\n */\nexport type OriginatingClient = Client | SemanticClient;\nexport const OriginatingClient = { ...Client, ...SemanticClient };\n\n/** Identifies a compressor to which to send an operation */\nexport type DestinationClient = Client | MetaClient;\nexport const DestinationClient = { ...Client, ...MetaClient };\n\n/**\n * Creates a new compressor with the supplied cluster capacity.\n */\nexport function createCompressor(\n\tclient: Client,\n\tclusterCapacity = 5,\n\tattributionId?: AttributionId,\n\tlogger?: ITelemetryBaseLogger\n): IdCompressor {\n\tconst compressor = new IdCompressor(sessionIds.get(client), 1024, attributionId, logger);\n\tcompressor.clusterCapacity = clusterCapacity;\n\treturn compressor;\n}\n\n/**\n * A closed map from NamedClient to T.\n */\nexport type ClientMap<T> = ClosedMap<Client, T>;\n\nfunction makeSessionIds(): ClientMap<SessionId> {\n\tconst stableIds = new Map<Client, SessionId>();\n\tconst clients = Object.values(Client);\n\tfor (let i = 0; i < clients.length; i++) {\n\t\t// Place session uuids roughly in the middle of uuid space to increase odds of encountering interesting\n\t\t// orderings in sorted collections\n\t\tconst sessionId = ensureSessionUuid(assertIsStableId(`88888888-8888-4888-b${i}88-888888888888`));\n\t\tstableIds.set(clients[i], sessionId);\n\t}\n\treturn stableIds as ClientMap<SessionId>;\n}\n\n/**\n * An array of session ID strings corresponding to all non-local `Client` entries.\n */\nexport const sessionIds = makeSessionIds();\n\n/**\n * An array of session uuids corresponding to all non-local `Client` entries.\n */\nexport const sessionNumericUuids = new Map(\n\t[...sessionIds.entries()].map(([client, sessionId]) => {\n\t\treturn [client, numericUuidFromStableId(sessionId)];\n\t})\n) as ClientMap<NumericUuid>;\n\nexport const attributionIds = new Map(\n\tObject.values(Client).map((c, i) => [\n\t\tc,\n\t\tassertIsUuidString(`00000000-0000-0000-0000-${(i + 1).toString(16).padStart(12, '0')}`),\n\t])\n) as ClientMap<AttributionId>;\n\n/** An immutable view of an `IdCompressor` */\nexport interface ReadonlyIdCompressor\n\textends Omit<\n\t\tIdCompressor,\n\t\t'generateCompressedId' | 'generateCompressedIdRange' | 'takeNextCreationRange' | 'finalizeCreationRange'\n\t> {\n\treadonly clusterCapacity: number;\n}\n\n/** Information about a generated ID in a network to be validated by tests */\nexport interface TestIdData {\n\treadonly id: SessionSpaceCompressedId;\n\treadonly originatingClient: Client;\n\treadonly sessionId: SessionId;\n\treadonly sessionNumericUuid: NumericUuid;\n\treadonly expectedOverride: string | undefined;\n\treadonly isSequenced: boolean;\n}\n\n/**\n * Simulates a network of ID compressors.\n * Not suitable for performance testing.\n */\nexport class IdCompressorTestNetwork {\n\t/** The compressors used in this network */\n\tprivate readonly compressors: ClientMap<IdCompressor>;\n\t/** The log of operations seen by the server so far. Append-only. */\n\tprivate readonly serverOperations: (\n\t\t| [creationRange: IdCreationRange, opSpaceIds: OpSpaceCompressedId[], clientFrom: Client]\n\t\t| number\n\t)[] = [];\n\t/** An index into `serverOperations` for each client which represents how many operations have been delivered to that client */\n\tprivate readonly clientProgress: ClientMap<number>;\n\t/** All ids (local and sequenced) that a client has created or received, in order. */\n\tprivate readonly idLogs: ClientMap<TestIdData[]>;\n\t/** All ids that a client has received from the server, in order. */\n\tprivate readonly sequencedIdLogs: ClientMap<TestIdData[]>;\n\n\tpublic constructor(\n\t\tpublic readonly initialClusterSize = 5,\n\t\tprivate readonly onIdReceived?: (network: IdCompressorTestNetwork, clientTo: Client, ids: TestIdData[]) => void\n\t) {\n\t\tconst compressors = new Map<Client, IdCompressor>();\n\t\tconst clientProgress = new Map<Client, number>();\n\t\tconst clientIds = new Map<Client, TestIdData[]>();\n\t\tconst clientSequencedIds = new Map<Client, TestIdData[]>();\n\t\tfor (const client of Object.values(Client)) {\n\t\t\tconst compressor = createCompressor(client, initialClusterSize, attributionIds.get(client));\n\t\t\tcompressors.set(client, compressor);\n\t\t\tclientProgress.set(client, 0);\n\t\t\tclientIds.set(client, []);\n\t\t\tclientSequencedIds.set(client, []);\n\t\t}\n\t\tthis.compressors = compressors as ClientMap<IdCompressor>;\n\t\tthis.clientProgress = clientProgress as ClientMap<number>;\n\t\tthis.idLogs = clientIds as ClientMap<TestIdData[]>;\n\t\tthis.sequencedIdLogs = clientSequencedIds as ClientMap<TestIdData[]>;\n\t}\n\n\t/**\n\t * Returns the number of undelivered operations for the given client that are in flight in the network.\n\t */\n\tpublic getPendingOperations(destination: Client): number {\n\t\treturn this.serverOperations.length - this.clientProgress.get(destination);\n\t}\n\n\t/**\n\t * Returns an immutable handle to a compressor in the network.\n\t */\n\tpublic getCompressor(client: Client): ReadonlyIdCompressor {\n\t\tconst compressors = this.compressors;\n\t\tconst handler = {\n\t\t\tget(_, property) {\n\t\t\t\tconst compressor = compressors.get(client);\n\t\t\t\treturn compressor[property];\n\t\t\t},\n\t\t\tset(_, property, value): boolean {\n\t\t\t\tconst compressor = compressors.get(client);\n\t\t\t\tcompressor[property] = value;\n\t\t\t\treturn true;\n\t\t\t},\n\t\t};\n\t\treturn new Proxy<IdCompressor>({} as unknown as IdCompressor, handler);\n\t}\n\n\t/**\n\t * Returns a mutable handle to a compressor in the network. Use of mutation methods will break the network invariants and\n\t * should only be used if the network will not be used again.\n\t */\n\tpublic getCompressorUnsafe(client: Client): IdCompressor {\n\t\treturn this.getCompressor(client) as IdCompressor;\n\t}\n\n\t/**\n\t * Returns a mutable handle to a compressor in the network. Use of mutation methods will break the network invariants and\n\t * should only be used if the network will not be used again. Additionally, the returned compressor will be invalidated/unusable\n\t * if any network operations cause it to be regenerated (serialization/deserialization, etc.).\n\t */\n\tpublic getCompressorUnsafeNoProxy(client: Client): IdCompressor {\n\t\treturn this.compressors.get(client);\n\t}\n\n\t/**\n\t * Returns data for all IDs created and received by this client, including ack's of their own (i.e. their own IDs will appear twice)\n\t */\n\tpublic getIdLog(client: Client): readonly TestIdData[] {\n\t\treturn this.idLogs.get(client);\n\t}\n\n\t/**\n\t * Returns data for all IDs received by this client, including ack's of their own.\n\t */\n\tpublic getSequencedIdLog(client: Client): readonly TestIdData[] {\n\t\treturn this.sequencedIdLogs.get(client);\n\t}\n\n\t/**\n\t * Get all compressors for the given destination\n\t */\n\tpublic getTargetCompressors(clientTo: DestinationClient): [Client, IdCompressor][] {\n\t\treturn clientTo === MetaClient.All\n\t\t\t? [...this.compressors.entries()]\n\t\t\t: ([[clientTo, this.getCompressor(clientTo)]] as [Client, IdCompressor][]);\n\t}\n\n\t/**\n\t * Submit a capacity change operation to the network. It will not take effect immediately but will be processed in sequence order.\n\t */\n\tpublic enqueueCapacityChange(newClusterCapacity: number): void {\n\t\tthis.serverOperations.push(newClusterCapacity);\n\t}\n\n\tprivate addNewId(\n\t\tclient: Client,\n\t\tid: SessionSpaceCompressedId,\n\t\texpectedOverride: string | undefined,\n\t\toriginatingClient: Client,\n\t\tisSequenced: boolean\n\t): void {\n\t\tconst idData = {\n\t\t\tid,\n\t\t\toriginatingClient,\n\t\t\tsessionId: sessionIds.get(originatingClient),\n\t\t\tsessionNumericUuid: sessionNumericUuids.get(originatingClient),\n\t\t\texpectedOverride,\n\t\t\tisSequenced,\n\t\t};\n\t\tconst clientIds = this.idLogs.get(client);\n\t\tclientIds.push(idData);\n\t\tif (isSequenced) {\n\t\t\tconst sequencedIds = this.sequencedIdLogs.get(client);\n\t\t\tsequencedIds.push(idData);\n\t\t}\n\t\tthis.onIdReceived?.(this, client, clientIds);\n\t}\n\n\t/**\n\t * Allocates a new range of local IDs and enqueues them for future delivery via a `testIdDelivery` action.\n\t * Calls to this method determine the total order of delivery, regardless of when `deliverOperations` is called.\n\t */\n\tpublic allocateAndSendIds(client: Client, numIds: number): OpSpaceCompressedId[];\n\n\t/**\n\t * Allocates a new range of local IDs and enqueues them for future delivery via a `testIdDelivery` action.\n\t * Calls to this method determine the total order of delivery, regardless of when `deliverOperations` is called.\n\t */\n\tpublic allocateAndSendIds(client: Client, numIds: number, overrides: { [index: number]: string }): IdCreationRange;\n\n\tpublic allocateAndSendIds(\n\t\tclient: Client,\n\t\tnumIds: number,\n\t\toverrides: { [index: number]: string } = {}\n\t): OpSpaceCompressedId[] | IdCreationRange {\n\t\t// Must allocate a non-zero number of IDs\n\t\tassert(numIds > 0);\n\t\tconst compressor = this.compressors.get(client);\n\t\tlet nextIdIndex = 0;\n\t\tconst opSpaceIds: OpSpaceCompressedId[] = [];\n\t\tfor (const [overrideIndex, uuid] of Object.entries(overrides)\n\t\t\t.map(([id, uuid]) => [Number.parseInt(id, 10), uuid] as [number, string])\n\t\t\t.sort(([a], [b]) => a - b)) {\n\t\t\twhile (nextIdIndex < overrideIndex) {\n\t\t\t\tconst newId = compressor.generateCompressedId();\n\t\t\t\topSpaceIds.push(compressor.normalizeToOpSpace(newId));\n\t\t\t\tthis.addNewId(client, newId, undefined, client, false);\n\t\t\t\tnextIdIndex += 1;\n\t\t\t}\n\t\t\tconst newOverrideId = compressor.generateCompressedId(uuid);\n\t\t\topSpaceIds.push(compressor.normalizeToOpSpace(newOverrideId));\n\t\t\tthis.addNewId(client, newOverrideId, uuid, client, false);\n\t\t\tnextIdIndex += 1;\n\t\t}\n\t\tconst numTrailingIds = numIds - nextIdIndex;\n\t\tif (numTrailingIds > 0) {\n\t\t\tconst sessionSpaceIds = generateCompressedIds(compressor, numTrailingIds);\n\t\t\tfor (let i = 0; i < numTrailingIds; i++) {\n\t\t\t\tthis.addNewId(client, sessionSpaceIds[i], undefined, client, false);\n\t\t\t}\n\t\t\tsessionSpaceIds.forEach((id) => opSpaceIds.push(compressor.normalizeToOpSpace(id)));\n\t\t}\n\t\tconst creationRange = compressor.takeNextCreationRange();\n\t\tthis.serverOperations.push([creationRange, opSpaceIds, client]);\n\t\treturn nextIdIndex === 0 ? opSpaceIds : creationRange;\n\t}\n\n\t/**\n\t * Delivers all undelivered ID ranges and cluster capacity changes from the server to the target clients.\n\t */\n\tpublic deliverOperations(clientTakingDelivery: Client, opsToDeliver?: number);\n\n\t/**\n\t * Delivers all undelivered ID ranges and cluster capacity changes from the server to the target clients.\n\t */\n\tpublic deliverOperations(clientTakingDelivery: DestinationClient);\n\n\t/**\n\t * Delivers all undelivered ID ranges and cluster capacity changes from the server to the target clients.\n\t */\n\tpublic deliverOperations(clientTakingDelivery: DestinationClient, opsToDeliver?: number) {\n\t\tlet opIndexBound: number;\n\t\tif (clientTakingDelivery === DestinationClient.All) {\n\t\t\tassert(opsToDeliver === undefined);\n\t\t\topIndexBound = this.serverOperations.length;\n\t\t} else {\n\t\t\topIndexBound =\n\t\t\t\topsToDeliver !== undefined\n\t\t\t\t\t? this.clientProgress.get(clientTakingDelivery) + opsToDeliver\n\t\t\t\t\t: this.serverOperations.length;\n\t\t}\n\t\tfor (const [clientTo, compressorTo] of this.getTargetCompressors(clientTakingDelivery)) {\n\t\t\tfor (let i = this.clientProgress.get(clientTo); i < opIndexBound; i++) {\n\t\t\t\tconst operation = this.serverOperations[i];\n\t\t\t\tif (typeof operation === 'number') {\n\t\t\t\t\tcompressorTo.clusterCapacity = operation;\n\t\t\t\t} else {\n\t\t\t\t\tconst [range, opSpaceIds, clientFrom] = operation;\n\t\t\t\t\tcompressorTo.finalizeCreationRange(range);\n\n\t\t\t\t\tconst ids = getIds(range);\n\t\t\t\t\tif (ids !== undefined) {\n\t\t\t\t\t\tlet overrideIndex = 0;\n\t\t\t\t\t\tconst overrides = ids.overrides;\n\t\t\t\t\t\tfor (const id of opSpaceIds) {\n\t\t\t\t\t\t\tlet override: string | undefined;\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\toverrides !== undefined &&\n\t\t\t\t\t\t\t\toverrideIndex < overrides.length &&\n\t\t\t\t\t\t\t\tid === overrides[overrideIndex][0]\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\toverride = overrides[overrideIndex][1];\n\t\t\t\t\t\t\t\toverrideIndex++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst sessionSpaceId = compressorTo.normalizeToSessionSpace(id, range.sessionId);\n\t\t\t\t\t\t\tthis.addNewId(clientTo, sessionSpaceId, override, clientFrom, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tassert(overrideIndex === (overrides?.length ?? 0));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.clientProgress.set(clientTo, opIndexBound);\n\t\t}\n\t}\n\n\t/**\n\t * Simulate a client disconnecting (and serializing), then reconnecting (and deserializing)\n\t */\n\tpublic goOfflineThenResume(client: Client): void {\n\t\tconst compressor = this.compressors.get(client);\n\t\tconst [_, resumedCompressor] = roundtrip(compressor, true);\n\t\tthis.compressors.set(client, resumedCompressor);\n\t}\n\n\t/**\n\t * Ensure general validity of the network state. Useful for calling periodically or at the end of test scenarios.\n\t */\n\tpublic assertNetworkState(): void {\n\t\tconst sequencedLogs = Object.values(Client).map(\n\t\t\t(client) => [this.compressors.get(client), this.getSequencedIdLog(client)] as const\n\t\t);\n\n\t\t// First, ensure all clients each generated a unique ID for each of their own calls to generate.\n\t\tfor (const [compressor, ids] of sequencedLogs) {\n\t\t\tconst uuids = new Set<StableId | string>();\n\t\t\tfor (const idData of ids) {\n\t\t\t\tconst uuid = compressor.decompress(idData.id);\n\t\t\t\texpect(!uuids.has(uuid), 'Duplicate UUID generated.');\n\t\t\t\tuuids.add(uuid);\n\t\t\t}\n\t\t}\n\n\t\tconst maxLogLength = sequencedLogs.map(([_, data]) => data.length).reduce((p, n) => Math.max(p, n));\n\n\t\tfunction getNextLogWithEntryAt(logsIndex: number, entryIndex: number): number | undefined {\n\t\t\tfor (let i = logsIndex; i < sequencedLogs.length; i++) {\n\t\t\t\tconst log = sequencedLogs[i];\n\t\t\t\tif (log[1].length > entryIndex) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst uuids = new Set<string>();\n\t\tconst finalIds = new Set<FinalCompressedId>();\n\t\tconst idIndicesAggregator = new Map<Client, number>();\n\n\t\tfunction* getLogIndices(\n\t\t\tcolumnIndex: number\n\t\t): Iterable<\n\t\t\t[\n\t\t\t\tcurrent: [compressor: IdCompressor, idData: TestIdData],\n\t\t\t\tnext?: [compressor: IdCompressor, idData: TestIdData],\n\t\t\t]\n\t\t> {\n\t\t\tlet current = getNextLogWithEntryAt(0, columnIndex);\n\t\t\twhile (current !== undefined) {\n\t\t\t\tconst next = getNextLogWithEntryAt(current + 1, columnIndex);\n\t\t\t\tconst [compressor, log] = sequencedLogs[current];\n\t\t\t\tif (next === undefined) {\n\t\t\t\t\tyield [[compressor, log[columnIndex]]];\n\t\t\t\t} else {\n\t\t\t\t\tconst [compressorNext, logNext] = sequencedLogs[next];\n\t\t\t\t\tyield [\n\t\t\t\t\t\t[compressor, log[columnIndex]],\n\t\t\t\t\t\t[compressorNext, logNext[columnIndex]],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\tcurrent = next;\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < maxLogLength; i++) {\n\t\t\tconst creator: [creator: Client, override?: string][] = [];\n\t\t\tlet originatingClient: Client | undefined;\n\t\t\tlet localCount = 0;\n\t\t\tlet rowCount = 0;\n\t\t\tfor (const [current, next] of getLogIndices(i)) {\n\t\t\t\tconst [compressorA, idDataA] = current;\n\t\t\t\tconst sessionSpaceIdA = idDataA.id;\n\t\t\t\tconst idIndex = getOrCreate(idIndicesAggregator, idDataA.originatingClient, () => 0);\n\t\t\t\toriginatingClient ??= idDataA.originatingClient;\n\t\t\t\t// Test infra gave wrong originating client to TestIdData\n\t\t\t\tassert(idDataA.originatingClient === originatingClient);\n\t\t\t\tconst attributionA = compressorA.attributeId(idDataA.id);\n\t\t\t\tif (attributionA !== attributionIds.get(idDataA.originatingClient)) {\n\t\t\t\t\t// Unification\n\t\t\t\t\texpectDefined(idDataA.expectedOverride);\n\t\t\t\t}\n\n\t\t\t\t// Only one client should have this ID as local in its session space, as only one client could have created this ID\n\t\t\t\tif (isLocalId(sessionSpaceIdA)) {\n\t\t\t\t\tlocalCount++;\n\t\t\t\t\texpect(idDataA.sessionId).to.equal(this.compressors.get(originatingClient).localSessionId);\n\t\t\t\t\texpect(creator.length === 0 || creator[creator.length - 1][1] === idDataA.expectedOverride).to.be\n\t\t\t\t\t\t.true;\n\t\t\t\t\tcreator.push([originatingClient, idDataA.expectedOverride]);\n\t\t\t\t}\n\n\t\t\t\tconst uuidASessionSpace = compressorA.decompress(sessionSpaceIdA);\n\t\t\t\tif (idDataA.expectedOverride !== undefined) {\n\t\t\t\t\texpect(uuidASessionSpace).to.equal(idDataA.expectedOverride);\n\t\t\t\t} else {\n\t\t\t\t\texpect(uuidASessionSpace).to.equal(stableIdFromNumericUuid(idDataA.sessionNumericUuid, idIndex));\n\t\t\t\t}\n\t\t\t\texpect(compressorA.recompress(uuidASessionSpace)).to.equal(sessionSpaceIdA);\n\t\t\t\tuuids.add(uuidASessionSpace);\n\t\t\t\tconst opSpaceIdA = compressorA.normalizeToOpSpace(sessionSpaceIdA);\n\t\t\t\tif (isLocalId(opSpaceIdA)) {\n\t\t\t\t\texpect.fail('IDs should have been finalized.');\n\t\t\t\t\tfail();\n\t\t\t\t}\n\t\t\t\texpect(compressorA.normalizeToSessionSpace(opSpaceIdA, compressorA.localSessionId)).equals(\n\t\t\t\t\tsessionSpaceIdA\n\t\t\t\t);\n\t\t\t\tfinalIds.add(opSpaceIdA);\n\t\t\t\tconst uuidAOpSpace = compressorA.decompress(opSpaceIdA);\n\n\t\t\t\texpect(uuidASessionSpace).to.equal(uuidAOpSpace);\n\n\t\t\t\tif (next !== undefined) {\n\t\t\t\t\tconst [compressorB, idDataB] = next;\n\t\t\t\t\tconst sessionSpaceIdB = idDataB.id;\n\n\t\t\t\t\tconst uuidBSessionSpace = compressorB.decompress(sessionSpaceIdB);\n\t\t\t\t\texpect(uuidASessionSpace).to.equal(uuidBSessionSpace);\n\t\t\t\t\tconst opSpaceIdB = compressorB.normalizeToOpSpace(sessionSpaceIdB);\n\t\t\t\t\tif (opSpaceIdA !== opSpaceIdB) {\n\t\t\t\t\t\tcompressorB.normalizeToOpSpace(sessionSpaceIdB);\n\t\t\t\t\t\tcompressorA.normalizeToOpSpace(sessionSpaceIdA);\n\t\t\t\t\t}\n\t\t\t\t\texpect(opSpaceIdA).to.equal(opSpaceIdB);\n\t\t\t\t\tif (isLocalId(opSpaceIdB)) {\n\t\t\t\t\t\tfail('IDs should have been finalized.');\n\t\t\t\t\t}\n\t\t\t\t\tconst uuidBOpSpace = compressorB.decompress(opSpaceIdB);\n\t\t\t\t\texpect(uuidAOpSpace).to.equal(uuidBOpSpace);\n\t\t\t\t}\n\n\t\t\t\trowCount += 1;\n\t\t\t}\n\n\t\t\t// A local count === 0 indicates the ID was created as an eager final, and thus cannot have had an\n\t\t\t// override to unify.\n\t\t\tif (rowCount === this.sequencedIdLogs.size && localCount <= 1) {\n\t\t\t\texpect(localCount).to.lessThanOrEqual(1);\n\t\t\t\tfor (const [[compressor, { id, originatingClient }]] of getLogIndices(i)) {\n\t\t\t\t\texpect(compressor.attributeId(id)).to.equal(attributionIds.get(originatingClient));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texpect(uuids.size).to.equal(finalIds.size);\n\t\t\tassert(originatingClient !== undefined);\n\t\t\tidIndicesAggregator.set(\n\t\t\t\toriginatingClient,\n\t\t\t\tassertNotUndefined(idIndicesAggregator.get(originatingClient)) + 1\n\t\t\t);\n\t\t}\n\n\t\tfor (const [compressor] of sequencedLogs) {\n\t\t\texpectSerializes(compressor);\n\t\t}\n\t}\n}\n\n/**\n * Roundtrips the supplied compressor through serialization and deserialization.\n */\nexport function roundtrip(\n\tcompressor: ReadonlyIdCompressor,\n\twithSession: true\n): [SerializedIdCompressorWithOngoingSession, IdCompressor];\n\n/**\n * Roundtrips the supplied compressor through serialization and deserialization.\n */\nexport function roundtrip(\n\tcompressor: ReadonlyIdCompressor,\n\twithSession: false\n): [SerializedIdCompressorWithNoSession, IdCompressor];\n\nexport function roundtrip(\n\tcompressor: ReadonlyIdCompressor,\n\twithSession: boolean\n): [SerializedIdCompressorWithOngoingSession | SerializedIdCompressorWithNoSession, IdCompressor] {\n\tif (withSession) {\n\t\tconst serialized = compressor.serialize(withSession);\n\t\treturn [serialized, IdCompressor.deserialize(serialized)];\n\t}\n\n\tconst nonLocalSerialized = compressor.serialize(withSession);\n\treturn [nonLocalSerialized, IdCompressor.deserialize(nonLocalSerialized, createSessionId())];\n}\n\n/**\n * Asserts that the supplied compressor correctly roundtrips through serialization/deserialization.\n */\nexport function expectSerializes(\n\tcompressor: ReadonlyIdCompressor\n): [SerializedIdCompressorWithNoSession, SerializedIdCompressorWithOngoingSession] {\n\tfunction expectSerializes(\n\t\twithSession: boolean\n\t): SerializedIdCompressorWithOngoingSession | SerializedIdCompressorWithNoSession {\n\t\tlet serialized: SerializedIdCompressorWithOngoingSession | SerializedIdCompressorWithNoSession;\n\t\tlet deserialized: IdCompressor;\n\t\tif (withSession) {\n\t\t\t[serialized, deserialized] = roundtrip(compressor, true);\n\t\t} else {\n\t\t\t[serialized, deserialized] = roundtrip(compressor, false);\n\t\t}\n\t\tconst chainCount: number[] = [];\n\t\tfor (let i = 0; i < serialized.sessions.length; i++) {\n\t\t\tchainCount[i] = 0;\n\t\t}\n\t\tconst chainProcessed: number[] = [...chainCount];\n\n\t\tfor (const cluster of serialized.clusters) {\n\t\t\tconst [sessionIndex] = cluster;\n\t\t\texpect(sessionIndex < serialized.sessions.length).to.be.true;\n\t\t\tchainCount[sessionIndex]++;\n\t\t}\n\n\t\tfor (const cluster of serialized.clusters) {\n\t\t\tconst [sessionIndex, capacity, maybeSize] = cluster;\n\t\t\tconst chainIndex = chainProcessed[sessionIndex];\n\t\t\tif (chainIndex < chainCount[sessionIndex] - 1) {\n\t\t\t\texpect(typeof maybeSize !== 'number').to.be.true;\n\t\t\t} else {\n\t\t\t\texpect(maybeSize === undefined || typeof maybeSize !== 'number' || maybeSize < capacity).to.be.true;\n\t\t\t}\n\t\t\tchainProcessed[sessionIndex]++;\n\t\t}\n\n\t\texpect(compressor.equals(deserialized, withSession)).to.be.true;\n\t\treturn serialized;\n\t}\n\n\treturn [\n\t\texpectSerializes(false) as SerializedIdCompressorWithNoSession,\n\t\texpectSerializes(true) as SerializedIdCompressorWithOngoingSession,\n\t];\n}\n\n/**\n * Merges 'from' into 'to', and returns 'to'.\n */\nexport function mergeArrayMaps<K, V>(\n\tto: Pick<Map<K, V[]>, 'get' | 'set'>,\n\tfrom: ReadonlyMap<K, V[]>\n): Pick<Map<K, V[]>, 'get' | 'set'> {\n\tfor (const [key, value] of from.entries()) {\n\t\tconst entry = to.get(key);\n\t\tif (entry !== undefined) {\n\t\t\tentry.push(...value);\n\t\t} else {\n\t\t\tto.set(key, [...value]);\n\t\t}\n\t}\n\treturn to;\n}\n\ninterface AllocateIds {\n\ttype: 'allocateIds';\n\tclient: Client;\n\tnumIds: number;\n\toverrides: { [index: number]: string };\n}\n\ninterface DeliverAllOperations {\n\ttype: 'deliverAllOperations';\n}\n\ninterface DeliverSomeOperations {\n\ttype: 'deliverSomeOperations';\n\tclient: Client;\n\tcount: number;\n}\n\ninterface ChangeCapacity {\n\ttype: 'changeCapacity';\n\tnewSize: number;\n}\n\ninterface GenerateUnifyingIds {\n\ttype: 'generateUnifyingIds';\n\tclientA: Client;\n\tclientB: Client;\n\tuuid: string;\n}\n\n// Represents intent to go offline then resume.\ninterface Reconnect {\n\ttype: 'reconnect';\n\tclient: Client;\n}\n\ninterface Validate {\n\ttype: 'validate';\n}\n\ntype Operation =\n\t| AllocateIds\n\t| DeliverSomeOperations\n\t| DeliverAllOperations\n\t| ChangeCapacity\n\t| GenerateUnifyingIds\n\t| Reconnect\n\t| Validate;\n\ninterface FuzzTestState extends BaseFuzzTestState {\n\tnetwork: IdCompressorTestNetwork;\n\tactiveClients: Client[];\n\tselectableClients: Client[];\n\tclusterSize: number;\n}\n\nexport interface OperationGenerationConfig {\n\t/** whether or not the fuzz actions will generate override UUIDs */\n\tincludeOverrides: boolean;\n\t/** maximum cluster size of the network. Default: 25 */\n\tmaxClusterSize?: number;\n\t/** Number of ops between validation ops. Default: 200 */\n\tvalidateInterval?: number;\n}\n\nconst defaultOptions = {\n\tincludeOverrides: false,\n\tmaxClusterSize: 25,\n\tvalidateInterval: 200,\n};\n\nexport function makeOpGenerator(options: OperationGenerationConfig): Generator<Operation, FuzzTestState> {\n\tconst { includeOverrides, maxClusterSize, validateInterval } = { ...defaultOptions, ...options };\n\n\tfunction allocateIdsGenerator({ activeClients, clusterSize, random }: FuzzTestState): AllocateIds {\n\t\tconst client = random.pick(activeClients);\n\t\tconst maxIdsPerUsage = clusterSize * 2;\n\t\tconst numIds = Math.floor(random.real(0, 1) ** 3 * maxIdsPerUsage) + 1;\n\t\tconst overrides: AllocateIds['overrides'] = {};\n\t\tif (includeOverrides && random.bool(1 / 4)) {\n\t\t\tfor (let j = 0; j < numIds; j++) {\n\t\t\t\tif (random.bool(1 / 3)) {\n\t\t\t\t\toverrides[j] = random.uuid4();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\ttype: 'allocateIds',\n\t\t\tclient,\n\t\t\tnumIds,\n\t\t\toverrides,\n\t\t};\n\t}\n\n\tfunction changeCapacityGenerator({ random }: FuzzTestState): ChangeCapacity {\n\t\treturn {\n\t\t\ttype: 'changeCapacity',\n\t\t\tnewSize: Math.min(Math.floor(random.real(0, 1) ** 2 * maxClusterSize) + 1, maxClusterSize),\n\t\t};\n\t}\n\n\tfunction deliverAllOperationsGenerator(): DeliverAllOperations {\n\t\treturn {\n\t\t\ttype: 'deliverAllOperations',\n\t\t};\n\t}\n\n\tfunction deliverSomeOperationsGenerator({\n\t\trandom,\n\t\tselectableClients,\n\t\tnetwork,\n\t}: FuzzTestState): DeliverSomeOperations {\n\t\tconst pendingClients = selectableClients.filter((c) => network.getPendingOperations(c) > 0);\n\t\tif (pendingClients.length === 0) {\n\t\t\treturn {\n\t\t\t\ttype: 'deliverSomeOperations',\n\t\t\t\tclient: random.pick(selectableClients),\n\t\t\t\tcount: 0,\n\t\t\t};\n\t\t}\n\t\tconst client = random.pick(pendingClients);\n\t\treturn {\n\t\t\ttype: 'deliverSomeOperations',\n\t\t\tclient,\n\t\t\tcount: random.integer(1, network.getPendingOperations(client)),\n\t\t};\n\t}\n\n\tfunction generateUnifyingIdsGenerator({ activeClients, random }: FuzzTestState): GenerateUnifyingIds {\n\t\tconst clientA = random.pick(activeClients);\n\t\tconst clientB = random.pick(activeClients.filter((c) => c !== clientA));\n\t\treturn { type: 'generateUnifyingIds', clientA, clientB, uuid: random.uuid4() };\n\t}\n\n\tfunction reconnectGenerator({ activeClients, random }: FuzzTestState): Reconnect {\n\t\treturn { type: 'reconnect', client: random.pick(activeClients) };\n\t}\n\n\treturn interleave(\n\t\tcreateWeightedGenerator<Operation, FuzzTestState>([\n\t\t\t[changeCapacityGenerator, 1],\n\t\t\t[allocateIdsGenerator, 16],\n\t\t\t[deliverAllOperationsGenerator, 2],\n\t\t\t[deliverSomeOperationsGenerator, 6],\n\t\t\t[generateUnifyingIdsGenerator, 2],\n\t\t\t[reconnectGenerator, 1],\n\t\t]),\n\t\ttake(1, repeat<Operation, FuzzTestState>({ type: 'validate' })),\n\t\tvalidateInterval\n\t);\n}\n\n/**\n * Performs random actions on a test network.\n * @param generator - the generator used to provide operations\n * @param network - the test network to test\n * @param seed - the seed for the random generation of the fuzz actions\n * @param observerClient - if provided, this client will never generate local ids\n * @param synchronizeAtEnd - if provided, all client will have all operations delivered from the server at the end of the test\n * @param validator - if provided, this callback will be invoked periodically during the fuzz test.\n */\nexport function performFuzzActions(\n\tgenerator: Generator<Operation, FuzzTestState>,\n\tnetwork: IdCompressorTestNetwork,\n\tseed: number,\n\tobserverClient?: Client,\n\tsynchronizeAtEnd: boolean = true,\n\tvalidator?: (network: IdCompressorTestNetwork) => void,\n\tsaveInfo?: SaveInfo\n): void {\n\tconst random = makeRandom(seed);\n\tconst selectableClients: Client[] = network.getTargetCompressors(MetaClient.All).map(([client]) => client);\n\n\tconst initialState: FuzzTestState = {\n\t\trandom,\n\t\tnetwork,\n\t\tactiveClients: selectableClients.filter((c) => c !== observerClient),\n\t\tselectableClients,\n\t\tclusterSize: network.initialClusterSize,\n\t};\n\n\tperformFuzzActionsBase(\n\t\tgenerator,\n\t\t{\n\t\t\tallocateIds: (state, { client, numIds, overrides }) => {\n\t\t\t\tnetwork.allocateAndSendIds(client, numIds, overrides);\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tchangeCapacity: (state, op) => {\n\t\t\t\tnetwork.enqueueCapacityChange(op.newSize);\n\t\t\t\treturn { ...state, clusterSize: op.newSize };\n\t\t\t},\n\t\t\tdeliverSomeOperations: (state, op) => {\n\t\t\t\tnetwork.deliverOperations(op.client, op.count);\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tdeliverAllOperations: (state) => {\n\t\t\t\tnetwork.deliverOperations(DestinationClient.All);\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tgenerateUnifyingIds: (state, { clientA, clientB, uuid }) => {\n\t\t\t\tnetwork.allocateAndSendIds(clientA, 1, { 0: uuid });\n\t\t\t\tnetwork.allocateAndSendIds(clientB, 1, { 0: uuid });\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\treconnect: (state, { client }) => {\n\t\t\t\tnetwork.goOfflineThenResume(client);\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tvalidate: (state) => {\n\t\t\t\tnetwork.deliverOperations(DestinationClient.All);\n\t\t\t\tvalidator?.(network);\n\t\t\t\treturn state;\n\t\t\t},\n\t\t},\n\t\tinitialState,\n\t\tsaveInfo\n\t);\n\n\tif (synchronizeAtEnd) {\n\t\tnetwork.deliverOperations(DestinationClient.All);\n\t\tvalidator?.(network);\n\t}\n}\n\n/**\n * Converts the supplied integer to a uuid.\n */\nexport function integerToStableId(num: number | bigint): StableId {\n\tconst bigintNum = BigInt(num);\n\tconst upper = bigintNum >> BigInt(74);\n\tconst middle = (bigintNum & (BigInt(0xfff) << BigInt(62))) >> BigInt(62);\n\tconst lower = bigintNum & BigInt('0x3fffffffffffffff');\n\tconst upperString = padToLength(upper.toString(16), '0', 12);\n\tconst middleString = `4${padToLength(middle.toString(16), '0', 3)}`;\n\tconst lowerString = padToLength((BigInt('0x8000000000000000') | BigInt(lower)).toString(16), '0', 16);\n\tconst uuid = upperString + middleString + lowerString;\n\treturn assertIsStableId(\n\t\t`${uuid.substr(0, 8)}-${uuid.substr(8, 4)}-${uuid.substr(12, 4)}-${uuid.substr(16, 4)}-${uuid.substr(20)}`\n\t);\n}\n\n/**\n * Pads the strings to a length of 32 with zeroes.\n */\nexport function padToUuidLength(str: string): string {\n\treturn padToLength(str, '0', 32);\n}\n\nfunction padToLength(str: string, char: string, length: number): string {\n\treturn char.repeat(length - str.length) + str;\n}\n\n/**\n * Helper to generate a fixed number of IDs.\n */\nexport function generateCompressedIds(compressor: IdCompressor, count: number): SessionSpaceCompressedId[] {\n\tconst ids: SessionSpaceCompressedId[] = [];\n\tfor (let i = 0; i < count; i++) {\n\t\tids.push(compressor.generateCompressedId());\n\t}\n\treturn ids;\n}\n"]}
@@ -1,35 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { Result } from '../../Common.js';
6
- import { ChangeInternal, EditStatus } from '../../persisted-types/index.js';
7
- import { RevisionView } from '../../RevisionView.js';
8
- import { ChangeResult, GenericTransaction, GenericTransactionPolicy } from '../../TransactionInternal.js';
9
- /**
10
- * @internal
11
- */
12
- export declare namespace MockTransaction {
13
- interface Options {
14
- statusOnClose: EditStatus;
15
- }
16
- const defaultOptions: Options;
17
- /**
18
- * Makes a new {@link GenericTransaction} that follows the {@link MockTransaction.Policy} policy.
19
- *
20
- * @internal
21
- */
22
- function factory(view: RevisionView, options?: Options): GenericTransaction;
23
- /**
24
- * A mock implementation of `GenericTransaction` for use in tests.
25
- * @internal
26
- */
27
- class Policy implements GenericTransactionPolicy {
28
- options: Options;
29
- constructor(options: Options);
30
- tryResolveChange(_state: any, change: ChangeInternal): Result.Ok<ChangeInternal>;
31
- validateOnClose(state: any): ChangeResult;
32
- dispatchChange(state: any): ChangeResult;
33
- }
34
- }
35
- //# sourceMappingURL=MockTransaction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MockTransaction.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/MockTransaction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,wBAAwB,EAExB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AAEH,yBAAiB,eAAe,CAAC;IAChC,UAAiB,OAAO;QACvB,aAAa,EAAE,UAAU,CAAC;KAC1B;IAEM,MAAM,cAAc,EAAE,OAE5B,CAAC;IAEF;;;;OAIG;IACH,SAAgB,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,GAAE,OAAwB,GAAG,kBAAkB,CAEjG;IAED;;;OAGG;IACH,MAAa,MAAO,YAAW,wBAAwB;QAC/C,OAAO,EAAE,OAAO,CAAC;oBAEL,OAAO,EAAE,OAAO;QAI5B,gBAAgB,CAAC,MAAM,KAAA,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC;QAI3E,eAAe,CAAC,KAAK,KAAA,GAAG,YAAY;QASpC,cAAc,CAAC,KAAK,KAAA,GAAG,YAAY;KAG1C;CACD"}
@@ -1,51 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { Result } from '../../Common.js';
6
- import { EditStatus } from '../../persisted-types/index.js';
7
- import { GenericTransaction, } from '../../TransactionInternal.js';
8
- /**
9
- * @internal
10
- */
11
- // eslint-disable-next-line @typescript-eslint/no-namespace
12
- export var MockTransaction;
13
- (function (MockTransaction) {
14
- MockTransaction.defaultOptions = {
15
- statusOnClose: EditStatus.Applied,
16
- };
17
- /**
18
- * Makes a new {@link GenericTransaction} that follows the {@link MockTransaction.Policy} policy.
19
- *
20
- * @internal
21
- */
22
- function factory(view, options = MockTransaction.defaultOptions) {
23
- return new GenericTransaction(view, new Policy(options));
24
- }
25
- MockTransaction.factory = factory;
26
- /**
27
- * A mock implementation of `GenericTransaction` for use in tests.
28
- * @internal
29
- */
30
- class Policy {
31
- constructor(options) {
32
- this.options = options;
33
- }
34
- tryResolveChange(_state, change) {
35
- return Result.ok(change);
36
- }
37
- validateOnClose(state) {
38
- return this.options.statusOnClose === EditStatus.Applied
39
- ? Result.ok(state.view)
40
- : Result.error({
41
- status: this.options.statusOnClose,
42
- failure: undefined,
43
- });
44
- }
45
- dispatchChange(state) {
46
- return Result.ok(state.view);
47
- }
48
- }
49
- MockTransaction.Policy = Policy;
50
- })(MockTransaction || (MockTransaction = {}));
51
- //# sourceMappingURL=MockTransaction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MockTransaction.js","sourceRoot":"","sources":["../../../src/test/utilities/MockTransaction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAkB,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5E,OAAO,EAEN,kBAAkB,GAGlB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,2DAA2D;AAC3D,MAAM,KAAW,eAAe,CA8C/B;AA9CD,WAAiB,eAAe;IAKlB,8BAAc,GAAY;QACtC,aAAa,EAAE,UAAU,CAAC,OAAO;KACjC,CAAC;IAEF;;;;OAIG;IACH,SAAgB,OAAO,CAAC,IAAkB,EAAE,UAAmB,gBAAA,cAAc;QAC5E,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,CAAC;IAFe,uBAAO,UAEtB,CAAA;IAED;;;OAGG;IACH,MAAa,MAAM;QAGlB,YAAmB,OAAgB;YAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,CAAC;QAEM,gBAAgB,CAAC,MAAM,EAAE,MAAsB;YACrD,OAAO,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;QAEM,eAAe,CAAC,KAAK;YAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,UAAU,CAAC,OAAO;gBACvD,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;gBACvB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;oBACb,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;oBAClC,OAAO,EAAE,SAAmD;iBAC3D,CAAC,CAAC;QACP,CAAC;QAEM,cAAc,CAAC,KAAK;YAC1B,OAAO,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;KACD;IAvBY,sBAAM,SAuBlB,CAAA;AACF,CAAC,EA9CgB,eAAe,KAAf,eAAe,QA8C/B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Result } from '../../Common.js';\nimport { ChangeInternal, EditStatus } from '../../persisted-types/index.js';\nimport { RevisionView } from '../../RevisionView.js';\nimport {\n\tChangeResult,\n\tGenericTransaction,\n\tGenericTransactionPolicy,\n\tTransactionInternal,\n} from '../../TransactionInternal.js';\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace MockTransaction {\n\texport interface Options {\n\t\tstatusOnClose: EditStatus;\n\t}\n\n\texport const defaultOptions: Options = {\n\t\tstatusOnClose: EditStatus.Applied,\n\t};\n\n\t/**\n\t * Makes a new {@link GenericTransaction} that follows the {@link MockTransaction.Policy} policy.\n\t *\n\t * @internal\n\t */\n\texport function factory(view: RevisionView, options: Options = defaultOptions): GenericTransaction {\n\t\treturn new GenericTransaction(view, new Policy(options));\n\t}\n\n\t/**\n\t * A mock implementation of `GenericTransaction` for use in tests.\n\t * @internal\n\t */\n\texport class Policy implements GenericTransactionPolicy {\n\t\tpublic options: Options;\n\n\t\tpublic constructor(options: Options) {\n\t\t\tthis.options = options;\n\t\t}\n\n\t\tpublic tryResolveChange(_state, change: ChangeInternal): Result.Ok<ChangeInternal> {\n\t\t\treturn Result.ok(change);\n\t\t}\n\n\t\tpublic validateOnClose(state): ChangeResult {\n\t\t\treturn this.options.statusOnClose === EditStatus.Applied\n\t\t\t\t? Result.ok(state.view)\n\t\t\t\t: Result.error({\n\t\t\t\t\t\tstatus: this.options.statusOnClose,\n\t\t\t\t\t\tfailure: undefined as unknown as TransactionInternal.Failure,\n\t\t\t\t });\n\t\t}\n\n\t\tpublic dispatchChange(state): ChangeResult {\n\t\t\treturn Result.ok(state.view);\n\t\t}\n\t}\n}\n"]}
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { LocalServerSharedTreeTestingComponents, LocalServerSharedTreeTestingOptions } from './TestUtilities.js';
6
- /**
7
- * Runs a test suite for SharedTree's ability to apply pending local state stashed by the host.
8
- * See documentation on `applyStashedOp`.
9
- * This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.
10
- */
11
- export declare function runPendingLocalStateTests(title: string, setUpLocalServerTestSharedTree: (options: LocalServerSharedTreeTestingOptions) => Promise<LocalServerSharedTreeTestingComponents>): void;
12
- //# sourceMappingURL=PendingLocalStateTests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PendingLocalStateTests.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/PendingLocalStateTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,EAGN,sCAAsC,EACtC,mCAAmC,EAInC,MAAM,oBAAoB,CAAC;AAG5B;;;;GAIG;AACH,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,MAAM,EACb,8BAA8B,EAAE,CAC/B,OAAO,EAAE,mCAAmC,KACxC,OAAO,CAAC,sCAAsC,CAAC,QA0RpD"}
@@ -1,223 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { expect } from 'chai';
6
- import { fail } from '../../Common.js';
7
- import { WriteFormat } from '../../persisted-types/index.js';
8
- import { Change, StablePlace } from '../../ChangeTypes.js';
9
- import { applyNoop, getEditLogInternal, setUpTestTree, stabilizeEdit, withContainerOffline, } from './TestUtilities.js';
10
- import { SimpleTestTree } from './TestNode.js';
11
- /**
12
- * Runs a test suite for SharedTree's ability to apply pending local state stashed by the host.
13
- * See documentation on `applyStashedOp`.
14
- * This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.
15
- */
16
- export function runPendingLocalStateTests(title, setUpLocalServerTestSharedTree) {
17
- describe(title, () => {
18
- const documentId = 'documentId';
19
- it('applies and submits ops from 0.0.2 in 0.0.2', async () => applyStashedOp(WriteFormat.v0_0_2, WriteFormat.v0_0_2));
20
- // TODO:#5357: Re-enable stashed ops tests
21
- it.skip('applies and submits ops from 0.0.2 in 0.1.1', async () => applyStashedOp(WriteFormat.v0_0_2, WriteFormat.v0_1_1));
22
- // TODO:#5357: Re-enable stashed ops tests
23
- it.skip('applies and submits ops from 0.1.1 in 0.0.2 (via upgrade)', async () => {
24
- const testObjectProvider = await applyStashedOp(WriteFormat.v0_1_1, WriteFormat.v0_0_2);
25
- // https://dev.azure.com/fluidframework/internal/_workitems/edit/3347
26
- const events = testObjectProvider.logger.reportAndClearTrackedEvents();
27
- expect(events.unexpectedErrors.length).to.equal(1);
28
- expect(events.unexpectedErrors[0].eventName).to.equal('fluid:telemetry:ContainerRuntime:Outbox:ReferenceSequenceNumberMismatch');
29
- });
30
- // TODO:#5357: Re-enable stashed ops tests
31
- it.skip('applies and submits ops from 0.1.1 in 0.1.1', async () => applyStashedOp(WriteFormat.v0_1_1, WriteFormat.v0_1_1));
32
- async function applyStashedOp(treeVersion, opVersion) {
33
- const { container: stashingContainer, tree: stashingTree, testObjectProvider, } = await setUpLocalServerTestSharedTree({
34
- id: documentId,
35
- writeFormat: opVersion,
36
- });
37
- const stashingTestTree = setUpTestTree(stashingTree);
38
- const { tree: observerTree } = await setUpLocalServerTestSharedTree({
39
- id: documentId,
40
- testObjectProvider,
41
- writeFormat: treeVersion,
42
- });
43
- await testObjectProvider.ensureSynchronized();
44
- const initialEditLogLength = stashingTree.edits.length;
45
- const insertedLeafLabel = 'leaf';
46
- const insertedLeafNodeId = stashingTestTree.generateNodeId('insertedLeafId');
47
- const insertedLeafStableId = stashingTestTree.convertToStableNodeId(insertedLeafNodeId);
48
- const { pendingLocalState, actionReturn: edit } = await withContainerOffline(testObjectProvider, stashingContainer, () => stashingTree.applyEdit(...Change.insertTree({
49
- ...stashingTestTree.buildLeaf(),
50
- traits: {
51
- [insertedLeafLabel]: stashingTestTree.buildLeaf(insertedLeafNodeId),
52
- },
53
- }, StablePlace.after(stashingTestTree.left))));
54
- await testObjectProvider.ensureSynchronized();
55
- const observerAfterStash = observerTree.currentView;
56
- // Simulate reconnect of user 1; a new container will be created which passes the stashed local state in its
57
- // load request.
58
- const { tree: stashingTree2 } = await setUpLocalServerTestSharedTree({
59
- testObjectProvider,
60
- pendingLocalState,
61
- id: documentId,
62
- writeFormat: treeVersion,
63
- });
64
- expect(stashingTree2.edits.isLocalEdit(edit.id)).to.be.true; // Kludge
65
- await testObjectProvider.ensureSynchronized();
66
- await testObjectProvider.ensureSynchronized(); // Synchronize twice in case stashed ops caused an upgrade round-trip
67
- function tryGetInsertedLeafId(view) {
68
- const rootNode = view.getViewNode(view.getTrait({ parent: view.root, label: SimpleTestTree.traitLabel })[0]);
69
- const leftTrait = view.getTrait({ parent: rootNode.identifier, label: SimpleTestTree.leftTraitLabel });
70
- if (leftTrait.length !== 2) {
71
- return undefined;
72
- }
73
- const insertedParent = view.tryGetViewNode(leftTrait[1]);
74
- if (insertedParent === undefined) {
75
- return undefined;
76
- }
77
- return view.getTrait({ parent: insertedParent.identifier, label: insertedLeafLabel })[0];
78
- }
79
- expect(tryGetInsertedLeafId(observerAfterStash)).to.equal(undefined, 'Observing tree should not receive edits made by the stashing tree after it went offline.');
80
- expect(tryGetInsertedLeafId(stashingTree2.currentView)).to.equal(stashingTree2.convertToNodeId(insertedLeafStableId), 'Tree which loaded with stashed pending edits should apply them correctly.');
81
- expect(tryGetInsertedLeafId(stashingTree.currentView)).to.equal(stashingTree.convertToNodeId(insertedLeafStableId), 'Tree collaborating with a client that applies stashed pending edits should also apply them.');
82
- const stableEdit = stabilizeEdit(stashingTree, edit);
83
- expect(stabilizeEdit(observerTree, getEditLogInternal(observerTree).tryGetEditFromId(edit.id) ?? fail())).to.deep.equal(stableEdit);
84
- expect(stabilizeEdit(stashingTree2, getEditLogInternal(stashingTree2).tryGetEditFromId(edit.id) ?? fail())).to.deep.equal(stableEdit);
85
- expect(observerTree.edits.length).to.equal(initialEditLogLength + 1);
86
- expect(stashingTree2.edits.length).to.equal(initialEditLogLength + 1);
87
- return testObjectProvider;
88
- }
89
- it('works across summaries', async () => {
90
- const smallTreeTraitLabel = '3b9e2dd8-def4-45fb-88bc-0df48df62314';
91
- // 1. Create a client
92
- const { testObjectProvider, tree: tree0 } = await setUpLocalServerTestSharedTree({
93
- id: documentId,
94
- writeFormat: WriteFormat.v0_0_2,
95
- });
96
- // 2. A second client joins
97
- let tree;
98
- let container;
99
- ({ container, tree } = await setUpLocalServerTestSharedTree({
100
- id: documentId,
101
- testObjectProvider,
102
- writeFormat: WriteFormat.v0_0_2,
103
- // To be removed ADO:5463
104
- featureGates: {
105
- 'Fluid.Container.ForceWriteConnection': true,
106
- },
107
- }));
108
- expect(countSmallTrees(tree0)).to.equal(0);
109
- expect(countSmallTrees(tree)).to.equal(0);
110
- // 3. The second client creates stashed ops and rejoins after a summary
111
- await waitForSummary(container);
112
- ({ tree, container } = await stash(container, () => insertSmallTree(tree)));
113
- await testObjectProvider.ensureSynchronized();
114
- expect(countSmallTrees(tree0)).to.equal(1);
115
- expect(countSmallTrees(tree)).to.equal(1);
116
- // 4. A third client joins, stashes and rejoins
117
- const { container: container2, tree: tree2 } = await setUpLocalServerTestSharedTree({
118
- id: documentId,
119
- testObjectProvider,
120
- writeFormat: WriteFormat.v0_0_2,
121
- });
122
- await stash(container2, () => insertSmallTree(tree2));
123
- await testObjectProvider.ensureSynchronized();
124
- expect(countSmallTrees(tree0)).to.equal(2);
125
- expect(countSmallTrees(tree)).to.equal(2);
126
- expect(countSmallTrees(tree2)).to.equal(2);
127
- /** Go offline, do something, then rejoin with pending local state */
128
- async function stash(container, action) {
129
- const { pendingLocalState } = await withContainerOffline(testObjectProvider, container, () => {
130
- action();
131
- });
132
- return setUpLocalServerTestSharedTree({
133
- id: documentId,
134
- testObjectProvider,
135
- writeFormat: WriteFormat.v0_0_2,
136
- pendingLocalState,
137
- });
138
- }
139
- async function waitForSummary(container) {
140
- return new Promise((resolve, reject) => {
141
- let summarized = false;
142
- container.on('op', (op) => {
143
- if (op.type === 'summarize') {
144
- summarized = true;
145
- }
146
- else if (summarized && op.type === 'summaryAck') {
147
- resolve();
148
- }
149
- else if (op.type === 'summaryNack') {
150
- reject(new Error('summaryNack'));
151
- }
152
- });
153
- });
154
- }
155
- /** Insert some arbitrary data */
156
- function insertSmallTree(tree) {
157
- return tree.applyEdit(Change.insertTree([
158
- {
159
- definition: '7335ea74-c92f-47f4-8f00-376a306796f4',
160
- traits: {
161
- 'e0901ba4-14c4-48e4-91a7-22a3068dc274': [
162
- {
163
- definition: '7335ea74-c92f-47f4-8f00-376a306796f4',
164
- traits: {
165
- 'e0901ba4-14c4-48e4-91a7-22a3068dc274': [
166
- {
167
- definition: '7335ea74-c92f-47f4-8f00-376a306796f4',
168
- },
169
- ],
170
- },
171
- },
172
- ],
173
- },
174
- },
175
- {
176
- definition: '7335ea74-c92f-47f4-8f00-376a306796f4',
177
- traits: {
178
- 'e0901ba4-14c4-48e4-91a7-22a3068dc274': [
179
- {
180
- definition: '7335ea74-c92f-47f4-8f00-376a306796f4',
181
- traits: {
182
- 'e0901ba4-14c4-48e4-91a7-22a3068dc274': [
183
- {
184
- definition: '7335ea74-c92f-47f4-8f00-376a306796f4',
185
- },
186
- ],
187
- },
188
- },
189
- ],
190
- },
191
- },
192
- ], StablePlace.atEndOf({
193
- label: smallTreeTraitLabel,
194
- parent: tree.currentView.root,
195
- }))).id;
196
- }
197
- /** Counts the number of trees that were inserted by `insertSmallTree` */
198
- function countSmallTrees(tree) {
199
- return (tree.currentView.getTrait({
200
- label: smallTreeTraitLabel,
201
- parent: tree.currentView.root,
202
- }).length / 2);
203
- }
204
- });
205
- it('cleans up temporary translation state', async () => {
206
- // Glass box test to ensure that SharedTree doesn't hold on to temporary stashed op
207
- // translation state for longer than necessary
208
- function clearedTemporaryStashState(tree) {
209
- return tree.stashedIdCompressor === null;
210
- }
211
- const { container: stashingContainer, tree, testObjectProvider } = await setUpLocalServerTestSharedTree({});
212
- await testObjectProvider.ensureSynchronized();
213
- const { pendingLocalState } = await withContainerOffline(testObjectProvider, stashingContainer, () => applyNoop(tree));
214
- await testObjectProvider.ensureSynchronized();
215
- const { tree: tree2 } = await setUpLocalServerTestSharedTree({
216
- testObjectProvider,
217
- pendingLocalState,
218
- });
219
- expect(clearedTemporaryStashState(tree2)).to.be.true;
220
- });
221
- });
222
- }
223
- //# sourceMappingURL=PendingLocalStateTests.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PendingLocalStateTests.js","sourceRoot":"","sources":["../../../src/test/utilities/PendingLocalStateTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9B,OAAO,EAAE,IAAI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oBACzB,KAAK,EAAE,mBAAmB;oBAC1B,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI;iBAC7B,CAAC,CAAC,MAAM,GAAG,CAAC,CACb,CAAC;YACH,CAAC;QACF,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;YACtD,mFAAmF;YACnF,8CAA8C;YAC9C,SAAS,0BAA0B,CAAC,IAAgB;gBACnD,OAAQ,IAAqD,CAAC,mBAAmB,KAAK,IAAI,CAAC;YAC5F,CAAC;YAED,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,MAAM,8BAA8B,CAAC,EAAE,CAAC,CAAC;YAC5G,MAAM,kBAAkB,CAAC,kBAAkB,EAAE,CAAC;YAE9C,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,oBAAoB,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,EAAE,CACpG,SAAS,CAAC,IAAI,CAAC,CACf,CAAC;YACF,MAAM,kBAAkB,CAAC,kBAAkB,EAAE,CAAC;YAE9C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,8BAA8B,CAAC;gBAC5D,kBAAkB;gBAClB,iBAAiB;aACjB,CAAC,CAAC;YAEH,MAAM,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACtD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { expect } from 'chai';\nimport { IContainer } from '@fluidframework/container-definitions';\nimport { TestObjectProvider } from '@fluidframework/test-utils';\nimport { fail } from '../../Common.js';\nimport { ChangeInternal, Edit, WriteFormat } from '../../persisted-types/index.js';\nimport type { EditLog } from '../../EditLog.js';\nimport { SharedTree } from '../../SharedTree.js';\nimport { Change, StablePlace } from '../../ChangeTypes.js';\nimport { TreeView } from '../../TreeView.js';\nimport { EditId, NodeId, TraitLabel } from '../../Identifiers.js';\nimport {\n\tapplyNoop,\n\tgetEditLogInternal,\n\tLocalServerSharedTreeTestingComponents,\n\tLocalServerSharedTreeTestingOptions,\n\tsetUpTestTree,\n\tstabilizeEdit,\n\twithContainerOffline,\n} from './TestUtilities.js';\nimport { SimpleTestTree } from './TestNode.js';\n\n/**\n * Runs a test suite for SharedTree's ability to apply pending local state stashed by the host.\n * See documentation on `applyStashedOp`.\n * This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.\n */\nexport function runPendingLocalStateTests(\n\ttitle: string,\n\tsetUpLocalServerTestSharedTree: (\n\t\toptions: LocalServerSharedTreeTestingOptions\n\t) => Promise<LocalServerSharedTreeTestingComponents>\n) {\n\tdescribe(title, () => {\n\t\tconst documentId = 'documentId';\n\n\t\tit('applies and submits ops from 0.0.2 in 0.0.2', async () =>\n\t\t\tapplyStashedOp(WriteFormat.v0_0_2, WriteFormat.v0_0_2));\n\t\t// TODO:#5357: Re-enable stashed ops tests\n\t\tit.skip('applies and submits ops from 0.0.2 in 0.1.1', async () =>\n\t\t\tapplyStashedOp(WriteFormat.v0_0_2, WriteFormat.v0_1_1));\n\t\t// TODO:#5357: Re-enable stashed ops tests\n\t\tit.skip('applies and submits ops from 0.1.1 in 0.0.2 (via upgrade)', async () => {\n\t\t\tconst testObjectProvider = await applyStashedOp(WriteFormat.v0_1_1, WriteFormat.v0_0_2);\n\n\t\t\t// https://dev.azure.com/fluidframework/internal/_workitems/edit/3347\n\t\t\tconst events = testObjectProvider.logger.reportAndClearTrackedEvents();\n\t\t\texpect(events.unexpectedErrors.length).to.equal(1);\n\t\t\texpect(events.unexpectedErrors[0].eventName).to.equal(\n\t\t\t\t'fluid:telemetry:ContainerRuntime:Outbox:ReferenceSequenceNumberMismatch'\n\t\t\t);\n\t\t});\n\t\t// TODO:#5357: Re-enable stashed ops tests\n\t\tit.skip('applies and submits ops from 0.1.1 in 0.1.1', async () =>\n\t\t\tapplyStashedOp(WriteFormat.v0_1_1, WriteFormat.v0_1_1));\n\n\t\tasync function applyStashedOp(treeVersion: WriteFormat, opVersion: WriteFormat): Promise<TestObjectProvider> {\n\t\t\tconst {\n\t\t\t\tcontainer: stashingContainer,\n\t\t\t\ttree: stashingTree,\n\t\t\t\ttestObjectProvider,\n\t\t\t} = await setUpLocalServerTestSharedTree({\n\t\t\t\tid: documentId,\n\t\t\t\twriteFormat: opVersion,\n\t\t\t});\n\t\t\tconst stashingTestTree = setUpTestTree(stashingTree);\n\t\t\tconst { tree: observerTree } = await setUpLocalServerTestSharedTree({\n\t\t\t\tid: documentId,\n\t\t\t\ttestObjectProvider,\n\t\t\t\twriteFormat: treeVersion,\n\t\t\t});\n\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\tconst initialEditLogLength = stashingTree.edits.length;\n\n\t\t\tconst insertedLeafLabel = 'leaf' as TraitLabel;\n\t\t\tconst insertedLeafNodeId = stashingTestTree.generateNodeId('insertedLeafId');\n\t\t\tconst insertedLeafStableId = stashingTestTree.convertToStableNodeId(insertedLeafNodeId);\n\t\t\tconst { pendingLocalState, actionReturn: edit } = await withContainerOffline(\n\t\t\t\ttestObjectProvider,\n\t\t\t\tstashingContainer,\n\t\t\t\t() =>\n\t\t\t\t\tstashingTree.applyEdit(\n\t\t\t\t\t\t...Change.insertTree(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...stashingTestTree.buildLeaf(),\n\t\t\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\t\t\t[insertedLeafLabel]: stashingTestTree.buildLeaf(insertedLeafNodeId),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tStablePlace.after(stashingTestTree.left)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t);\n\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\tconst observerAfterStash = observerTree.currentView;\n\n\t\t\t// Simulate reconnect of user 1; a new container will be created which passes the stashed local state in its\n\t\t\t// load request.\n\t\t\tconst { tree: stashingTree2 } = await setUpLocalServerTestSharedTree({\n\t\t\t\ttestObjectProvider,\n\t\t\t\tpendingLocalState,\n\t\t\t\tid: documentId,\n\t\t\t\twriteFormat: treeVersion,\n\t\t\t});\n\n\t\t\texpect((stashingTree2.edits as unknown as EditLog<ChangeInternal>).isLocalEdit(edit.id)).to.be.true; // Kludge\n\n\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\tawait testObjectProvider.ensureSynchronized(); // Synchronize twice in case stashed ops caused an upgrade round-trip\n\n\t\t\tfunction tryGetInsertedLeafId(view: TreeView): NodeId | undefined {\n\t\t\t\tconst rootNode = view.getViewNode(\n\t\t\t\t\tview.getTrait({ parent: view.root, label: SimpleTestTree.traitLabel })[0]\n\t\t\t\t);\n\t\t\t\tconst leftTrait = view.getTrait({ parent: rootNode.identifier, label: SimpleTestTree.leftTraitLabel });\n\t\t\t\tif (leftTrait.length !== 2) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tconst insertedParent = view.tryGetViewNode(leftTrait[1]);\n\t\t\t\tif (insertedParent === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn view.getTrait({ parent: insertedParent.identifier, label: insertedLeafLabel })[0];\n\t\t\t}\n\n\t\t\texpect(tryGetInsertedLeafId(observerAfterStash)).to.equal(\n\t\t\t\tundefined,\n\t\t\t\t'Observing tree should not receive edits made by the stashing tree after it went offline.'\n\t\t\t);\n\t\t\texpect(tryGetInsertedLeafId(stashingTree2.currentView)).to.equal(\n\t\t\t\tstashingTree2.convertToNodeId(insertedLeafStableId),\n\t\t\t\t'Tree which loaded with stashed pending edits should apply them correctly.'\n\t\t\t);\n\t\t\texpect(tryGetInsertedLeafId(stashingTree.currentView)).to.equal(\n\t\t\t\tstashingTree.convertToNodeId(insertedLeafStableId),\n\t\t\t\t'Tree collaborating with a client that applies stashed pending edits should also apply them.'\n\t\t\t);\n\n\t\t\tconst stableEdit = stabilizeEdit(stashingTree, edit as unknown as Edit<ChangeInternal>);\n\t\t\texpect(\n\t\t\t\tstabilizeEdit(observerTree, getEditLogInternal(observerTree).tryGetEditFromId(edit.id) ?? fail())\n\t\t\t).to.deep.equal(stableEdit);\n\n\t\t\texpect(\n\t\t\t\tstabilizeEdit(stashingTree2, getEditLogInternal(stashingTree2).tryGetEditFromId(edit.id) ?? fail())\n\t\t\t).to.deep.equal(stableEdit);\n\n\t\t\texpect(observerTree.edits.length).to.equal(initialEditLogLength + 1);\n\t\t\texpect(stashingTree2.edits.length).to.equal(initialEditLogLength + 1);\n\n\t\t\treturn testObjectProvider;\n\t\t}\n\n\t\tit('works across summaries', async () => {\n\t\t\tconst smallTreeTraitLabel = '3b9e2dd8-def4-45fb-88bc-0df48df62314' as TraitLabel;\n\n\t\t\t// 1. Create a client\n\t\t\tconst { testObjectProvider, tree: tree0 } = await setUpLocalServerTestSharedTree({\n\t\t\t\tid: documentId,\n\t\t\t\twriteFormat: WriteFormat.v0_0_2,\n\t\t\t});\n\n\t\t\t// 2. A second client joins\n\t\t\tlet tree: SharedTree;\n\t\t\tlet container: IContainer;\n\t\t\t({ container, tree } = await setUpLocalServerTestSharedTree({\n\t\t\t\tid: documentId,\n\t\t\t\ttestObjectProvider,\n\t\t\t\twriteFormat: WriteFormat.v0_0_2,\n\t\t\t\t// To be removed ADO:5463\n\t\t\t\tfeatureGates: {\n\t\t\t\t\t'Fluid.Container.ForceWriteConnection': true,\n\t\t\t\t},\n\t\t\t}));\n\n\t\t\texpect(countSmallTrees(tree0)).to.equal(0);\n\t\t\texpect(countSmallTrees(tree)).to.equal(0);\n\n\t\t\t// 3. The second client creates stashed ops and rejoins after a summary\n\t\t\tawait waitForSummary(container);\n\t\t\t({ tree, container } = await stash(container, () => insertSmallTree(tree)));\n\t\t\tawait testObjectProvider.ensureSynchronized();\n\n\t\t\texpect(countSmallTrees(tree0)).to.equal(1);\n\t\t\texpect(countSmallTrees(tree)).to.equal(1);\n\n\t\t\t// 4. A third client joins, stashes and rejoins\n\t\t\tconst { container: container2, tree: tree2 } = await setUpLocalServerTestSharedTree({\n\t\t\t\tid: documentId,\n\t\t\t\ttestObjectProvider,\n\t\t\t\twriteFormat: WriteFormat.v0_0_2,\n\t\t\t});\n\n\t\t\tawait stash(container2, () => insertSmallTree(tree2));\n\t\t\tawait testObjectProvider.ensureSynchronized();\n\n\t\t\texpect(countSmallTrees(tree0)).to.equal(2);\n\t\t\texpect(countSmallTrees(tree)).to.equal(2);\n\t\t\texpect(countSmallTrees(tree2)).to.equal(2);\n\n\t\t\t/** Go offline, do something, then rejoin with pending local state */\n\t\t\tasync function stash(\n\t\t\t\tcontainer: IContainer,\n\t\t\t\taction: () => void\n\t\t\t): Promise<{ tree: SharedTree; container: IContainer }> {\n\t\t\t\tconst { pendingLocalState } = await withContainerOffline(testObjectProvider, container, () => {\n\t\t\t\t\taction();\n\t\t\t\t});\n\t\t\t\treturn setUpLocalServerTestSharedTree({\n\t\t\t\t\tid: documentId,\n\t\t\t\t\ttestObjectProvider,\n\t\t\t\t\twriteFormat: WriteFormat.v0_0_2,\n\t\t\t\t\tpendingLocalState,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tasync function waitForSummary(container: IContainer): Promise<void> {\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\tlet summarized = false;\n\t\t\t\t\tcontainer.on('op', (op) => {\n\t\t\t\t\t\tif (op.type === 'summarize') {\n\t\t\t\t\t\t\tsummarized = true;\n\t\t\t\t\t\t} else if (summarized && op.type === 'summaryAck') {\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t} else if (op.type === 'summaryNack') {\n\t\t\t\t\t\t\treject(new Error('summaryNack'));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/** Insert some arbitrary data */\n\t\t\tfunction insertSmallTree(tree: SharedTree): EditId {\n\t\t\t\treturn tree.applyEdit(\n\t\t\t\t\tChange.insertTree(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdefinition: '7335ea74-c92f-47f4-8f00-376a306796f4',\n\t\t\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\t\t\t'e0901ba4-14c4-48e4-91a7-22a3068dc274': [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdefinition: '7335ea74-c92f-47f4-8f00-376a306796f4',\n\t\t\t\t\t\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\t\t\t\t\t\t'e0901ba4-14c4-48e4-91a7-22a3068dc274': [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefinition: '7335ea74-c92f-47f4-8f00-376a306796f4',\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdefinition: '7335ea74-c92f-47f4-8f00-376a306796f4',\n\t\t\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\t\t\t'e0901ba4-14c4-48e4-91a7-22a3068dc274': [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdefinition: '7335ea74-c92f-47f4-8f00-376a306796f4',\n\t\t\t\t\t\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\t\t\t\t\t\t'e0901ba4-14c4-48e4-91a7-22a3068dc274': [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefinition: '7335ea74-c92f-47f4-8f00-376a306796f4',\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tStablePlace.atEndOf({\n\t\t\t\t\t\t\tlabel: smallTreeTraitLabel,\n\t\t\t\t\t\t\tparent: tree.currentView.root,\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t).id;\n\t\t\t}\n\n\t\t\t/** Counts the number of trees that were inserted by `insertSmallTree` */\n\t\t\tfunction countSmallTrees(tree: SharedTree): number {\n\t\t\t\treturn (\n\t\t\t\t\ttree.currentView.getTrait({\n\t\t\t\t\t\tlabel: smallTreeTraitLabel,\n\t\t\t\t\t\tparent: tree.currentView.root,\n\t\t\t\t\t}).length / 2\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tit('cleans up temporary translation state', async () => {\n\t\t\t// Glass box test to ensure that SharedTree doesn't hold on to temporary stashed op\n\t\t\t// translation state for longer than necessary\n\t\t\tfunction clearedTemporaryStashState(tree: SharedTree): boolean {\n\t\t\t\treturn (tree as unknown as { stashedIdCompressor?: unknown }).stashedIdCompressor === null;\n\t\t\t}\n\n\t\t\tconst { container: stashingContainer, tree, testObjectProvider } = await setUpLocalServerTestSharedTree({});\n\t\t\tawait testObjectProvider.ensureSynchronized();\n\n\t\t\tconst { pendingLocalState } = await withContainerOffline(testObjectProvider, stashingContainer, () =>\n\t\t\t\tapplyNoop(tree)\n\t\t\t);\n\t\t\tawait testObjectProvider.ensureSynchronized();\n\n\t\t\tconst { tree: tree2 } = await setUpLocalServerTestSharedTree({\n\t\t\t\ttestObjectProvider,\n\t\t\t\tpendingLocalState,\n\t\t\t});\n\n\t\t\texpect(clearedTemporaryStashState(tree2)).to.be.true;\n\t\t});\n\t});\n}\n"]}
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { WriteFormat } from '../../persisted-types/index.js';
6
- import { SharedTreeTestingComponents, SharedTreeTestingOptions } from './TestUtilities.js';
7
- /**
8
- * Runs a test suite for operations on `SharedTree` writing ops at `writeFormat`.
9
- * This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.
10
- */
11
- export declare function runSharedTreeOperationsTests(title: string, writeFormat: WriteFormat, setUpTestSharedTreeWithDefaultVersion: (options?: SharedTreeTestingOptions) => SharedTreeTestingComponents): void;
12
- //# sourceMappingURL=SharedTreeTests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SharedTreeTests.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/SharedTreeTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,OAAO,EAUN,WAAW,EACX,MAAM,gCAAgC,CAAC;AAaxC,OAAO,EAGN,2BAA2B,EAC3B,wBAAwB,EAWxB,MAAM,oBAAoB,CAAC;AAa5B;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,qCAAqC,EAAE,CAAC,OAAO,CAAC,EAAE,wBAAwB,KAAK,2BAA2B,QAg0C1G"}