@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.
- package/CHANGELOG.md +23 -0
- package/api-report/experimental-tree.api.md +2 -2
- package/dist/ChangeCompression.d.ts +2 -2
- package/dist/ChangeCompression.d.ts.map +1 -1
- package/dist/ChangeCompression.js +1 -1
- package/dist/ChangeCompression.js.map +1 -1
- package/dist/ChangeTypes.d.ts +1 -1
- package/dist/ChangeTypes.d.ts.map +1 -1
- package/dist/ChangeTypes.js +4 -4
- package/dist/ChangeTypes.js.map +1 -1
- package/dist/Checkout.d.ts +3 -3
- package/dist/Checkout.d.ts.map +1 -1
- package/dist/Checkout.js +17 -17
- package/dist/Checkout.js.map +1 -1
- package/dist/EditLog.d.ts +1 -1
- package/dist/EditLog.d.ts.map +1 -1
- package/dist/EditLog.js +9 -9
- package/dist/EditLog.js.map +1 -1
- package/dist/EditUtilities.d.ts +3 -3
- package/dist/EditUtilities.d.ts.map +1 -1
- package/dist/EditUtilities.js +6 -6
- package/dist/EditUtilities.js.map +1 -1
- package/dist/Forest.d.ts.map +1 -1
- package/dist/Forest.js +23 -23
- package/dist/Forest.js.map +1 -1
- package/dist/HistoryEditFactory.d.ts +1 -1
- package/dist/HistoryEditFactory.d.ts.map +1 -1
- package/dist/HistoryEditFactory.js +7 -7
- package/dist/HistoryEditFactory.js.map +1 -1
- package/dist/IdConversion.d.ts.map +1 -1
- package/dist/IdConversion.js.map +1 -1
- package/dist/LogViewer.d.ts +2 -2
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +7 -7
- package/dist/LogViewer.js.map +1 -1
- package/dist/MergeHealth.d.ts.map +1 -1
- package/dist/MergeHealth.js +1 -1
- package/dist/MergeHealth.js.map +1 -1
- package/dist/NodeIdUtilities.d.ts +1 -1
- package/dist/NodeIdUtilities.d.ts.map +1 -1
- package/dist/NodeIdUtilities.js +1 -1
- package/dist/NodeIdUtilities.js.map +1 -1
- package/dist/PayloadUtilities.d.ts.map +1 -1
- package/dist/PayloadUtilities.js +2 -2
- package/dist/PayloadUtilities.js.map +1 -1
- package/dist/ReconciliationPath.d.ts +1 -1
- package/dist/ReconciliationPath.d.ts.map +1 -1
- package/dist/ReconciliationPath.js.map +1 -1
- package/dist/RevisionValueCache.d.ts.map +1 -1
- package/dist/RevisionValueCache.js +2 -2
- package/dist/RevisionValueCache.js.map +1 -1
- package/dist/RevisionView.d.ts +2 -2
- package/dist/RevisionView.d.ts.map +1 -1
- package/dist/RevisionView.js.map +1 -1
- package/dist/SerializationUtilities.d.ts +1 -1
- package/dist/SerializationUtilities.d.ts.map +1 -1
- package/dist/SerializationUtilities.js.map +1 -1
- package/dist/SharedTree.d.ts +8 -7
- package/dist/SharedTree.d.ts.map +1 -1
- package/dist/SharedTree.js +78 -78
- package/dist/SharedTree.js.map +1 -1
- package/dist/SharedTreeEncoder.d.ts +1 -1
- package/dist/SharedTreeEncoder.d.ts.map +1 -1
- package/dist/SharedTreeEncoder.js +31 -31
- package/dist/SharedTreeEncoder.js.map +1 -1
- package/dist/Summary.d.ts +2 -2
- package/dist/Summary.d.ts.map +1 -1
- package/dist/Summary.js +2 -2
- package/dist/Summary.js.map +1 -1
- package/dist/SummaryBackCompatibility.d.ts.map +1 -1
- package/dist/SummaryBackCompatibility.js.map +1 -1
- package/dist/SummaryTestUtilities.d.ts +1 -1
- package/dist/SummaryTestUtilities.d.ts.map +1 -1
- package/dist/SummaryTestUtilities.js.map +1 -1
- package/dist/Transaction.d.ts +3 -3
- package/dist/Transaction.d.ts.map +1 -1
- package/dist/Transaction.js +3 -3
- package/dist/Transaction.js.map +1 -1
- package/dist/TransactionInternal.d.ts +3 -3
- package/dist/TransactionInternal.d.ts.map +1 -1
- package/dist/TransactionInternal.js +6 -6
- package/dist/TransactionInternal.js.map +1 -1
- package/dist/TreeCompressor.d.ts +5 -1
- package/dist/TreeCompressor.d.ts.map +1 -1
- package/dist/TreeCompressor.js +5 -5
- package/dist/TreeCompressor.js.map +1 -1
- package/dist/TreeNodeHandle.d.ts +1 -1
- package/dist/TreeNodeHandle.d.ts.map +1 -1
- package/dist/TreeNodeHandle.js.map +1 -1
- package/dist/TreeView.d.ts +1 -1
- package/dist/TreeView.d.ts.map +1 -1
- package/dist/TreeView.js +2 -3
- package/dist/TreeView.js.map +1 -1
- package/dist/UuidUtilities.d.ts.map +1 -1
- package/dist/UuidUtilities.js.map +1 -1
- package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
- package/dist/id-compressor/AppendOnlySortedMap.js +3 -3
- package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/IdCompressor.d.ts +1 -1
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
- package/dist/id-compressor/IdCompressor.js +25 -26
- package/dist/id-compressor/IdCompressor.js.map +1 -1
- package/dist/id-compressor/IdRange.d.ts.map +1 -1
- package/dist/id-compressor/IdRange.js +2 -2
- package/dist/id-compressor/IdRange.js.map +1 -1
- package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
- package/dist/id-compressor/NumericUuid.js +2 -1
- package/dist/id-compressor/NumericUuid.js.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.js +8 -9
- package/dist/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/dist/migration-shim/migrationDeltaHandler.d.ts +1 -1
- package/dist/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
- package/dist/migration-shim/migrationDeltaHandler.js +11 -11
- package/dist/migration-shim/migrationDeltaHandler.js.map +1 -1
- package/dist/migration-shim/migrationShim.d.ts +8 -4
- package/dist/migration-shim/migrationShim.d.ts.map +1 -1
- package/dist/migration-shim/migrationShim.js +13 -13
- package/dist/migration-shim/migrationShim.js.map +1 -1
- package/dist/migration-shim/migrationShimFactory.d.ts +2 -2
- package/dist/migration-shim/migrationShimFactory.d.ts.map +1 -1
- package/dist/migration-shim/migrationShimFactory.js +2 -2
- package/dist/migration-shim/migrationShimFactory.js.map +1 -1
- package/dist/migration-shim/packageVersion.d.ts +0 -2
- package/dist/migration-shim/packageVersion.d.ts.map +1 -1
- package/dist/migration-shim/packageVersion.js +0 -2
- package/dist/migration-shim/packageVersion.js.map +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.js +8 -8
- package/dist/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
- package/dist/migration-shim/sharedTreeShim.d.ts +2 -2
- package/dist/migration-shim/sharedTreeShim.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeShim.js +8 -4
- package/dist/migration-shim/sharedTreeShim.js.map +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.d.ts +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.js +2 -2
- package/dist/migration-shim/sharedTreeShimFactory.js.map +1 -1
- package/dist/migration-shim/shimChannelServices.d.ts +1 -1
- package/dist/migration-shim/shimChannelServices.d.ts.map +1 -1
- package/dist/migration-shim/shimChannelServices.js.map +1 -1
- package/dist/migration-shim/shimDeltaConnection.d.ts +1 -1
- package/dist/migration-shim/shimDeltaConnection.d.ts.map +1 -1
- package/dist/migration-shim/shimDeltaConnection.js +2 -2
- package/dist/migration-shim/shimDeltaConnection.js.map +1 -1
- package/dist/migration-shim/shimHandle.d.ts.map +1 -1
- package/dist/migration-shim/shimHandle.js.map +1 -1
- package/dist/migration-shim/types.d.ts +1 -1
- package/dist/migration-shim/types.d.ts.map +1 -1
- package/dist/migration-shim/types.js.map +1 -1
- package/dist/migration-shim/utils.d.ts +1 -1
- package/dist/migration-shim/utils.d.ts.map +1 -1
- package/dist/migration-shim/utils.js.map +1 -1
- package/dist/persisted-types/0.0.2.d.ts +1 -1
- package/dist/persisted-types/0.0.2.d.ts.map +1 -1
- package/dist/persisted-types/0.0.2.js.map +1 -1
- package/dist/persisted-types/0.1.1.d.ts +1 -1
- package/dist/persisted-types/0.1.1.d.ts.map +1 -1
- package/dist/persisted-types/0.1.1.js +3 -3
- package/dist/persisted-types/0.1.1.js.map +1 -1
- package/lib/ChangeCompression.d.ts +2 -2
- package/lib/ChangeCompression.d.ts.map +1 -1
- package/lib/ChangeCompression.js +1 -1
- package/lib/ChangeCompression.js.map +1 -1
- package/lib/ChangeTypes.d.ts +1 -1
- package/lib/ChangeTypes.d.ts.map +1 -1
- package/lib/ChangeTypes.js +2 -2
- package/lib/ChangeTypes.js.map +1 -1
- package/lib/Checkout.d.ts +3 -3
- package/lib/Checkout.d.ts.map +1 -1
- package/lib/Checkout.js +4 -4
- package/lib/Checkout.js.map +1 -1
- package/lib/EditLog.d.ts +1 -1
- package/lib/EditLog.d.ts.map +1 -1
- package/lib/EditLog.js +2 -2
- package/lib/EditLog.js.map +1 -1
- package/lib/EditUtilities.d.ts +3 -3
- package/lib/EditUtilities.d.ts.map +1 -1
- package/lib/EditUtilities.js +5 -5
- package/lib/EditUtilities.js.map +1 -1
- package/lib/Forest.d.ts.map +1 -1
- package/lib/Forest.js +2 -2
- package/lib/Forest.js.map +1 -1
- package/lib/HistoryEditFactory.d.ts +1 -1
- package/lib/HistoryEditFactory.d.ts.map +1 -1
- package/lib/HistoryEditFactory.js +5 -5
- package/lib/HistoryEditFactory.js.map +1 -1
- package/lib/IdConversion.d.ts.map +1 -1
- package/lib/IdConversion.js.map +1 -1
- package/lib/LogViewer.d.ts +2 -2
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +3 -3
- package/lib/LogViewer.js.map +1 -1
- package/lib/MergeHealth.d.ts.map +1 -1
- package/lib/MergeHealth.js +1 -1
- package/lib/MergeHealth.js.map +1 -1
- package/lib/NodeIdUtilities.d.ts +1 -1
- package/lib/NodeIdUtilities.d.ts.map +1 -1
- package/lib/NodeIdUtilities.js +1 -1
- package/lib/NodeIdUtilities.js.map +1 -1
- package/lib/PayloadUtilities.d.ts.map +1 -1
- package/lib/PayloadUtilities.js +1 -1
- package/lib/PayloadUtilities.js.map +1 -1
- package/lib/ReconciliationPath.d.ts +1 -1
- package/lib/ReconciliationPath.d.ts.map +1 -1
- package/lib/ReconciliationPath.js.map +1 -1
- package/lib/RevisionValueCache.d.ts.map +1 -1
- package/lib/RevisionValueCache.js +2 -2
- package/lib/RevisionValueCache.js.map +1 -1
- package/lib/RevisionView.d.ts +2 -2
- package/lib/RevisionView.d.ts.map +1 -1
- package/lib/RevisionView.js.map +1 -1
- package/lib/SerializationUtilities.d.ts +1 -1
- package/lib/SerializationUtilities.d.ts.map +1 -1
- package/lib/SerializationUtilities.js.map +1 -1
- package/lib/SharedTree.d.ts +8 -7
- package/lib/SharedTree.d.ts.map +1 -1
- package/lib/SharedTree.js +13 -13
- package/lib/SharedTree.js.map +1 -1
- package/lib/SharedTreeEncoder.d.ts +1 -1
- package/lib/SharedTreeEncoder.d.ts.map +1 -1
- package/lib/SharedTreeEncoder.js +5 -5
- package/lib/SharedTreeEncoder.js.map +1 -1
- package/lib/Summary.d.ts +2 -2
- package/lib/Summary.d.ts.map +1 -1
- package/lib/Summary.js +1 -1
- package/lib/Summary.js.map +1 -1
- package/lib/SummaryBackCompatibility.d.ts.map +1 -1
- package/lib/SummaryBackCompatibility.js.map +1 -1
- package/lib/SummaryTestUtilities.d.ts +1 -1
- package/lib/SummaryTestUtilities.d.ts.map +1 -1
- package/lib/SummaryTestUtilities.js.map +1 -1
- package/lib/Transaction.d.ts +3 -3
- package/lib/Transaction.d.ts.map +1 -1
- package/lib/Transaction.js +3 -3
- package/lib/Transaction.js.map +1 -1
- package/lib/TransactionInternal.d.ts +3 -3
- package/lib/TransactionInternal.d.ts.map +1 -1
- package/lib/TransactionInternal.js +3 -3
- package/lib/TransactionInternal.js.map +1 -1
- package/lib/TreeCompressor.d.ts +5 -1
- package/lib/TreeCompressor.d.ts.map +1 -1
- package/lib/TreeCompressor.js +2 -2
- package/lib/TreeCompressor.js.map +1 -1
- package/lib/TreeNodeHandle.d.ts +1 -1
- package/lib/TreeNodeHandle.d.ts.map +1 -1
- package/lib/TreeNodeHandle.js.map +1 -1
- package/lib/TreeView.d.ts +1 -1
- package/lib/TreeView.d.ts.map +1 -1
- package/lib/TreeView.js +1 -2
- package/lib/TreeView.js.map +1 -1
- package/lib/UuidUtilities.d.ts.map +1 -1
- package/lib/UuidUtilities.js +1 -1
- package/lib/UuidUtilities.js.map +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/IdCompressor.d.ts +1 -1
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
- package/lib/id-compressor/IdCompressor.js +4 -5
- package/lib/id-compressor/IdCompressor.js.map +1 -1
- package/lib/id-compressor/IdRange.d.ts.map +1 -1
- package/lib/id-compressor/IdRange.js +1 -1
- package/lib/id-compressor/IdRange.js.map +1 -1
- package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
- package/lib/id-compressor/NumericUuid.js +2 -1
- package/lib/id-compressor/NumericUuid.js.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.js +1 -2
- package/lib/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/lib/migration-shim/migrationDeltaHandler.d.ts +1 -1
- package/lib/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
- package/lib/migration-shim/migrationDeltaHandler.js +1 -1
- package/lib/migration-shim/migrationDeltaHandler.js.map +1 -1
- package/lib/migration-shim/migrationShim.d.ts +8 -4
- package/lib/migration-shim/migrationShim.d.ts.map +1 -1
- package/lib/migration-shim/migrationShim.js +3 -3
- package/lib/migration-shim/migrationShim.js.map +1 -1
- package/lib/migration-shim/migrationShimFactory.d.ts +2 -2
- package/lib/migration-shim/migrationShimFactory.d.ts.map +1 -1
- package/lib/migration-shim/migrationShimFactory.js +1 -1
- package/lib/migration-shim/migrationShimFactory.js.map +1 -1
- package/lib/migration-shim/packageVersion.d.ts +0 -2
- package/lib/migration-shim/packageVersion.d.ts.map +1 -1
- package/lib/migration-shim/packageVersion.js +0 -2
- package/lib/migration-shim/packageVersion.js.map +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.js +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
- package/lib/migration-shim/sharedTreeShim.d.ts +2 -2
- package/lib/migration-shim/sharedTreeShim.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeShim.js +6 -2
- package/lib/migration-shim/sharedTreeShim.js.map +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.d.ts +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.js +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.js.map +1 -1
- package/lib/migration-shim/shimChannelServices.d.ts +1 -1
- package/lib/migration-shim/shimChannelServices.d.ts.map +1 -1
- package/lib/migration-shim/shimChannelServices.js.map +1 -1
- package/lib/migration-shim/shimDeltaConnection.d.ts +1 -1
- package/lib/migration-shim/shimDeltaConnection.d.ts.map +1 -1
- package/lib/migration-shim/shimDeltaConnection.js +1 -1
- package/lib/migration-shim/shimDeltaConnection.js.map +1 -1
- package/lib/migration-shim/shimHandle.d.ts.map +1 -1
- package/lib/migration-shim/shimHandle.js.map +1 -1
- package/lib/migration-shim/types.d.ts +1 -1
- package/lib/migration-shim/types.d.ts.map +1 -1
- package/lib/migration-shim/types.js.map +1 -1
- package/lib/migration-shim/utils.d.ts +1 -1
- package/lib/migration-shim/utils.d.ts.map +1 -1
- package/lib/migration-shim/utils.js.map +1 -1
- package/lib/persisted-types/0.0.2.d.ts +1 -1
- package/lib/persisted-types/0.0.2.d.ts.map +1 -1
- package/lib/persisted-types/0.0.2.js.map +1 -1
- package/lib/persisted-types/0.1.1.d.ts +1 -1
- package/lib/persisted-types/0.1.1.d.ts.map +1 -1
- package/lib/persisted-types/0.1.1.js +1 -1
- package/lib/persisted-types/0.1.1.js.map +1 -1
- package/package.json +33 -32
- package/src/ChangeCompression.ts +8 -8
- package/src/ChangeTypes.ts +5 -4
- package/src/Checkout.ts +9 -7
- package/src/EditLog.ts +4 -3
- package/src/EditUtilities.ts +9 -8
- package/src/Forest.ts +3 -2
- package/src/HistoryEditFactory.ts +12 -11
- package/src/IdConversion.ts +2 -2
- package/src/LogViewer.ts +5 -4
- package/src/MergeHealth.ts +2 -1
- package/src/NodeIdUtilities.ts +2 -2
- package/src/PayloadUtilities.ts +2 -1
- package/src/ReconciliationPath.ts +1 -1
- package/src/RevisionValueCache.ts +3 -2
- package/src/RevisionView.ts +3 -3
- package/src/SerializationUtilities.ts +1 -1
- package/src/SharedTree.ts +46 -49
- package/src/SharedTreeEncoder.ts +30 -29
- package/src/Summary.ts +5 -3
- package/src/SummaryBackCompatibility.ts +1 -0
- package/src/SummaryTestUtilities.ts +2 -1
- package/src/Transaction.ts +7 -6
- package/src/TransactionInternal.ts +17 -16
- package/src/TreeCompressor.ts +6 -4
- package/src/TreeNodeHandle.ts +2 -2
- package/src/TreeView.ts +3 -3
- package/src/UuidUtilities.ts +2 -1
- package/src/id-compressor/AppendOnlySortedMap.ts +2 -1
- package/src/id-compressor/IdCompressor.ts +18 -17
- package/src/id-compressor/IdRange.ts +2 -1
- package/src/id-compressor/NumericUuid.ts +1 -1
- package/src/id-compressor/SessionIdNormalizer.ts +3 -3
- package/src/migration-shim/migrationDeltaHandler.ts +3 -2
- package/src/migration-shim/migrationShim.ts +14 -10
- package/src/migration-shim/migrationShimFactory.ts +6 -4
- package/src/migration-shim/packageVersion.ts +0 -2
- package/src/migration-shim/sharedTreeDeltaHandler.ts +3 -2
- package/src/migration-shim/sharedTreeShim.ts +7 -5
- package/src/migration-shim/sharedTreeShimFactory.ts +3 -3
- package/src/migration-shim/shimChannelServices.ts +1 -1
- package/src/migration-shim/shimDeltaConnection.ts +3 -2
- package/src/migration-shim/shimHandle.ts +1 -0
- package/src/migration-shim/types.ts +3 -1
- package/src/migration-shim/utils.ts +2 -1
- package/src/persisted-types/0.0.2.ts +2 -2
- package/src/persisted-types/0.1.1.ts +10 -8
- package/dist/tree-alpha.d.ts +0 -2901
- package/dist/tree-beta.d.ts +0 -348
- package/dist/tree-public.d.ts +0 -348
- package/dist/tree-untrimmed.d.ts +0 -3820
- package/lib/test/AppendOnlySortedMap.perf.tests.d.ts +0 -6
- package/lib/test/AppendOnlySortedMap.perf.tests.d.ts.map +0 -1
- package/lib/test/AppendOnlySortedMap.perf.tests.js +0 -49
- package/lib/test/AppendOnlySortedMap.perf.tests.js.map +0 -1
- package/lib/test/AppendOnlySortedMap.tests.d.ts +0 -6
- package/lib/test/AppendOnlySortedMap.tests.d.ts.map +0 -1
- package/lib/test/AppendOnlySortedMap.tests.js +0 -213
- package/lib/test/AppendOnlySortedMap.tests.js.map +0 -1
- package/lib/test/ChangeCompression.tests.d.ts +0 -6
- package/lib/test/ChangeCompression.tests.d.ts.map +0 -1
- package/lib/test/ChangeCompression.tests.js +0 -154
- package/lib/test/ChangeCompression.tests.js.map +0 -1
- package/lib/test/Checkout.tests.d.ts +0 -10
- package/lib/test/Checkout.tests.d.ts.map +0 -1
- package/lib/test/Checkout.tests.js +0 -460
- package/lib/test/Checkout.tests.js.map +0 -1
- package/lib/test/Common.tests.d.ts +0 -6
- package/lib/test/Common.tests.d.ts.map +0 -1
- package/lib/test/Common.tests.js +0 -102
- package/lib/test/Common.tests.js.map +0 -1
- package/lib/test/EagerCheckout.tests.d.ts +0 -6
- package/lib/test/EagerCheckout.tests.d.ts.map +0 -1
- package/lib/test/EagerCheckout.tests.js +0 -20
- package/lib/test/EagerCheckout.tests.js.map +0 -1
- package/lib/test/Edit.tests.d.ts +0 -6
- package/lib/test/Edit.tests.d.ts.map +0 -1
- package/lib/test/Edit.tests.js +0 -60
- package/lib/test/Edit.tests.js.map +0 -1
- package/lib/test/EditLog.perf.tests.d.ts +0 -6
- package/lib/test/EditLog.perf.tests.d.ts.map +0 -1
- package/lib/test/EditLog.perf.tests.js +0 -41
- package/lib/test/EditLog.perf.tests.js.map +0 -1
- package/lib/test/EditLog.tests.d.ts +0 -6
- package/lib/test/EditLog.tests.d.ts.map +0 -1
- package/lib/test/EditLog.tests.js +0 -355
- package/lib/test/EditLog.tests.js.map +0 -1
- package/lib/test/EditUtilities.tests.d.ts +0 -6
- package/lib/test/EditUtilities.tests.d.ts.map +0 -1
- package/lib/test/EditUtilities.tests.js +0 -512
- package/lib/test/EditUtilities.tests.js.map +0 -1
- package/lib/test/Forest.perf.tests.d.ts +0 -6
- package/lib/test/Forest.perf.tests.d.ts.map +0 -1
- package/lib/test/Forest.perf.tests.js +0 -135
- package/lib/test/Forest.perf.tests.js.map +0 -1
- package/lib/test/Forest.tests.d.ts +0 -6
- package/lib/test/Forest.tests.d.ts.map +0 -1
- package/lib/test/Forest.tests.js +0 -213
- package/lib/test/Forest.tests.js.map +0 -1
- package/lib/test/GenericTransaction.tests.d.ts +0 -6
- package/lib/test/GenericTransaction.tests.d.ts.map +0 -1
- package/lib/test/GenericTransaction.tests.js +0 -31
- package/lib/test/GenericTransaction.tests.js.map +0 -1
- package/lib/test/HistoryEditFactory.tests.d.ts +0 -6
- package/lib/test/HistoryEditFactory.tests.d.ts.map +0 -1
- package/lib/test/HistoryEditFactory.tests.js +0 -170
- package/lib/test/HistoryEditFactory.tests.js.map +0 -1
- package/lib/test/IdCompressor.perf.tests.d.ts +0 -6
- package/lib/test/IdCompressor.perf.tests.d.ts.map +0 -1
- package/lib/test/IdCompressor.perf.tests.js +0 -290
- package/lib/test/IdCompressor.perf.tests.js.map +0 -1
- package/lib/test/IdCompressor.tests.d.ts +0 -6
- package/lib/test/IdCompressor.tests.d.ts.map +0 -1
- package/lib/test/IdCompressor.tests.js +0 -1542
- package/lib/test/IdCompressor.tests.js.map +0 -1
- package/lib/test/IdConversion.tests.d.ts +0 -6
- package/lib/test/IdConversion.tests.d.ts.map +0 -1
- package/lib/test/IdConversion.tests.js +0 -36
- package/lib/test/IdConversion.tests.js.map +0 -1
- package/lib/test/LazyCheckout.tests.d.ts +0 -6
- package/lib/test/LazyCheckout.tests.d.ts.map +0 -1
- package/lib/test/LazyCheckout.tests.js +0 -22
- package/lib/test/LazyCheckout.tests.js.map +0 -1
- package/lib/test/LogViewer.tests.d.ts +0 -6
- package/lib/test/LogViewer.tests.d.ts.map +0 -1
- package/lib/test/LogViewer.tests.js +0 -588
- package/lib/test/LogViewer.tests.js.map +0 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts +0 -6
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +0 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +0 -351
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +0 -1
- package/lib/test/NumericUuid.perf.tests.d.ts +0 -6
- package/lib/test/NumericUuid.perf.tests.d.ts.map +0 -1
- package/lib/test/NumericUuid.perf.tests.js +0 -68
- package/lib/test/NumericUuid.perf.tests.js.map +0 -1
- package/lib/test/NumericUuid.tests.d.ts +0 -6
- package/lib/test/NumericUuid.tests.d.ts.map +0 -1
- package/lib/test/NumericUuid.tests.js +0 -192
- package/lib/test/NumericUuid.tests.js.map +0 -1
- package/lib/test/RevisionValueCache.tests.d.ts +0 -6
- package/lib/test/RevisionValueCache.tests.d.ts.map +0 -1
- package/lib/test/RevisionValueCache.tests.js +0 -106
- package/lib/test/RevisionValueCache.tests.js.map +0 -1
- package/lib/test/RevisionView.tests.d.ts +0 -6
- package/lib/test/RevisionView.tests.d.ts.map +0 -1
- package/lib/test/RevisionView.tests.js +0 -131
- package/lib/test/RevisionView.tests.js.map +0 -1
- package/lib/test/SessionIdNormalizer.tests.d.ts +0 -6
- package/lib/test/SessionIdNormalizer.tests.d.ts.map +0 -1
- package/lib/test/SessionIdNormalizer.tests.js +0 -377
- package/lib/test/SessionIdNormalizer.tests.js.map +0 -1
- package/lib/test/SharedTree.fuzz.tests.d.ts +0 -6
- package/lib/test/SharedTree.fuzz.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.fuzz.tests.js +0 -9
- package/lib/test/SharedTree.fuzz.tests.js.map +0 -1
- package/lib/test/SharedTree.perf.tests.d.ts +0 -6
- package/lib/test/SharedTree.perf.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.perf.tests.js +0 -39
- package/lib/test/SharedTree.perf.tests.js.map +0 -1
- package/lib/test/SharedTree.tests.d.ts +0 -6
- package/lib/test/SharedTree.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.tests.js +0 -22
- package/lib/test/SharedTree.tests.js.map +0 -1
- package/lib/test/StringInterner.tests.d.ts +0 -6
- package/lib/test/StringInterner.tests.d.ts.map +0 -1
- package/lib/test/StringInterner.tests.js +0 -73
- package/lib/test/StringInterner.tests.js.map +0 -1
- package/lib/test/Summary.tests.d.ts +0 -7
- package/lib/test/Summary.tests.d.ts.map +0 -1
- package/lib/test/Summary.tests.js +0 -386
- package/lib/test/Summary.tests.js.map +0 -1
- package/lib/test/Transaction.tests.d.ts +0 -6
- package/lib/test/Transaction.tests.d.ts.map +0 -1
- package/lib/test/Transaction.tests.js +0 -124
- package/lib/test/Transaction.tests.js.map +0 -1
- package/lib/test/TransactionInternal.tests.d.ts +0 -6
- package/lib/test/TransactionInternal.tests.d.ts.map +0 -1
- package/lib/test/TransactionInternal.tests.js +0 -576
- package/lib/test/TransactionInternal.tests.js.map +0 -1
- package/lib/test/TreeCompression.tests.d.ts +0 -6
- package/lib/test/TreeCompression.tests.d.ts.map +0 -1
- package/lib/test/TreeCompression.tests.js +0 -291
- package/lib/test/TreeCompression.tests.js.map +0 -1
- package/lib/test/TreeView.tests.d.ts +0 -6
- package/lib/test/TreeView.tests.d.ts.map +0 -1
- package/lib/test/TreeView.tests.js +0 -178
- package/lib/test/TreeView.tests.js.map +0 -1
- package/lib/test/UndoRedoHandler.tests.d.ts +0 -6
- package/lib/test/UndoRedoHandler.tests.d.ts.map +0 -1
- package/lib/test/UndoRedoHandler.tests.js +0 -37
- package/lib/test/UndoRedoHandler.tests.js.map +0 -1
- package/lib/test/fuzz/Generators.d.ts +0 -8
- package/lib/test/fuzz/Generators.d.ts.map +0 -1
- package/lib/test/fuzz/Generators.js +0 -345
- package/lib/test/fuzz/Generators.js.map +0 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +0 -23
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +0 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.js +0 -241
- package/lib/test/fuzz/SharedTreeFuzzTests.js.map +0 -1
- package/lib/test/fuzz/Types.d.ts +0 -136
- package/lib/test/fuzz/Types.d.ts.map +0 -1
- package/lib/test/fuzz/Types.js +0 -6
- package/lib/test/fuzz/Types.js.map +0 -1
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +0 -246
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +0 -1
- package/lib/test/utilities/IdCompressorTestUtilities.js +0 -608
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +0 -1
- package/lib/test/utilities/MockTransaction.d.ts +0 -35
- package/lib/test/utilities/MockTransaction.d.ts.map +0 -1
- package/lib/test/utilities/MockTransaction.js +0 -51
- package/lib/test/utilities/MockTransaction.js.map +0 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts +0 -12
- package/lib/test/utilities/PendingLocalStateTests.d.ts.map +0 -1
- package/lib/test/utilities/PendingLocalStateTests.js +0 -223
- package/lib/test/utilities/PendingLocalStateTests.js.map +0 -1
- package/lib/test/utilities/SharedTreeTests.d.ts +0 -12
- package/lib/test/utilities/SharedTreeTests.d.ts.map +0 -1
- package/lib/test/utilities/SharedTreeTests.js +0 -949
- package/lib/test/utilities/SharedTreeTests.js.map +0 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts +0 -11
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +0 -1
- package/lib/test/utilities/SharedTreeVersioningTests.js +0 -439
- package/lib/test/utilities/SharedTreeVersioningTests.js.map +0 -1
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts +0 -10
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +0 -1
- package/lib/test/utilities/SummaryLoadPerfTests.js +0 -105
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +0 -1
- package/lib/test/utilities/SummarySizeTests.d.ts +0 -11
- package/lib/test/utilities/SummarySizeTests.d.ts.map +0 -1
- package/lib/test/utilities/SummarySizeTests.js +0 -160
- package/lib/test/utilities/SummarySizeTests.js.map +0 -1
- package/lib/test/utilities/TestCommon.d.ts +0 -13
- package/lib/test/utilities/TestCommon.d.ts.map +0 -1
- package/lib/test/utilities/TestCommon.js +0 -19
- package/lib/test/utilities/TestCommon.js.map +0 -1
- package/lib/test/utilities/TestNode.d.ts +0 -140
- package/lib/test/utilities/TestNode.d.ts.map +0 -1
- package/lib/test/utilities/TestNode.js +0 -282
- package/lib/test/utilities/TestNode.js.map +0 -1
- package/lib/test/utilities/TestSerializer.d.ts +0 -24
- package/lib/test/utilities/TestSerializer.d.ts.map +0 -1
- package/lib/test/utilities/TestSerializer.js +0 -40
- package/lib/test/utilities/TestSerializer.js.map +0 -1
- package/lib/test/utilities/TestUtilities.d.ts +0 -212
- package/lib/test/utilities/TestUtilities.d.ts.map +0 -1
- package/lib/test/utilities/TestUtilities.js +0 -413
- package/lib/test/utilities/TestUtilities.js.map +0 -1
- package/lib/test/utilities/UndoRedoTests.d.ts +0 -32
- package/lib/test/utilities/UndoRedoTests.d.ts.map +0 -1
- package/lib/test/utilities/UndoRedoTests.js +0 -317
- package/lib/test/utilities/UndoRedoTests.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -1,608 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/* eslint-disable no-bitwise */
|
|
6
|
-
import { expect, assert } from 'chai';
|
|
7
|
-
import { createWeightedGenerator, interleave, makeRandom, performFuzzActions as performFuzzActionsBase, repeat, take, } from '@fluid-private/stochastic-test-utils';
|
|
8
|
-
import { assertNotUndefined, fail, getOrCreate } from '../../Common.js';
|
|
9
|
-
import { IdCompressor, isLocalId } from '../../id-compressor/IdCompressor.js';
|
|
10
|
-
import { createSessionId, ensureSessionUuid, numericUuidFromStableId, stableIdFromNumericUuid, } from '../../id-compressor/NumericUuid.js';
|
|
11
|
-
import { getIds } from '../../id-compressor/IdRange.js';
|
|
12
|
-
import { assertIsStableId, assertIsUuidString } from '../../UuidUtilities.js';
|
|
13
|
-
import { expectDefined } from './TestCommon.js';
|
|
14
|
-
/** Identifies a compressor in a network */
|
|
15
|
-
export var Client;
|
|
16
|
-
(function (Client) {
|
|
17
|
-
Client["Client1"] = "Client1";
|
|
18
|
-
Client["Client2"] = "Client2";
|
|
19
|
-
Client["Client3"] = "Client3";
|
|
20
|
-
})(Client || (Client = {}));
|
|
21
|
-
/** Identifies a compressor with respect to a specific operation */
|
|
22
|
-
export var SemanticClient;
|
|
23
|
-
(function (SemanticClient) {
|
|
24
|
-
SemanticClient["LocalClient"] = "LocalClient";
|
|
25
|
-
})(SemanticClient || (SemanticClient = {}));
|
|
26
|
-
/** Identifies categories of compressors */
|
|
27
|
-
export var MetaClient;
|
|
28
|
-
(function (MetaClient) {
|
|
29
|
-
MetaClient["All"] = "All";
|
|
30
|
-
})(MetaClient || (MetaClient = {}));
|
|
31
|
-
export const OriginatingClient = { ...Client, ...SemanticClient };
|
|
32
|
-
export const DestinationClient = { ...Client, ...MetaClient };
|
|
33
|
-
/**
|
|
34
|
-
* Creates a new compressor with the supplied cluster capacity.
|
|
35
|
-
*/
|
|
36
|
-
export function createCompressor(client, clusterCapacity = 5, attributionId, logger) {
|
|
37
|
-
const compressor = new IdCompressor(sessionIds.get(client), 1024, attributionId, logger);
|
|
38
|
-
compressor.clusterCapacity = clusterCapacity;
|
|
39
|
-
return compressor;
|
|
40
|
-
}
|
|
41
|
-
function makeSessionIds() {
|
|
42
|
-
const stableIds = new Map();
|
|
43
|
-
const clients = Object.values(Client);
|
|
44
|
-
for (let i = 0; i < clients.length; i++) {
|
|
45
|
-
// Place session uuids roughly in the middle of uuid space to increase odds of encountering interesting
|
|
46
|
-
// orderings in sorted collections
|
|
47
|
-
const sessionId = ensureSessionUuid(assertIsStableId(`88888888-8888-4888-b${i}88-888888888888`));
|
|
48
|
-
stableIds.set(clients[i], sessionId);
|
|
49
|
-
}
|
|
50
|
-
return stableIds;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* An array of session ID strings corresponding to all non-local `Client` entries.
|
|
54
|
-
*/
|
|
55
|
-
export const sessionIds = makeSessionIds();
|
|
56
|
-
/**
|
|
57
|
-
* An array of session uuids corresponding to all non-local `Client` entries.
|
|
58
|
-
*/
|
|
59
|
-
export const sessionNumericUuids = new Map([...sessionIds.entries()].map(([client, sessionId]) => {
|
|
60
|
-
return [client, numericUuidFromStableId(sessionId)];
|
|
61
|
-
}));
|
|
62
|
-
export const attributionIds = new Map(Object.values(Client).map((c, i) => [
|
|
63
|
-
c,
|
|
64
|
-
assertIsUuidString(`00000000-0000-0000-0000-${(i + 1).toString(16).padStart(12, '0')}`),
|
|
65
|
-
]));
|
|
66
|
-
/**
|
|
67
|
-
* Simulates a network of ID compressors.
|
|
68
|
-
* Not suitable for performance testing.
|
|
69
|
-
*/
|
|
70
|
-
export class IdCompressorTestNetwork {
|
|
71
|
-
constructor(initialClusterSize = 5, onIdReceived) {
|
|
72
|
-
this.initialClusterSize = initialClusterSize;
|
|
73
|
-
this.onIdReceived = onIdReceived;
|
|
74
|
-
/** The log of operations seen by the server so far. Append-only. */
|
|
75
|
-
this.serverOperations = [];
|
|
76
|
-
const compressors = new Map();
|
|
77
|
-
const clientProgress = new Map();
|
|
78
|
-
const clientIds = new Map();
|
|
79
|
-
const clientSequencedIds = new Map();
|
|
80
|
-
for (const client of Object.values(Client)) {
|
|
81
|
-
const compressor = createCompressor(client, initialClusterSize, attributionIds.get(client));
|
|
82
|
-
compressors.set(client, compressor);
|
|
83
|
-
clientProgress.set(client, 0);
|
|
84
|
-
clientIds.set(client, []);
|
|
85
|
-
clientSequencedIds.set(client, []);
|
|
86
|
-
}
|
|
87
|
-
this.compressors = compressors;
|
|
88
|
-
this.clientProgress = clientProgress;
|
|
89
|
-
this.idLogs = clientIds;
|
|
90
|
-
this.sequencedIdLogs = clientSequencedIds;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Returns the number of undelivered operations for the given client that are in flight in the network.
|
|
94
|
-
*/
|
|
95
|
-
getPendingOperations(destination) {
|
|
96
|
-
return this.serverOperations.length - this.clientProgress.get(destination);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Returns an immutable handle to a compressor in the network.
|
|
100
|
-
*/
|
|
101
|
-
getCompressor(client) {
|
|
102
|
-
const compressors = this.compressors;
|
|
103
|
-
const handler = {
|
|
104
|
-
get(_, property) {
|
|
105
|
-
const compressor = compressors.get(client);
|
|
106
|
-
return compressor[property];
|
|
107
|
-
},
|
|
108
|
-
set(_, property, value) {
|
|
109
|
-
const compressor = compressors.get(client);
|
|
110
|
-
compressor[property] = value;
|
|
111
|
-
return true;
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
return new Proxy({}, handler);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Returns a mutable handle to a compressor in the network. Use of mutation methods will break the network invariants and
|
|
118
|
-
* should only be used if the network will not be used again.
|
|
119
|
-
*/
|
|
120
|
-
getCompressorUnsafe(client) {
|
|
121
|
-
return this.getCompressor(client);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Returns a mutable handle to a compressor in the network. Use of mutation methods will break the network invariants and
|
|
125
|
-
* should only be used if the network will not be used again. Additionally, the returned compressor will be invalidated/unusable
|
|
126
|
-
* if any network operations cause it to be regenerated (serialization/deserialization, etc.).
|
|
127
|
-
*/
|
|
128
|
-
getCompressorUnsafeNoProxy(client) {
|
|
129
|
-
return this.compressors.get(client);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* 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)
|
|
133
|
-
*/
|
|
134
|
-
getIdLog(client) {
|
|
135
|
-
return this.idLogs.get(client);
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Returns data for all IDs received by this client, including ack's of their own.
|
|
139
|
-
*/
|
|
140
|
-
getSequencedIdLog(client) {
|
|
141
|
-
return this.sequencedIdLogs.get(client);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get all compressors for the given destination
|
|
145
|
-
*/
|
|
146
|
-
getTargetCompressors(clientTo) {
|
|
147
|
-
return clientTo === MetaClient.All
|
|
148
|
-
? [...this.compressors.entries()]
|
|
149
|
-
: [[clientTo, this.getCompressor(clientTo)]];
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Submit a capacity change operation to the network. It will not take effect immediately but will be processed in sequence order.
|
|
153
|
-
*/
|
|
154
|
-
enqueueCapacityChange(newClusterCapacity) {
|
|
155
|
-
this.serverOperations.push(newClusterCapacity);
|
|
156
|
-
}
|
|
157
|
-
addNewId(client, id, expectedOverride, originatingClient, isSequenced) {
|
|
158
|
-
const idData = {
|
|
159
|
-
id,
|
|
160
|
-
originatingClient,
|
|
161
|
-
sessionId: sessionIds.get(originatingClient),
|
|
162
|
-
sessionNumericUuid: sessionNumericUuids.get(originatingClient),
|
|
163
|
-
expectedOverride,
|
|
164
|
-
isSequenced,
|
|
165
|
-
};
|
|
166
|
-
const clientIds = this.idLogs.get(client);
|
|
167
|
-
clientIds.push(idData);
|
|
168
|
-
if (isSequenced) {
|
|
169
|
-
const sequencedIds = this.sequencedIdLogs.get(client);
|
|
170
|
-
sequencedIds.push(idData);
|
|
171
|
-
}
|
|
172
|
-
this.onIdReceived?.(this, client, clientIds);
|
|
173
|
-
}
|
|
174
|
-
allocateAndSendIds(client, numIds, overrides = {}) {
|
|
175
|
-
// Must allocate a non-zero number of IDs
|
|
176
|
-
assert(numIds > 0);
|
|
177
|
-
const compressor = this.compressors.get(client);
|
|
178
|
-
let nextIdIndex = 0;
|
|
179
|
-
const opSpaceIds = [];
|
|
180
|
-
for (const [overrideIndex, uuid] of Object.entries(overrides)
|
|
181
|
-
.map(([id, uuid]) => [Number.parseInt(id, 10), uuid])
|
|
182
|
-
.sort(([a], [b]) => a - b)) {
|
|
183
|
-
while (nextIdIndex < overrideIndex) {
|
|
184
|
-
const newId = compressor.generateCompressedId();
|
|
185
|
-
opSpaceIds.push(compressor.normalizeToOpSpace(newId));
|
|
186
|
-
this.addNewId(client, newId, undefined, client, false);
|
|
187
|
-
nextIdIndex += 1;
|
|
188
|
-
}
|
|
189
|
-
const newOverrideId = compressor.generateCompressedId(uuid);
|
|
190
|
-
opSpaceIds.push(compressor.normalizeToOpSpace(newOverrideId));
|
|
191
|
-
this.addNewId(client, newOverrideId, uuid, client, false);
|
|
192
|
-
nextIdIndex += 1;
|
|
193
|
-
}
|
|
194
|
-
const numTrailingIds = numIds - nextIdIndex;
|
|
195
|
-
if (numTrailingIds > 0) {
|
|
196
|
-
const sessionSpaceIds = generateCompressedIds(compressor, numTrailingIds);
|
|
197
|
-
for (let i = 0; i < numTrailingIds; i++) {
|
|
198
|
-
this.addNewId(client, sessionSpaceIds[i], undefined, client, false);
|
|
199
|
-
}
|
|
200
|
-
sessionSpaceIds.forEach((id) => opSpaceIds.push(compressor.normalizeToOpSpace(id)));
|
|
201
|
-
}
|
|
202
|
-
const creationRange = compressor.takeNextCreationRange();
|
|
203
|
-
this.serverOperations.push([creationRange, opSpaceIds, client]);
|
|
204
|
-
return nextIdIndex === 0 ? opSpaceIds : creationRange;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Delivers all undelivered ID ranges and cluster capacity changes from the server to the target clients.
|
|
208
|
-
*/
|
|
209
|
-
deliverOperations(clientTakingDelivery, opsToDeliver) {
|
|
210
|
-
let opIndexBound;
|
|
211
|
-
if (clientTakingDelivery === DestinationClient.All) {
|
|
212
|
-
assert(opsToDeliver === undefined);
|
|
213
|
-
opIndexBound = this.serverOperations.length;
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
opIndexBound =
|
|
217
|
-
opsToDeliver !== undefined
|
|
218
|
-
? this.clientProgress.get(clientTakingDelivery) + opsToDeliver
|
|
219
|
-
: this.serverOperations.length;
|
|
220
|
-
}
|
|
221
|
-
for (const [clientTo, compressorTo] of this.getTargetCompressors(clientTakingDelivery)) {
|
|
222
|
-
for (let i = this.clientProgress.get(clientTo); i < opIndexBound; i++) {
|
|
223
|
-
const operation = this.serverOperations[i];
|
|
224
|
-
if (typeof operation === 'number') {
|
|
225
|
-
compressorTo.clusterCapacity = operation;
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
const [range, opSpaceIds, clientFrom] = operation;
|
|
229
|
-
compressorTo.finalizeCreationRange(range);
|
|
230
|
-
const ids = getIds(range);
|
|
231
|
-
if (ids !== undefined) {
|
|
232
|
-
let overrideIndex = 0;
|
|
233
|
-
const overrides = ids.overrides;
|
|
234
|
-
for (const id of opSpaceIds) {
|
|
235
|
-
let override;
|
|
236
|
-
if (overrides !== undefined &&
|
|
237
|
-
overrideIndex < overrides.length &&
|
|
238
|
-
id === overrides[overrideIndex][0]) {
|
|
239
|
-
override = overrides[overrideIndex][1];
|
|
240
|
-
overrideIndex++;
|
|
241
|
-
}
|
|
242
|
-
const sessionSpaceId = compressorTo.normalizeToSessionSpace(id, range.sessionId);
|
|
243
|
-
this.addNewId(clientTo, sessionSpaceId, override, clientFrom, true);
|
|
244
|
-
}
|
|
245
|
-
assert(overrideIndex === (overrides?.length ?? 0));
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
this.clientProgress.set(clientTo, opIndexBound);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Simulate a client disconnecting (and serializing), then reconnecting (and deserializing)
|
|
254
|
-
*/
|
|
255
|
-
goOfflineThenResume(client) {
|
|
256
|
-
const compressor = this.compressors.get(client);
|
|
257
|
-
const [_, resumedCompressor] = roundtrip(compressor, true);
|
|
258
|
-
this.compressors.set(client, resumedCompressor);
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Ensure general validity of the network state. Useful for calling periodically or at the end of test scenarios.
|
|
262
|
-
*/
|
|
263
|
-
assertNetworkState() {
|
|
264
|
-
const sequencedLogs = Object.values(Client).map((client) => [this.compressors.get(client), this.getSequencedIdLog(client)]);
|
|
265
|
-
// First, ensure all clients each generated a unique ID for each of their own calls to generate.
|
|
266
|
-
for (const [compressor, ids] of sequencedLogs) {
|
|
267
|
-
const uuids = new Set();
|
|
268
|
-
for (const idData of ids) {
|
|
269
|
-
const uuid = compressor.decompress(idData.id);
|
|
270
|
-
expect(!uuids.has(uuid), 'Duplicate UUID generated.');
|
|
271
|
-
uuids.add(uuid);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
const maxLogLength = sequencedLogs.map(([_, data]) => data.length).reduce((p, n) => Math.max(p, n));
|
|
275
|
-
function getNextLogWithEntryAt(logsIndex, entryIndex) {
|
|
276
|
-
for (let i = logsIndex; i < sequencedLogs.length; i++) {
|
|
277
|
-
const log = sequencedLogs[i];
|
|
278
|
-
if (log[1].length > entryIndex) {
|
|
279
|
-
return i;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return undefined;
|
|
283
|
-
}
|
|
284
|
-
const uuids = new Set();
|
|
285
|
-
const finalIds = new Set();
|
|
286
|
-
const idIndicesAggregator = new Map();
|
|
287
|
-
function* getLogIndices(columnIndex) {
|
|
288
|
-
let current = getNextLogWithEntryAt(0, columnIndex);
|
|
289
|
-
while (current !== undefined) {
|
|
290
|
-
const next = getNextLogWithEntryAt(current + 1, columnIndex);
|
|
291
|
-
const [compressor, log] = sequencedLogs[current];
|
|
292
|
-
if (next === undefined) {
|
|
293
|
-
yield [[compressor, log[columnIndex]]];
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
const [compressorNext, logNext] = sequencedLogs[next];
|
|
297
|
-
yield [
|
|
298
|
-
[compressor, log[columnIndex]],
|
|
299
|
-
[compressorNext, logNext[columnIndex]],
|
|
300
|
-
];
|
|
301
|
-
}
|
|
302
|
-
current = next;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
for (let i = 0; i < maxLogLength; i++) {
|
|
306
|
-
const creator = [];
|
|
307
|
-
let originatingClient;
|
|
308
|
-
let localCount = 0;
|
|
309
|
-
let rowCount = 0;
|
|
310
|
-
for (const [current, next] of getLogIndices(i)) {
|
|
311
|
-
const [compressorA, idDataA] = current;
|
|
312
|
-
const sessionSpaceIdA = idDataA.id;
|
|
313
|
-
const idIndex = getOrCreate(idIndicesAggregator, idDataA.originatingClient, () => 0);
|
|
314
|
-
originatingClient ?? (originatingClient = idDataA.originatingClient);
|
|
315
|
-
// Test infra gave wrong originating client to TestIdData
|
|
316
|
-
assert(idDataA.originatingClient === originatingClient);
|
|
317
|
-
const attributionA = compressorA.attributeId(idDataA.id);
|
|
318
|
-
if (attributionA !== attributionIds.get(idDataA.originatingClient)) {
|
|
319
|
-
// Unification
|
|
320
|
-
expectDefined(idDataA.expectedOverride);
|
|
321
|
-
}
|
|
322
|
-
// Only one client should have this ID as local in its session space, as only one client could have created this ID
|
|
323
|
-
if (isLocalId(sessionSpaceIdA)) {
|
|
324
|
-
localCount++;
|
|
325
|
-
expect(idDataA.sessionId).to.equal(this.compressors.get(originatingClient).localSessionId);
|
|
326
|
-
expect(creator.length === 0 || creator[creator.length - 1][1] === idDataA.expectedOverride).to.be
|
|
327
|
-
.true;
|
|
328
|
-
creator.push([originatingClient, idDataA.expectedOverride]);
|
|
329
|
-
}
|
|
330
|
-
const uuidASessionSpace = compressorA.decompress(sessionSpaceIdA);
|
|
331
|
-
if (idDataA.expectedOverride !== undefined) {
|
|
332
|
-
expect(uuidASessionSpace).to.equal(idDataA.expectedOverride);
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
expect(uuidASessionSpace).to.equal(stableIdFromNumericUuid(idDataA.sessionNumericUuid, idIndex));
|
|
336
|
-
}
|
|
337
|
-
expect(compressorA.recompress(uuidASessionSpace)).to.equal(sessionSpaceIdA);
|
|
338
|
-
uuids.add(uuidASessionSpace);
|
|
339
|
-
const opSpaceIdA = compressorA.normalizeToOpSpace(sessionSpaceIdA);
|
|
340
|
-
if (isLocalId(opSpaceIdA)) {
|
|
341
|
-
expect.fail('IDs should have been finalized.');
|
|
342
|
-
fail();
|
|
343
|
-
}
|
|
344
|
-
expect(compressorA.normalizeToSessionSpace(opSpaceIdA, compressorA.localSessionId)).equals(sessionSpaceIdA);
|
|
345
|
-
finalIds.add(opSpaceIdA);
|
|
346
|
-
const uuidAOpSpace = compressorA.decompress(opSpaceIdA);
|
|
347
|
-
expect(uuidASessionSpace).to.equal(uuidAOpSpace);
|
|
348
|
-
if (next !== undefined) {
|
|
349
|
-
const [compressorB, idDataB] = next;
|
|
350
|
-
const sessionSpaceIdB = idDataB.id;
|
|
351
|
-
const uuidBSessionSpace = compressorB.decompress(sessionSpaceIdB);
|
|
352
|
-
expect(uuidASessionSpace).to.equal(uuidBSessionSpace);
|
|
353
|
-
const opSpaceIdB = compressorB.normalizeToOpSpace(sessionSpaceIdB);
|
|
354
|
-
if (opSpaceIdA !== opSpaceIdB) {
|
|
355
|
-
compressorB.normalizeToOpSpace(sessionSpaceIdB);
|
|
356
|
-
compressorA.normalizeToOpSpace(sessionSpaceIdA);
|
|
357
|
-
}
|
|
358
|
-
expect(opSpaceIdA).to.equal(opSpaceIdB);
|
|
359
|
-
if (isLocalId(opSpaceIdB)) {
|
|
360
|
-
fail('IDs should have been finalized.');
|
|
361
|
-
}
|
|
362
|
-
const uuidBOpSpace = compressorB.decompress(opSpaceIdB);
|
|
363
|
-
expect(uuidAOpSpace).to.equal(uuidBOpSpace);
|
|
364
|
-
}
|
|
365
|
-
rowCount += 1;
|
|
366
|
-
}
|
|
367
|
-
// A local count === 0 indicates the ID was created as an eager final, and thus cannot have had an
|
|
368
|
-
// override to unify.
|
|
369
|
-
if (rowCount === this.sequencedIdLogs.size && localCount <= 1) {
|
|
370
|
-
expect(localCount).to.lessThanOrEqual(1);
|
|
371
|
-
for (const [[compressor, { id, originatingClient }]] of getLogIndices(i)) {
|
|
372
|
-
expect(compressor.attributeId(id)).to.equal(attributionIds.get(originatingClient));
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
expect(uuids.size).to.equal(finalIds.size);
|
|
376
|
-
assert(originatingClient !== undefined);
|
|
377
|
-
idIndicesAggregator.set(originatingClient, assertNotUndefined(idIndicesAggregator.get(originatingClient)) + 1);
|
|
378
|
-
}
|
|
379
|
-
for (const [compressor] of sequencedLogs) {
|
|
380
|
-
expectSerializes(compressor);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
export function roundtrip(compressor, withSession) {
|
|
385
|
-
if (withSession) {
|
|
386
|
-
const serialized = compressor.serialize(withSession);
|
|
387
|
-
return [serialized, IdCompressor.deserialize(serialized)];
|
|
388
|
-
}
|
|
389
|
-
const nonLocalSerialized = compressor.serialize(withSession);
|
|
390
|
-
return [nonLocalSerialized, IdCompressor.deserialize(nonLocalSerialized, createSessionId())];
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Asserts that the supplied compressor correctly roundtrips through serialization/deserialization.
|
|
394
|
-
*/
|
|
395
|
-
export function expectSerializes(compressor) {
|
|
396
|
-
function expectSerializes(withSession) {
|
|
397
|
-
let serialized;
|
|
398
|
-
let deserialized;
|
|
399
|
-
if (withSession) {
|
|
400
|
-
[serialized, deserialized] = roundtrip(compressor, true);
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
[serialized, deserialized] = roundtrip(compressor, false);
|
|
404
|
-
}
|
|
405
|
-
const chainCount = [];
|
|
406
|
-
for (let i = 0; i < serialized.sessions.length; i++) {
|
|
407
|
-
chainCount[i] = 0;
|
|
408
|
-
}
|
|
409
|
-
const chainProcessed = [...chainCount];
|
|
410
|
-
for (const cluster of serialized.clusters) {
|
|
411
|
-
const [sessionIndex] = cluster;
|
|
412
|
-
expect(sessionIndex < serialized.sessions.length).to.be.true;
|
|
413
|
-
chainCount[sessionIndex]++;
|
|
414
|
-
}
|
|
415
|
-
for (const cluster of serialized.clusters) {
|
|
416
|
-
const [sessionIndex, capacity, maybeSize] = cluster;
|
|
417
|
-
const chainIndex = chainProcessed[sessionIndex];
|
|
418
|
-
if (chainIndex < chainCount[sessionIndex] - 1) {
|
|
419
|
-
expect(typeof maybeSize !== 'number').to.be.true;
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
expect(maybeSize === undefined || typeof maybeSize !== 'number' || maybeSize < capacity).to.be.true;
|
|
423
|
-
}
|
|
424
|
-
chainProcessed[sessionIndex]++;
|
|
425
|
-
}
|
|
426
|
-
expect(compressor.equals(deserialized, withSession)).to.be.true;
|
|
427
|
-
return serialized;
|
|
428
|
-
}
|
|
429
|
-
return [
|
|
430
|
-
expectSerializes(false),
|
|
431
|
-
expectSerializes(true),
|
|
432
|
-
];
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Merges 'from' into 'to', and returns 'to'.
|
|
436
|
-
*/
|
|
437
|
-
export function mergeArrayMaps(to, from) {
|
|
438
|
-
for (const [key, value] of from.entries()) {
|
|
439
|
-
const entry = to.get(key);
|
|
440
|
-
if (entry !== undefined) {
|
|
441
|
-
entry.push(...value);
|
|
442
|
-
}
|
|
443
|
-
else {
|
|
444
|
-
to.set(key, [...value]);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
return to;
|
|
448
|
-
}
|
|
449
|
-
const defaultOptions = {
|
|
450
|
-
includeOverrides: false,
|
|
451
|
-
maxClusterSize: 25,
|
|
452
|
-
validateInterval: 200,
|
|
453
|
-
};
|
|
454
|
-
export function makeOpGenerator(options) {
|
|
455
|
-
const { includeOverrides, maxClusterSize, validateInterval } = { ...defaultOptions, ...options };
|
|
456
|
-
function allocateIdsGenerator({ activeClients, clusterSize, random }) {
|
|
457
|
-
const client = random.pick(activeClients);
|
|
458
|
-
const maxIdsPerUsage = clusterSize * 2;
|
|
459
|
-
const numIds = Math.floor(random.real(0, 1) ** 3 * maxIdsPerUsage) + 1;
|
|
460
|
-
const overrides = {};
|
|
461
|
-
if (includeOverrides && random.bool(1 / 4)) {
|
|
462
|
-
for (let j = 0; j < numIds; j++) {
|
|
463
|
-
if (random.bool(1 / 3)) {
|
|
464
|
-
overrides[j] = random.uuid4();
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
return {
|
|
469
|
-
type: 'allocateIds',
|
|
470
|
-
client,
|
|
471
|
-
numIds,
|
|
472
|
-
overrides,
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
function changeCapacityGenerator({ random }) {
|
|
476
|
-
return {
|
|
477
|
-
type: 'changeCapacity',
|
|
478
|
-
newSize: Math.min(Math.floor(random.real(0, 1) ** 2 * maxClusterSize) + 1, maxClusterSize),
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
function deliverAllOperationsGenerator() {
|
|
482
|
-
return {
|
|
483
|
-
type: 'deliverAllOperations',
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
function deliverSomeOperationsGenerator({ random, selectableClients, network, }) {
|
|
487
|
-
const pendingClients = selectableClients.filter((c) => network.getPendingOperations(c) > 0);
|
|
488
|
-
if (pendingClients.length === 0) {
|
|
489
|
-
return {
|
|
490
|
-
type: 'deliverSomeOperations',
|
|
491
|
-
client: random.pick(selectableClients),
|
|
492
|
-
count: 0,
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
const client = random.pick(pendingClients);
|
|
496
|
-
return {
|
|
497
|
-
type: 'deliverSomeOperations',
|
|
498
|
-
client,
|
|
499
|
-
count: random.integer(1, network.getPendingOperations(client)),
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
function generateUnifyingIdsGenerator({ activeClients, random }) {
|
|
503
|
-
const clientA = random.pick(activeClients);
|
|
504
|
-
const clientB = random.pick(activeClients.filter((c) => c !== clientA));
|
|
505
|
-
return { type: 'generateUnifyingIds', clientA, clientB, uuid: random.uuid4() };
|
|
506
|
-
}
|
|
507
|
-
function reconnectGenerator({ activeClients, random }) {
|
|
508
|
-
return { type: 'reconnect', client: random.pick(activeClients) };
|
|
509
|
-
}
|
|
510
|
-
return interleave(createWeightedGenerator([
|
|
511
|
-
[changeCapacityGenerator, 1],
|
|
512
|
-
[allocateIdsGenerator, 16],
|
|
513
|
-
[deliverAllOperationsGenerator, 2],
|
|
514
|
-
[deliverSomeOperationsGenerator, 6],
|
|
515
|
-
[generateUnifyingIdsGenerator, 2],
|
|
516
|
-
[reconnectGenerator, 1],
|
|
517
|
-
]), take(1, repeat({ type: 'validate' })), validateInterval);
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* Performs random actions on a test network.
|
|
521
|
-
* @param generator - the generator used to provide operations
|
|
522
|
-
* @param network - the test network to test
|
|
523
|
-
* @param seed - the seed for the random generation of the fuzz actions
|
|
524
|
-
* @param observerClient - if provided, this client will never generate local ids
|
|
525
|
-
* @param synchronizeAtEnd - if provided, all client will have all operations delivered from the server at the end of the test
|
|
526
|
-
* @param validator - if provided, this callback will be invoked periodically during the fuzz test.
|
|
527
|
-
*/
|
|
528
|
-
export function performFuzzActions(generator, network, seed, observerClient, synchronizeAtEnd = true, validator, saveInfo) {
|
|
529
|
-
const random = makeRandom(seed);
|
|
530
|
-
const selectableClients = network.getTargetCompressors(MetaClient.All).map(([client]) => client);
|
|
531
|
-
const initialState = {
|
|
532
|
-
random,
|
|
533
|
-
network,
|
|
534
|
-
activeClients: selectableClients.filter((c) => c !== observerClient),
|
|
535
|
-
selectableClients,
|
|
536
|
-
clusterSize: network.initialClusterSize,
|
|
537
|
-
};
|
|
538
|
-
performFuzzActionsBase(generator, {
|
|
539
|
-
allocateIds: (state, { client, numIds, overrides }) => {
|
|
540
|
-
network.allocateAndSendIds(client, numIds, overrides);
|
|
541
|
-
return state;
|
|
542
|
-
},
|
|
543
|
-
changeCapacity: (state, op) => {
|
|
544
|
-
network.enqueueCapacityChange(op.newSize);
|
|
545
|
-
return { ...state, clusterSize: op.newSize };
|
|
546
|
-
},
|
|
547
|
-
deliverSomeOperations: (state, op) => {
|
|
548
|
-
network.deliverOperations(op.client, op.count);
|
|
549
|
-
return state;
|
|
550
|
-
},
|
|
551
|
-
deliverAllOperations: (state) => {
|
|
552
|
-
network.deliverOperations(DestinationClient.All);
|
|
553
|
-
return state;
|
|
554
|
-
},
|
|
555
|
-
generateUnifyingIds: (state, { clientA, clientB, uuid }) => {
|
|
556
|
-
network.allocateAndSendIds(clientA, 1, { 0: uuid });
|
|
557
|
-
network.allocateAndSendIds(clientB, 1, { 0: uuid });
|
|
558
|
-
return state;
|
|
559
|
-
},
|
|
560
|
-
reconnect: (state, { client }) => {
|
|
561
|
-
network.goOfflineThenResume(client);
|
|
562
|
-
return state;
|
|
563
|
-
},
|
|
564
|
-
validate: (state) => {
|
|
565
|
-
network.deliverOperations(DestinationClient.All);
|
|
566
|
-
validator?.(network);
|
|
567
|
-
return state;
|
|
568
|
-
},
|
|
569
|
-
}, initialState, saveInfo);
|
|
570
|
-
if (synchronizeAtEnd) {
|
|
571
|
-
network.deliverOperations(DestinationClient.All);
|
|
572
|
-
validator?.(network);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Converts the supplied integer to a uuid.
|
|
577
|
-
*/
|
|
578
|
-
export function integerToStableId(num) {
|
|
579
|
-
const bigintNum = BigInt(num);
|
|
580
|
-
const upper = bigintNum >> BigInt(74);
|
|
581
|
-
const middle = (bigintNum & (BigInt(0xfff) << BigInt(62))) >> BigInt(62);
|
|
582
|
-
const lower = bigintNum & BigInt('0x3fffffffffffffff');
|
|
583
|
-
const upperString = padToLength(upper.toString(16), '0', 12);
|
|
584
|
-
const middleString = `4${padToLength(middle.toString(16), '0', 3)}`;
|
|
585
|
-
const lowerString = padToLength((BigInt('0x8000000000000000') | BigInt(lower)).toString(16), '0', 16);
|
|
586
|
-
const uuid = upperString + middleString + lowerString;
|
|
587
|
-
return assertIsStableId(`${uuid.substr(0, 8)}-${uuid.substr(8, 4)}-${uuid.substr(12, 4)}-${uuid.substr(16, 4)}-${uuid.substr(20)}`);
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Pads the strings to a length of 32 with zeroes.
|
|
591
|
-
*/
|
|
592
|
-
export function padToUuidLength(str) {
|
|
593
|
-
return padToLength(str, '0', 32);
|
|
594
|
-
}
|
|
595
|
-
function padToLength(str, char, length) {
|
|
596
|
-
return char.repeat(length - str.length) + str;
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* Helper to generate a fixed number of IDs.
|
|
600
|
-
*/
|
|
601
|
-
export function generateCompressedIds(compressor, count) {
|
|
602
|
-
const ids = [];
|
|
603
|
-
for (let i = 0; i < count; i++) {
|
|
604
|
-
ids.push(compressor.generateCompressedId());
|
|
605
|
-
}
|
|
606
|
-
return ids;
|
|
607
|
-
}
|
|
608
|
-
//# sourceMappingURL=IdCompressorTestUtilities.js.map
|