@fluid-experimental/tree 0.59.2001 → 0.59.3000
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/.eslintrc.js +2 -0
- package/.vscode/SharedTree.code-workspace +15 -0
- package/.vscode/settings.json +6 -0
- package/dist/ChangeCompression.js +9 -9
- package/dist/ChangeCompression.js.map +1 -1
- package/dist/ChangeTypes.d.ts +1 -6
- package/dist/ChangeTypes.d.ts.map +1 -1
- package/dist/ChangeTypes.js +5 -5
- package/dist/ChangeTypes.js.map +1 -1
- package/dist/Checkout.js +14 -14
- package/dist/Checkout.js.map +1 -1
- package/dist/Common.d.ts +21 -3
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js +29 -4
- package/dist/Common.js.map +1 -1
- package/dist/EditLog.js +26 -25
- package/dist/EditLog.js.map +1 -1
- package/dist/EditUtilities.js +17 -17
- package/dist/EditUtilities.js.map +1 -1
- package/dist/Forest.js +31 -31
- package/dist/Forest.js.map +1 -1
- package/dist/HistoryEditFactory.js +9 -9
- package/dist/HistoryEditFactory.js.map +1 -1
- package/dist/IdConversion.js +9 -9
- package/dist/IdConversion.js.map +1 -1
- package/dist/Identifiers.d.ts +4 -0
- package/dist/Identifiers.d.ts.map +1 -1
- package/dist/Identifiers.js.map +1 -1
- package/dist/LogViewer.d.ts +1 -5
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +11 -19
- package/dist/LogViewer.js.map +1 -1
- package/dist/MergeHealth.js +2 -2
- package/dist/MergeHealth.js.map +1 -1
- package/dist/NodeIdUtilities.js +2 -2
- package/dist/NodeIdUtilities.js.map +1 -1
- package/dist/PayloadUtilities.js +1 -1
- package/dist/PayloadUtilities.js.map +1 -1
- package/dist/RevisionValueCache.d.ts +13 -10
- package/dist/RevisionValueCache.d.ts.map +1 -1
- package/dist/RevisionValueCache.js +14 -11
- package/dist/RevisionValueCache.js.map +1 -1
- package/dist/RevisionView.js +4 -4
- package/dist/RevisionView.js.map +1 -1
- package/dist/SerializationUtilities.js +4 -4
- package/dist/SerializationUtilities.js.map +1 -1
- package/dist/SharedTree.d.ts +93 -31
- package/dist/SharedTree.d.ts.map +1 -1
- package/dist/SharedTree.js +160 -131
- package/dist/SharedTree.js.map +1 -1
- package/dist/SharedTreeEncoder.d.ts +3 -3
- package/dist/SharedTreeEncoder.d.ts.map +1 -1
- package/dist/SharedTreeEncoder.js +36 -36
- package/dist/SharedTreeEncoder.js.map +1 -1
- package/dist/StringInterner.js +1 -1
- package/dist/StringInterner.js.map +1 -1
- package/dist/Summary.js +1 -1
- package/dist/Summary.js.map +1 -1
- package/dist/SummaryBackCompatibility.js +8 -8
- package/dist/SummaryBackCompatibility.js.map +1 -1
- package/dist/Transaction.js +1 -1
- package/dist/Transaction.js.map +1 -1
- package/dist/TransactionInternal.js +17 -17
- package/dist/TransactionInternal.js.map +1 -1
- package/dist/TreeCompressor.d.ts.map +1 -1
- package/dist/TreeCompressor.js +6 -8
- package/dist/TreeCompressor.js.map +1 -1
- package/dist/TreeNodeHandle.js +4 -4
- package/dist/TreeNodeHandle.js.map +1 -1
- package/dist/TreeView.js +7 -7
- package/dist/TreeView.js.map +1 -1
- package/dist/TreeViewUtilities.js +2 -2
- package/dist/TreeViewUtilities.js.map +1 -1
- package/dist/UndoRedoHandler.js +1 -1
- package/dist/UndoRedoHandler.js.map +1 -1
- package/dist/UuidUtilities.d.ts +30 -0
- package/dist/UuidUtilities.d.ts.map +1 -0
- package/dist/UuidUtilities.js +106 -0
- package/dist/UuidUtilities.js.map +1 -0
- package/dist/id-compressor/AppendOnlySortedMap.d.ts +52 -28
- package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
- package/dist/id-compressor/AppendOnlySortedMap.js +167 -90
- package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/IdCompressor.d.ts +43 -42
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
- package/dist/id-compressor/IdCompressor.js +179 -177
- package/dist/id-compressor/IdCompressor.js.map +1 -1
- package/dist/id-compressor/IdRange.js +1 -1
- package/dist/id-compressor/IdRange.js.map +1 -1
- package/dist/id-compressor/NumericUuid.d.ts +6 -14
- package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
- package/dist/id-compressor/NumericUuid.js +15 -76
- package/dist/id-compressor/NumericUuid.js.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.d.ts +122 -0
- package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -0
- package/dist/id-compressor/SessionIdNormalizer.js +418 -0
- package/dist/id-compressor/SessionIdNormalizer.js.map +1 -0
- package/dist/id-compressor/persisted-types/0.0.1.d.ts +6 -13
- package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
- package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/persisted-types/0.1.1.d.ts +1 -6
- 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/ChangeTypes.d.ts +1 -6
- package/lib/ChangeTypes.d.ts.map +1 -1
- package/lib/Checkout.js.map +1 -1
- package/lib/Common.d.ts +21 -3
- package/lib/Common.d.ts.map +1 -1
- package/lib/Common.js +25 -3
- package/lib/Common.js.map +1 -1
- package/lib/EditLog.js +2 -1
- package/lib/EditLog.js.map +1 -1
- package/lib/EditUtilities.js.map +1 -1
- package/lib/Forest.js.map +1 -1
- package/lib/HistoryEditFactory.js.map +1 -1
- package/lib/Identifiers.d.ts +4 -0
- package/lib/Identifiers.d.ts.map +1 -1
- package/lib/Identifiers.js.map +1 -1
- package/lib/LogViewer.d.ts +1 -5
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +5 -13
- package/lib/LogViewer.js.map +1 -1
- package/lib/MergeHealth.js.map +1 -1
- package/lib/NodeIdUtilities.js.map +1 -1
- package/lib/RevisionValueCache.d.ts +13 -10
- package/lib/RevisionValueCache.d.ts.map +1 -1
- package/lib/RevisionValueCache.js +10 -7
- package/lib/RevisionValueCache.js.map +1 -1
- package/lib/RevisionView.js.map +1 -1
- package/lib/SharedTree.d.ts +93 -31
- package/lib/SharedTree.d.ts.map +1 -1
- package/lib/SharedTree.js +107 -78
- package/lib/SharedTree.js.map +1 -1
- package/lib/SharedTreeEncoder.d.ts +3 -3
- package/lib/SharedTreeEncoder.d.ts.map +1 -1
- package/lib/SharedTreeEncoder.js +4 -4
- package/lib/SharedTreeEncoder.js.map +1 -1
- package/lib/StringInterner.js.map +1 -1
- package/lib/Summary.js.map +1 -1
- package/lib/TreeCompressor.d.ts.map +1 -1
- package/lib/TreeCompressor.js +1 -3
- package/lib/TreeCompressor.js.map +1 -1
- package/lib/TreeNodeHandle.js.map +1 -1
- package/lib/TreeView.js.map +1 -1
- package/lib/TreeViewUtilities.js.map +1 -1
- package/lib/UuidUtilities.d.ts +30 -0
- package/lib/UuidUtilities.d.ts.map +1 -0
- package/lib/UuidUtilities.js +98 -0
- package/lib/UuidUtilities.js.map +1 -0
- package/lib/id-compressor/AppendOnlySortedMap.d.ts +52 -28
- package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js +165 -88
- package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/IdCompressor.d.ts +43 -42
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
- package/lib/id-compressor/IdCompressor.js +97 -95
- package/lib/id-compressor/IdCompressor.js.map +1 -1
- package/lib/id-compressor/NumericUuid.d.ts +6 -14
- package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
- package/lib/id-compressor/NumericUuid.js +11 -70
- package/lib/id-compressor/NumericUuid.js.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.d.ts +122 -0
- package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -0
- package/lib/id-compressor/SessionIdNormalizer.js +414 -0
- package/lib/id-compressor/SessionIdNormalizer.js.map +1 -0
- package/lib/id-compressor/persisted-types/0.0.1.d.ts +6 -13
- package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/persisted-types/0.1.1.d.ts +1 -6
- package/lib/persisted-types/0.1.1.d.ts.map +1 -1
- package/lib/persisted-types/0.1.1.js.map +1 -1
- package/lib/test/AppendOnlySortedMap.perf.tests.d.ts +6 -0
- package/lib/test/AppendOnlySortedMap.perf.tests.d.ts.map +1 -0
- package/lib/test/AppendOnlySortedMap.perf.tests.js +49 -0
- package/lib/test/AppendOnlySortedMap.perf.tests.js.map +1 -0
- package/lib/test/AppendOnlySortedMap.tests.js +56 -14
- package/lib/test/AppendOnlySortedMap.tests.js.map +1 -1
- package/lib/test/Checkout.tests.js +2 -2
- package/lib/test/Checkout.tests.js.map +1 -1
- package/lib/test/Forest.tests.js.map +1 -1
- package/lib/test/IdCompressor.perf.tests.js +8 -2
- package/lib/test/IdCompressor.perf.tests.js.map +1 -1
- package/lib/test/IdCompressor.tests.js +75 -24
- package/lib/test/IdCompressor.tests.js.map +1 -1
- package/lib/test/LogViewer.tests.js +3 -5
- package/lib/test/LogViewer.tests.js.map +1 -1
- package/lib/test/NumericUuid.perf.tests.js +4 -4
- package/lib/test/NumericUuid.perf.tests.js.map +1 -1
- package/lib/test/NumericUuid.tests.js +5 -4
- package/lib/test/NumericUuid.tests.js.map +1 -1
- package/lib/test/RevisionValueCache.tests.js.map +1 -1
- package/lib/test/RevisionView.tests.js.map +1 -1
- package/lib/test/SessionIdNormalizer.tests.d.ts +6 -0
- package/lib/test/SessionIdNormalizer.tests.d.ts.map +1 -0
- package/lib/test/SessionIdNormalizer.tests.js +299 -0
- package/lib/test/SessionIdNormalizer.tests.js.map +1 -0
- package/lib/test/Summary.tests.js +1 -1
- package/lib/test/Summary.tests.js.map +1 -1
- package/lib/test/TreeCompression.tests.js +1 -1
- package/lib/test/TreeCompression.tests.js.map +1 -1
- package/lib/test/Virtualization.tests.js +1 -1
- package/lib/test/Virtualization.tests.js.map +1 -1
- package/lib/test/fuzz/Generators.d.ts +3 -14
- package/lib/test/fuzz/Generators.d.ts.map +1 -1
- package/lib/test/fuzz/Generators.js +60 -151
- package/lib/test/fuzz/Generators.js.map +1 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +10 -7
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.js +94 -104
- package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -1
- package/lib/test/fuzz/Types.d.ts +2 -9
- package/lib/test/fuzz/Types.d.ts.map +1 -1
- package/lib/test/fuzz/Types.js +1 -1
- package/lib/test/fuzz/Types.js.map +1 -1
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +57 -11
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -1
- package/lib/test/utilities/IdCompressorTestUtilities.js +112 -98
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -1
- package/lib/test/utilities/PendingLocalStateTests.js +2 -1
- package/lib/test/utilities/PendingLocalStateTests.js.map +1 -1
- package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
- package/lib/test/utilities/SharedTreeTests.js +30 -1
- package/lib/test/utilities/SharedTreeTests.js.map +1 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -1
- package/lib/test/utilities/SharedTreeVersioningTests.js +20 -0
- package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -1
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +1 -1
- package/lib/test/utilities/SummaryLoadPerfTests.js +6 -3
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -1
- package/lib/test/utilities/TestNode.js.map +1 -1
- package/lib/test/utilities/TestUtilities.d.ts +9 -1
- package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
- package/lib/test/utilities/TestUtilities.js +27 -13
- package/lib/test/utilities/TestUtilities.js.map +1 -1
- package/package.json +19 -17
- package/src/Common.ts +42 -4
- package/src/EditLog.ts +1 -1
- package/src/Identifiers.ts +5 -0
- package/src/LogViewer.ts +4 -20
- package/src/RevisionValueCache.ts +11 -8
- package/src/SharedTree.ts +222 -75
- package/src/SharedTreeEncoder.ts +17 -11
- package/src/TreeCompressor.ts +2 -4
- package/src/UuidUtilities.ts +123 -0
- package/src/id-compressor/AppendOnlySortedMap.ts +183 -94
- package/src/id-compressor/IdCompressor.ts +144 -132
- package/src/id-compressor/NumericUuid.ts +11 -80
- package/src/id-compressor/SessionIdNormalizer.ts +497 -0
- package/src/id-compressor/persisted-types/0.0.1.ts +12 -15
- package/src/index.ts +5 -0
package/lib/SharedTree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SharedTree.d.ts","sourceRoot":"","sources":["../src/SharedTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAEN,gBAAgB,EAChB,mBAAmB,EAEnB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAA6D,cAAc,EAAE,MAAM,WAAW,CAAC;AACtG,OAAO,
|
|
1
|
+
{"version":3,"file":"SharedTree.d.ts","sourceRoot":"","sources":["../src/SharedTree.ts"],"names":[],"mappings":"AA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CAAC,GAAG,SAAS,cAAc,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC;IAa/G;;;;OAIG;IACI,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc;IAmExD,OAAO,CAAC,gBAAgB;IAgBxB;;;;;OAKG;IACI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAYjD;;;;;;OAMG;IACI,aAAa,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,cAAc,EAAE,GAAG,SAAS;IAIhH;;OAEG;IACH,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,aAAa;IAIrB,oEAAoE;IACpE,OAAO,CAAC,QAAQ;IAQT,UAAU,IAAI,sBAAsB;IAI3C;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI;IA6C3C,OAAO,CAAC,iBAAiB;IAKzB;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;CAuB7B"}
|
package/lib/SharedTree.js
CHANGED
|
@@ -6,9 +6,9 @@ import { bufferToString, IsoBuffer } from '@fluidframework/common-utils';
|
|
|
6
6
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
7
7
|
import { createSingleBlobSummary, serializeHandles, SharedObject, } from '@fluidframework/shared-object-base';
|
|
8
8
|
import { ChildLogger, PerformanceEvent } from '@fluidframework/telemetry-utils';
|
|
9
|
-
import { assert, assertNotUndefined, fail, copyPropertyIfDefined } from './Common';
|
|
9
|
+
import { assert, assertNotUndefined, fail, copyPropertyIfDefined, noop } from './Common';
|
|
10
10
|
import { EditLog, getNumberOfHandlesFromEditLogSummary } from './EditLog';
|
|
11
|
-
import { isDetachedSequenceId } from './Identifiers';
|
|
11
|
+
import { isDetachedSequenceId, } from './Identifiers';
|
|
12
12
|
import { initialTree } from './InitialTree';
|
|
13
13
|
import { CachingLogViewer, } from './LogViewer';
|
|
14
14
|
import { deserialize, getSummaryStatistics } from './SummaryBackCompatibility';
|
|
@@ -24,25 +24,15 @@ import { ChangeType } from './ChangeTypes';
|
|
|
24
24
|
import { IdCompressor, createSessionId } from './id-compressor';
|
|
25
25
|
import { convertEditIds } from './IdConversion';
|
|
26
26
|
import { MutableStringInterner } from './StringInterner';
|
|
27
|
+
import { nilUuid } from './UuidUtilities';
|
|
27
28
|
/**
|
|
28
29
|
* Factory for SharedTree.
|
|
29
30
|
* Includes history in the summary.
|
|
30
31
|
* @public
|
|
31
32
|
*/
|
|
32
33
|
export class SharedTreeFactory {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* @param writeFormat - Determines the format version the SharedTree will write ops and summaries in. See [the write format
|
|
36
|
-
* documentation](../docs/Write-Format.md) for more information.
|
|
37
|
-
* @param summarizeHistory - Determines if the history is included in summaries and if edit chunks are uploaded when they are full.
|
|
38
|
-
* See the [breaking change migration documentation](docs/Breaking-Change-Migration) for more details on this scheme.
|
|
39
|
-
* @param expensiveValidation - Enables expensive asserts on SharedTree.
|
|
40
|
-
* @returns A factory that creates `SharedTree`s and loads them from storage.
|
|
41
|
-
*/
|
|
42
|
-
constructor(writeFormat, summarizeHistory = false, expensiveValidation = false) {
|
|
43
|
-
this.writeFormat = writeFormat;
|
|
44
|
-
this.summarizeHistory = summarizeHistory;
|
|
45
|
-
this.expensiveValidation = expensiveValidation;
|
|
34
|
+
constructor(...args) {
|
|
35
|
+
this.args = args;
|
|
46
36
|
}
|
|
47
37
|
/**
|
|
48
38
|
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory."type"}
|
|
@@ -69,15 +59,21 @@ export class SharedTreeFactory {
|
|
|
69
59
|
* @param runtime - data store runtime that owns the new SharedTree
|
|
70
60
|
* @param id - optional name for the SharedTree
|
|
71
61
|
*/
|
|
72
|
-
create(runtime, id
|
|
73
|
-
this.expensiveValidation = expensiveValidation;
|
|
62
|
+
create(runtime, id) {
|
|
74
63
|
const sharedTree = this.createSharedTree(runtime, id);
|
|
75
64
|
sharedTree.initializeLocal();
|
|
76
65
|
return sharedTree;
|
|
77
66
|
}
|
|
78
67
|
createSharedTree(runtime, id) {
|
|
79
|
-
const
|
|
80
|
-
|
|
68
|
+
const [writeFormat] = this.args;
|
|
69
|
+
switch (writeFormat) {
|
|
70
|
+
case WriteFormat.v0_0_2:
|
|
71
|
+
return new SharedTree(runtime, id, ...this.args);
|
|
72
|
+
case WriteFormat.v0_1_1:
|
|
73
|
+
return new SharedTree(runtime, id, ...this.args);
|
|
74
|
+
default:
|
|
75
|
+
fail('Unknown write format');
|
|
76
|
+
}
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
79
|
/**
|
|
@@ -106,20 +102,9 @@ const sharedTreeTelemetryProperties = { all: { isSharedTreeEvent: true } };
|
|
|
106
102
|
* @public
|
|
107
103
|
*/
|
|
108
104
|
export class SharedTree extends SharedObject {
|
|
109
|
-
|
|
110
|
-
* Create a new SharedTreeFactory.
|
|
111
|
-
* @param runtime - The runtime the SharedTree will be associated with
|
|
112
|
-
* @param id - Unique ID for the SharedTree
|
|
113
|
-
* @param writeFormat - Determines the format version the SharedTree will write ops and summaries in. See [the write format
|
|
114
|
-
* documentation](../docs/Write-Format.md) for more information.
|
|
115
|
-
* @param summarizeHistory - Determines if the history is included in summaries and if edit chunks are uploaded when they are full.
|
|
116
|
-
* @param expensiveValidation - Enable expensive asserts.
|
|
117
|
-
*/
|
|
118
|
-
constructor(runtime, id, writeFormat, summarizeHistory = false, expensiveValidation = false) {
|
|
105
|
+
constructor(runtime, id, writeFormat, options = {}) {
|
|
119
106
|
super(id, runtime, SharedTreeFactory.Attributes);
|
|
120
107
|
this.writeFormat = writeFormat;
|
|
121
|
-
this.expensiveValidation = expensiveValidation;
|
|
122
|
-
this.idCompressor = new IdCompressor(createSessionId(), reservedIdCount);
|
|
123
108
|
this.idNormalizer = {
|
|
124
109
|
tree: this,
|
|
125
110
|
get localSessionId() {
|
|
@@ -162,8 +147,9 @@ export class SharedTree extends SharedObject {
|
|
|
162
147
|
}
|
|
163
148
|
}
|
|
164
149
|
};
|
|
165
|
-
|
|
166
|
-
this.
|
|
150
|
+
const historyPolicy = this.getHistoryPolicy(options);
|
|
151
|
+
this.summarizeHistory = historyPolicy.summarizeHistory;
|
|
152
|
+
this.uploadEditChunks = historyPolicy.uploadEditChunks;
|
|
167
153
|
// This code is somewhat duplicated from OldestClientObserver because it currently depends on the container runtime
|
|
168
154
|
// which SharedTree does not have access to.
|
|
169
155
|
// TODO:#55900: Get rid of copy-pasted OldestClientObserver code
|
|
@@ -175,11 +161,12 @@ export class SharedTree extends SharedObject {
|
|
|
175
161
|
runtime.on('disconnected', this.updateOldest);
|
|
176
162
|
this.logger = ChildLogger.create(runtime.logger, 'SharedTree', sharedTreeTelemetryProperties);
|
|
177
163
|
this.sequencedEditAppliedLogger = ChildLogger.create(this.logger, 'SequencedEditApplied', sharedTreeTelemetryProperties);
|
|
164
|
+
const attributionId = options.attributionId;
|
|
165
|
+
this.idCompressor = new IdCompressor(createSessionId(), reservedIdCount, attributionId);
|
|
178
166
|
const { editLog, cachingLogViewer } = this.initializeNewEditLogFromSummary({
|
|
179
167
|
editChunks: [],
|
|
180
168
|
editIds: [],
|
|
181
|
-
}, undefined, this.idCompressor,
|
|
182
|
-
this.processEditResult, this.processSequencedEditResult, WriteFormat.v0_1_1);
|
|
169
|
+
}, undefined, this.idCompressor, this.processEditResult, this.processSequencedEditResult, WriteFormat.v0_1_1);
|
|
183
170
|
this.editLog = editLog;
|
|
184
171
|
this.cachingLogViewer = cachingLogViewer;
|
|
185
172
|
this.encoder_0_0_2 = new SharedTreeEncoder_0_0_2(this.summarizeHistory);
|
|
@@ -191,31 +178,39 @@ export class SharedTree extends SharedObject {
|
|
|
191
178
|
static create(runtime, id) {
|
|
192
179
|
return runtime.createChannel(id, SharedTreeFactory.Type);
|
|
193
180
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
* @param summarizeHistory - Determines if the history is included in summaries and if edit chunks are uploaded when they are full.
|
|
197
|
-
*
|
|
198
|
-
* On 0.1.1 documents, due to current code limitations, this parameter is only impactful for newly created documents.
|
|
199
|
-
* `SharedTree`s which load existing documents will summarize history if and only if the loaded summary included history.
|
|
200
|
-
*
|
|
201
|
-
* The technical limitations here relate to clients with mixed versions collaborating.
|
|
202
|
-
* In the future we may allow modification of whether or not a particular document saves history, but only via a consensus mechanism.
|
|
203
|
-
* See the skipped test in SharedTreeFuzzTests.ts for more details on this issue.
|
|
204
|
-
* See docs/Breaking-Change-Migration for more details on the consensus scheme.
|
|
205
|
-
* @param writeFormat - Determines the format version the SharedTree will write ops and summaries in.
|
|
206
|
-
* This format may be updated to a newer (supported) version at runtime if a collaborating shared-tree
|
|
207
|
-
* that was initialized with a newer write version connects to the session. Care must be taken when changing this value,
|
|
208
|
-
* as a staged rollout must of occurred such that all collaborating clients must have the code to read at least the version
|
|
209
|
-
* written.
|
|
210
|
-
* See [the write format documentation](../docs/Write-Format.md) for more information.
|
|
211
|
-
* @returns A factory that creates `SharedTree`s and loads them from storage.
|
|
212
|
-
*/
|
|
213
|
-
static getFactory(writeFormat, summarizeHistory = false) {
|
|
181
|
+
static getFactory(...args) {
|
|
182
|
+
const [writeFormat] = args;
|
|
214
183
|
// On 0.1.1 documents, due to current code limitations, all clients MUST agree on the value of `summarizeHistory`.
|
|
215
184
|
// Note that this means staged rollout changing this value should not be attempted.
|
|
216
185
|
// It is possible to update shared-tree to correctly handle such a staged rollout, but that hasn't been implemented.
|
|
217
186
|
// See the skipped test in SharedTreeFuzzTests.ts for more details on this issue.
|
|
218
|
-
|
|
187
|
+
switch (writeFormat) {
|
|
188
|
+
case WriteFormat.v0_0_2:
|
|
189
|
+
return new SharedTreeFactory(...args);
|
|
190
|
+
case WriteFormat.v0_1_1:
|
|
191
|
+
return new SharedTreeFactory(...args);
|
|
192
|
+
default:
|
|
193
|
+
fail('Unknown write format');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The UUID used for attribution of nodes created by this SharedTree. All shared trees with a write format of 0.1.1 or
|
|
198
|
+
* greater have a unique attribution ID which may be configured in the constructor. All other shared trees (i.e. those
|
|
199
|
+
* with a write format of 0.0.2) use the nil UUID as their attribution ID.
|
|
200
|
+
* @public
|
|
201
|
+
*/
|
|
202
|
+
get attributionId() {
|
|
203
|
+
switch (this.writeFormat) {
|
|
204
|
+
case WriteFormat.v0_0_2:
|
|
205
|
+
return nilUuid;
|
|
206
|
+
default: {
|
|
207
|
+
const { attributionId } = this.idCompressor;
|
|
208
|
+
if (attributionId === ghostSessionId) {
|
|
209
|
+
return nilUuid;
|
|
210
|
+
}
|
|
211
|
+
return attributionId;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
219
214
|
}
|
|
220
215
|
/**
|
|
221
216
|
* Viewer for trees defined by editLog. This allows access to views of the tree at different revisions (various points in time).
|
|
@@ -223,6 +218,27 @@ export class SharedTree extends SharedObject {
|
|
|
223
218
|
get logViewer() {
|
|
224
219
|
return this.cachingLogViewer;
|
|
225
220
|
}
|
|
221
|
+
getHistoryPolicy(options) {
|
|
222
|
+
var _a;
|
|
223
|
+
const noCompatOptions = options;
|
|
224
|
+
if (typeof noCompatOptions.summarizeHistory === 'object') {
|
|
225
|
+
return {
|
|
226
|
+
summarizeHistory: true,
|
|
227
|
+
uploadEditChunks: noCompatOptions.summarizeHistory.uploadEditChunks,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
return {
|
|
232
|
+
summarizeHistory: (_a = noCompatOptions.summarizeHistory) !== null && _a !== void 0 ? _a : false,
|
|
233
|
+
uploadEditChunks: false,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* The write format version currently used by this `SharedTree`. This is always initialized to the write format
|
|
239
|
+
* passed to the tree's constructor, but it may automatically upgrade over time (e.g. when connected to another
|
|
240
|
+
* SharedTree with a higher write format, or when loading a summary with a higher write format).
|
|
241
|
+
*/
|
|
226
242
|
getWriteFormat() {
|
|
227
243
|
return this.writeFormat;
|
|
228
244
|
}
|
|
@@ -319,6 +335,25 @@ export class SharedTree extends SharedObject {
|
|
|
319
335
|
tryConvertToNodeId(id) {
|
|
320
336
|
return this.idCompressor.tryRecompress(id);
|
|
321
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Returns the attribution ID associated with the SharedTree that generated the given node ID. This is generally only useful for clients
|
|
340
|
+
* with a write format of 0.1.1 or greater since older clients cannot be given an attribution ID and will always use the default
|
|
341
|
+
* `attributionId` of the tree.
|
|
342
|
+
* @public
|
|
343
|
+
*/
|
|
344
|
+
attributeNodeId(id) {
|
|
345
|
+
switch (this.writeFormat) {
|
|
346
|
+
case WriteFormat.v0_0_2:
|
|
347
|
+
return nilUuid;
|
|
348
|
+
default: {
|
|
349
|
+
const attributionId = this.idCompressor.attributeId(id);
|
|
350
|
+
if (attributionId === ghostSessionId) {
|
|
351
|
+
return nilUuid;
|
|
352
|
+
}
|
|
353
|
+
return attributionId;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
322
357
|
/**
|
|
323
358
|
* @returns the edit history of the tree.
|
|
324
359
|
* @public
|
|
@@ -332,9 +367,14 @@ export class SharedTree extends SharedObject {
|
|
|
332
367
|
return deserializeHandle;
|
|
333
368
|
}
|
|
334
369
|
/**
|
|
335
|
-
* Uploads the edit chunk and
|
|
370
|
+
* Uploads the edit chunk and submits a `SharedTreeHandleOp`.
|
|
371
|
+
* This method is fire-and-forget and will swallow any errors that occur during upload or the `onUploadComplete` hook.
|
|
372
|
+
* If the upload or op submission does fail then a future client will attempt the submission instead.
|
|
336
373
|
*/
|
|
337
|
-
|
|
374
|
+
uploadEditChunk(edits, startRevision, onUploadComplete) {
|
|
375
|
+
this.uploadEditChunkAsync(edits, startRevision).then(onUploadComplete).catch(noop);
|
|
376
|
+
}
|
|
377
|
+
async uploadEditChunkAsync(edits, startRevision) {
|
|
338
378
|
var _a;
|
|
339
379
|
assert(this.writeFormat !== WriteFormat.v0_0_2, 'Edit chunking is not supported in v0_0_2');
|
|
340
380
|
// SPO attachment blob upload limit is set here:
|
|
@@ -460,7 +500,7 @@ export class SharedTree extends SharedObject {
|
|
|
460
500
|
let convertedSummary;
|
|
461
501
|
switch (loadedSummaryVersion) {
|
|
462
502
|
case WriteFormat.v0_0_2:
|
|
463
|
-
convertedSummary = this.encoder_0_0_2.decodeSummary(summary);
|
|
503
|
+
convertedSummary = this.encoder_0_0_2.decodeSummary(summary, this.attributionId);
|
|
464
504
|
break;
|
|
465
505
|
case WriteFormat.v0_1_1: {
|
|
466
506
|
const typedSummary = summary;
|
|
@@ -471,7 +511,7 @@ export class SharedTree extends SharedObject {
|
|
|
471
511
|
this.uploadEditChunks = loadedSummaryIncludesHistory;
|
|
472
512
|
this.encoder_0_1_1 = new SharedTreeEncoder_0_1_1(this.summarizeHistory);
|
|
473
513
|
}
|
|
474
|
-
convertedSummary = this.encoder_0_1_1.decodeSummary(summary);
|
|
514
|
+
convertedSummary = this.encoder_0_1_1.decodeSummary(summary, this.attributionId);
|
|
475
515
|
break;
|
|
476
516
|
}
|
|
477
517
|
default:
|
|
@@ -552,7 +592,7 @@ export class SharedTree extends SharedObject {
|
|
|
552
592
|
// TODO:#47830: Store multiple checkpoints in summary.
|
|
553
593
|
knownRevisions = [[editLog.length, { view: currentView }]];
|
|
554
594
|
}
|
|
555
|
-
const logViewer = new CachingLogViewer(editLog, RevisionView.fromTree(initialTree, this), knownRevisions,
|
|
595
|
+
const logViewer = new CachingLogViewer(editLog, RevisionView.fromTree(initialTree, this), knownRevisions, editStatusCallback, sequencedEditResultCallback, 0);
|
|
556
596
|
this.editLog = editLog;
|
|
557
597
|
this.cachingLogViewer = logViewer;
|
|
558
598
|
return { editLog, cachingLogViewer: logViewer };
|
|
@@ -563,14 +603,10 @@ export class SharedTree extends SharedObject {
|
|
|
563
603
|
uploadCatchUpBlobs() {
|
|
564
604
|
if (this.writeFormat !== WriteFormat.v0_0_2 && this.uploadEditChunks) {
|
|
565
605
|
for (const [startRevision, chunk] of this.editLog.getEditChunksReadyForUpload()) {
|
|
566
|
-
this.uploadEditChunk(chunk, startRevision)
|
|
567
|
-
.then(() => {
|
|
606
|
+
this.uploadEditChunk(chunk, startRevision, () => {
|
|
568
607
|
this.emit(SharedTreeDiagnosticEvent.CatchUpBlobUploaded);
|
|
569
608
|
this.logger.sendTelemetryEvent({ eventName: 'CatchUpBlobUpload', chunkSize: chunk.length });
|
|
570
|
-
})
|
|
571
|
-
// It is safe to swallow errors from edit chunk upload because the next summary load will
|
|
572
|
-
// do another attempt to upload the edit chunks that couldn't previously be uploaded
|
|
573
|
-
.catch((error) => { });
|
|
609
|
+
});
|
|
574
610
|
}
|
|
575
611
|
}
|
|
576
612
|
}
|
|
@@ -638,10 +674,8 @@ export class SharedTree extends SharedObject {
|
|
|
638
674
|
}
|
|
639
675
|
else if (type === SharedTreeOpType.Edit) {
|
|
640
676
|
if (op.version === WriteFormat.v0_1_1) {
|
|
641
|
-
// TODO: This cast can be removed on typescript 4.6
|
|
642
677
|
this.idCompressor.finalizeCreationRange(op.idRange);
|
|
643
678
|
}
|
|
644
|
-
// TODO: This cast can be removed on typescript 4.6
|
|
645
679
|
const edit = this.parseSequencedEdit(op);
|
|
646
680
|
if (op.version === WriteFormat.v0_1_1) {
|
|
647
681
|
this.internStringsFromEdit(edit);
|
|
@@ -717,16 +751,12 @@ export class SharedTree extends SharedObject {
|
|
|
717
751
|
const [startRevision, chunk] = lastPair;
|
|
718
752
|
const edits = assertNotUndefined(chunk.edits);
|
|
719
753
|
if (edits.length === this.editLog.editsPerChunk) {
|
|
720
|
-
this.uploadEditChunk(edits, startRevision)
|
|
721
|
-
.then(() => {
|
|
754
|
+
this.uploadEditChunk(edits, startRevision, () => {
|
|
722
755
|
this.logger.sendTelemetryEvent({
|
|
723
756
|
eventName: 'EditChunkUpload',
|
|
724
757
|
chunkSize: edits.length,
|
|
725
758
|
});
|
|
726
|
-
})
|
|
727
|
-
// It is safe to swallow errors from edit chunk upload because the next summary load will
|
|
728
|
-
// do another attempt to upload the edit chunks that couldn't previously be uploaded
|
|
729
|
-
.catch((error) => { });
|
|
759
|
+
});
|
|
730
760
|
}
|
|
731
761
|
}
|
|
732
762
|
}
|
|
@@ -769,7 +799,7 @@ export class SharedTree extends SharedObject {
|
|
|
769
799
|
this.interner = new MutableStringInterner([initialTree.definition]);
|
|
770
800
|
const oldIdCompressor = this.idCompressor;
|
|
771
801
|
// Create the IdCompressor that will be used after the upgrade
|
|
772
|
-
const newIdCompressor = new IdCompressor(createSessionId(), reservedIdCount);
|
|
802
|
+
const newIdCompressor = new IdCompressor(createSessionId(), reservedIdCount, this.attributionId);
|
|
773
803
|
const newContext = getNodeIdContext(newIdCompressor);
|
|
774
804
|
// Generate all local IDs in the new compressor that were in the old compressor and preserve their UUIDs.
|
|
775
805
|
// This will allow the client to continue to use local IDs that were allocated pre-upgrade
|
|
@@ -783,7 +813,7 @@ export class SharedTree extends SharedObject {
|
|
|
783
813
|
}
|
|
784
814
|
};
|
|
785
815
|
// Construct a temporary "ghost" compressor which is used to generate final IDs that will be consistent across all upgrading clients
|
|
786
|
-
const ghostIdCompressor = new IdCompressor(ghostSessionId, reservedIdCount);
|
|
816
|
+
const ghostIdCompressor = new IdCompressor(ghostSessionId, reservedIdCount);
|
|
787
817
|
const ghostContext = getNodeIdContext(ghostIdCompressor);
|
|
788
818
|
if (this.summarizeHistory) {
|
|
789
819
|
// All clients have the full history, and can therefore all "generate" the same final IDs for every ID in the history
|
|
@@ -927,7 +957,6 @@ export class SharedTree extends SharedObject {
|
|
|
927
957
|
applyEditLocally(edit, message) {
|
|
928
958
|
const isSequenced = message !== undefined;
|
|
929
959
|
if (isSequenced) {
|
|
930
|
-
// TODO: This cast can be removed on typescript 4.6
|
|
931
960
|
this.editLog.addSequencedEdit(edit, message);
|
|
932
961
|
}
|
|
933
962
|
else {
|