@fluidframework/merge-tree 2.30.0 → 2.31.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 +403 -399
- package/api-report/merge-tree.legacy.alpha.api.md +1 -0
- package/dist/MergeTreeTextHelper.d.ts +9 -3
- package/dist/MergeTreeTextHelper.d.ts.map +1 -1
- package/dist/MergeTreeTextHelper.js +5 -5
- package/dist/MergeTreeTextHelper.js.map +1 -1
- package/dist/client.d.ts +7 -13
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +136 -110
- package/dist/client.js.map +1 -1
- package/dist/endOfTreeSegment.d.ts +12 -8
- package/dist/endOfTreeSegment.d.ts.map +1 -1
- package/dist/endOfTreeSegment.js +2 -4
- package/dist/endOfTreeSegment.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/mergeTree.d.ts +37 -23
- package/dist/mergeTree.d.ts.map +1 -1
- package/dist/mergeTree.js +400 -483
- package/dist/mergeTree.js.map +1 -1
- package/dist/mergeTreeDeltaCallback.d.ts +4 -8
- package/dist/mergeTreeDeltaCallback.d.ts.map +1 -1
- package/dist/mergeTreeDeltaCallback.js.map +1 -1
- package/dist/mergeTreeNodes.d.ts +32 -10
- package/dist/mergeTreeNodes.d.ts.map +1 -1
- package/dist/mergeTreeNodes.js +43 -28
- package/dist/mergeTreeNodes.js.map +1 -1
- package/dist/partialLengths.d.ts +2 -2
- package/dist/partialLengths.d.ts.map +1 -1
- package/dist/partialLengths.js +181 -109
- package/dist/partialLengths.js.map +1 -1
- package/dist/perspective.d.ts +8 -27
- package/dist/perspective.d.ts.map +1 -1
- package/dist/perspective.js +7 -67
- package/dist/perspective.js.map +1 -1
- package/dist/revertibles.d.ts.map +1 -1
- package/dist/revertibles.js +2 -2
- package/dist/revertibles.js.map +1 -1
- package/dist/segmentInfos.d.ts +20 -106
- package/dist/segmentInfos.d.ts.map +1 -1
- package/dist/segmentInfos.js +28 -42
- package/dist/segmentInfos.js.map +1 -1
- package/dist/segmentPropertiesManager.d.ts +1 -14
- package/dist/segmentPropertiesManager.d.ts.map +1 -1
- package/dist/segmentPropertiesManager.js +3 -17
- package/dist/segmentPropertiesManager.js.map +1 -1
- package/dist/snapshotLoader.d.ts.map +1 -1
- package/dist/snapshotLoader.js +62 -19
- package/dist/snapshotLoader.js.map +1 -1
- package/dist/snapshotV1.d.ts.map +1 -1
- package/dist/snapshotV1.js +55 -24
- package/dist/snapshotV1.js.map +1 -1
- package/dist/snapshotlegacy.d.ts.map +1 -1
- package/dist/snapshotlegacy.js +6 -9
- package/dist/snapshotlegacy.js.map +1 -1
- package/dist/stamps.d.ts +1 -1
- package/dist/stamps.js +1 -1
- package/dist/stamps.js.map +1 -1
- package/dist/test/Insertion.perf.spec.js +6 -51
- package/dist/test/Insertion.perf.spec.js.map +1 -1
- package/dist/test/PartialLengths.perf.spec.js +18 -25
- package/dist/test/PartialLengths.perf.spec.js.map +1 -1
- package/dist/test/Removal.perf.spec.js +13 -41
- package/dist/test/Removal.perf.spec.js.map +1 -1
- package/dist/test/beastTest.spec.d.ts.map +1 -1
- package/dist/test/beastTest.spec.js +41 -66
- package/dist/test/beastTest.spec.js.map +1 -1
- package/dist/test/client.annotateMarker.spec.js +1 -11
- package/dist/test/client.annotateMarker.spec.js.map +1 -1
- package/dist/test/client.applyMsg.spec.js +14 -14
- package/dist/test/client.applyMsg.spec.js.map +1 -1
- package/dist/test/client.getPosition.spec.js +1 -1
- package/dist/test/client.getPosition.spec.js.map +1 -1
- package/dist/test/client.localReference.spec.js +1 -1
- package/dist/test/client.localReference.spec.js.map +1 -1
- package/dist/test/client.rollback.spec.js +49 -58
- package/dist/test/client.rollback.spec.js.map +1 -1
- package/dist/test/client.rollbackFarm.spec.js +1 -1
- package/dist/test/client.rollbackFarm.spec.js.map +1 -1
- package/dist/test/client.searchForMarker.spec.js +4 -21
- package/dist/test/client.searchForMarker.spec.js.map +1 -1
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +2 -6
- package/dist/test/index.js.map +1 -1
- package/dist/test/mergeTree.annotate.deltaCallback.spec.js +14 -59
- package/dist/test/mergeTree.annotate.deltaCallback.spec.js.map +1 -1
- package/dist/test/mergeTree.annotate.spec.js +47 -63
- package/dist/test/mergeTree.annotate.spec.js.map +1 -1
- package/dist/test/mergeTree.insert.deltaCallback.spec.js +9 -62
- package/dist/test/mergeTree.insert.deltaCallback.spec.js.map +1 -1
- package/dist/test/mergeTree.insertingWalk.spec.js +59 -125
- package/dist/test/mergeTree.insertingWalk.spec.js.map +1 -1
- package/dist/test/mergeTree.markRangeRemoved.deltaCallback.spec.js +12 -93
- package/dist/test/mergeTree.markRangeRemoved.deltaCallback.spec.js.map +1 -1
- package/dist/test/mergeTree.markRangeRemoved.spec.js +10 -7
- package/dist/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
- package/dist/test/mergeTree.walk.spec.js +2 -14
- package/dist/test/mergeTree.walk.spec.js.map +1 -1
- package/dist/test/mergeTreeOperationRunner.js +2 -2
- package/dist/test/mergeTreeOperationRunner.js.map +1 -1
- package/dist/test/obliterate.concurrent.spec.js +18 -23
- package/dist/test/obliterate.concurrent.spec.js.map +1 -1
- package/dist/test/obliterate.partialLength.spec.js +166 -136
- package/dist/test/obliterate.partialLength.spec.js.map +1 -1
- package/dist/test/obliterate.spec.js +16 -126
- package/dist/test/obliterate.spec.js.map +1 -1
- package/dist/test/partialLength.spec.js +28 -196
- package/dist/test/partialLength.spec.js.map +1 -1
- package/dist/test/perspective.spec.js +34 -0
- package/dist/test/perspective.spec.js.map +1 -1
- package/dist/test/propertyManager.spec.js +1 -1
- package/dist/test/propertyManager.spec.js.map +1 -1
- package/dist/test/resetPendingSegmentsToOp.spec.js +0 -2
- package/dist/test/resetPendingSegmentsToOp.spec.js.map +1 -1
- package/dist/test/segmentGroupCollection.spec.js +10 -4
- package/dist/test/segmentGroupCollection.spec.js.map +1 -1
- package/dist/test/testClient.d.ts +1 -0
- package/dist/test/testClient.d.ts.map +1 -1
- package/dist/test/testClient.js +16 -26
- package/dist/test/testClient.js.map +1 -1
- package/dist/test/testClientLogger.d.ts.map +1 -1
- package/dist/test/testClientLogger.js +3 -10
- package/dist/test/testClientLogger.js.map +1 -1
- package/dist/test/testServer.d.ts +2 -1
- package/dist/test/testServer.d.ts.map +1 -1
- package/dist/test/testServer.js +7 -5
- package/dist/test/testServer.js.map +1 -1
- package/dist/test/testUtils.d.ts +36 -56
- package/dist/test/testUtils.d.ts.map +1 -1
- package/dist/test/testUtils.js +68 -77
- package/dist/test/testUtils.js.map +1 -1
- package/dist/test/text.d.ts +2 -2
- package/dist/test/text.d.ts.map +1 -1
- package/dist/test/text.js +5 -2
- package/dist/test/text.js.map +1 -1
- package/dist/textSegment.d.ts +0 -6
- package/dist/textSegment.d.ts.map +1 -1
- package/dist/textSegment.js.map +1 -1
- package/dist/zamboni.d.ts.map +1 -1
- package/dist/zamboni.js +53 -26
- package/dist/zamboni.js.map +1 -1
- package/lib/MergeTreeTextHelper.d.ts +9 -3
- package/lib/MergeTreeTextHelper.d.ts.map +1 -1
- package/lib/MergeTreeTextHelper.js +5 -5
- package/lib/MergeTreeTextHelper.js.map +1 -1
- package/lib/client.d.ts +7 -13
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +117 -116
- package/lib/client.js.map +1 -1
- package/lib/endOfTreeSegment.d.ts +12 -8
- package/lib/endOfTreeSegment.d.ts.map +1 -1
- package/lib/endOfTreeSegment.js +2 -4
- package/lib/endOfTreeSegment.js.map +1 -1
- package/lib/index.d.ts +6 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/mergeTree.d.ts +37 -23
- package/lib/mergeTree.d.ts.map +1 -1
- package/lib/mergeTree.js +381 -488
- package/lib/mergeTree.js.map +1 -1
- package/lib/mergeTreeDeltaCallback.d.ts +4 -8
- package/lib/mergeTreeDeltaCallback.d.ts.map +1 -1
- package/lib/mergeTreeDeltaCallback.js.map +1 -1
- package/lib/mergeTreeNodes.d.ts +32 -10
- package/lib/mergeTreeNodes.d.ts.map +1 -1
- package/lib/mergeTreeNodes.js +42 -29
- package/lib/mergeTreeNodes.js.map +1 -1
- package/lib/partialLengths.d.ts +2 -2
- package/lib/partialLengths.d.ts.map +1 -1
- package/lib/partialLengths.js +160 -111
- package/lib/partialLengths.js.map +1 -1
- package/lib/perspective.d.ts +8 -27
- package/lib/perspective.d.ts.map +1 -1
- package/lib/perspective.js +8 -68
- package/lib/perspective.js.map +1 -1
- package/lib/revertibles.d.ts.map +1 -1
- package/lib/revertibles.js +2 -2
- package/lib/revertibles.js.map +1 -1
- package/lib/segmentInfos.d.ts +20 -106
- package/lib/segmentInfos.d.ts.map +1 -1
- package/lib/segmentInfos.js +26 -37
- package/lib/segmentInfos.js.map +1 -1
- package/lib/segmentPropertiesManager.d.ts +1 -14
- package/lib/segmentPropertiesManager.d.ts.map +1 -1
- package/lib/segmentPropertiesManager.js +2 -16
- package/lib/segmentPropertiesManager.js.map +1 -1
- package/lib/snapshotLoader.d.ts.map +1 -1
- package/lib/snapshotLoader.js +39 -19
- package/lib/snapshotLoader.js.map +1 -1
- package/lib/snapshotV1.d.ts.map +1 -1
- package/lib/snapshotV1.js +34 -26
- package/lib/snapshotV1.js.map +1 -1
- package/lib/snapshotlegacy.d.ts.map +1 -1
- package/lib/snapshotlegacy.js +7 -10
- package/lib/snapshotlegacy.js.map +1 -1
- package/lib/stamps.d.ts +1 -1
- package/lib/stamps.js +1 -1
- package/lib/stamps.js.map +1 -1
- package/lib/test/Insertion.perf.spec.js +6 -51
- package/lib/test/Insertion.perf.spec.js.map +1 -1
- package/lib/test/PartialLengths.perf.spec.js +18 -25
- package/lib/test/PartialLengths.perf.spec.js.map +1 -1
- package/lib/test/Removal.perf.spec.js +13 -41
- package/lib/test/Removal.perf.spec.js.map +1 -1
- package/lib/test/beastTest.spec.d.ts.map +1 -1
- package/lib/test/beastTest.spec.js +42 -67
- package/lib/test/beastTest.spec.js.map +1 -1
- package/lib/test/client.annotateMarker.spec.js +1 -11
- package/lib/test/client.annotateMarker.spec.js.map +1 -1
- package/lib/test/client.applyMsg.spec.js +14 -14
- package/lib/test/client.applyMsg.spec.js.map +1 -1
- package/lib/test/client.getPosition.spec.js +1 -1
- package/lib/test/client.getPosition.spec.js.map +1 -1
- package/lib/test/client.localReference.spec.js +1 -1
- package/lib/test/client.localReference.spec.js.map +1 -1
- package/lib/test/client.rollback.spec.js +50 -59
- package/lib/test/client.rollback.spec.js.map +1 -1
- package/lib/test/client.rollbackFarm.spec.js +1 -1
- package/lib/test/client.rollbackFarm.spec.js.map +1 -1
- package/lib/test/client.searchForMarker.spec.js +4 -21
- package/lib/test/client.searchForMarker.spec.js.map +1 -1
- package/lib/test/index.d.ts +2 -2
- package/lib/test/index.d.ts.map +1 -1
- package/lib/test/index.js +1 -1
- package/lib/test/index.js.map +1 -1
- package/lib/test/mergeTree.annotate.deltaCallback.spec.js +15 -60
- package/lib/test/mergeTree.annotate.deltaCallback.spec.js.map +1 -1
- package/lib/test/mergeTree.annotate.spec.js +48 -64
- package/lib/test/mergeTree.annotate.spec.js.map +1 -1
- package/lib/test/mergeTree.insert.deltaCallback.spec.js +10 -63
- package/lib/test/mergeTree.insert.deltaCallback.spec.js.map +1 -1
- package/lib/test/mergeTree.insertingWalk.spec.js +61 -127
- package/lib/test/mergeTree.insertingWalk.spec.js.map +1 -1
- package/lib/test/mergeTree.markRangeRemoved.deltaCallback.spec.js +13 -94
- package/lib/test/mergeTree.markRangeRemoved.deltaCallback.spec.js.map +1 -1
- package/lib/test/mergeTree.markRangeRemoved.spec.js +10 -7
- package/lib/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
- package/lib/test/mergeTree.walk.spec.js +2 -14
- package/lib/test/mergeTree.walk.spec.js.map +1 -1
- package/lib/test/mergeTreeOperationRunner.js +3 -3
- package/lib/test/mergeTreeOperationRunner.js.map +1 -1
- package/lib/test/obliterate.concurrent.spec.js +18 -23
- package/lib/test/obliterate.concurrent.spec.js.map +1 -1
- package/lib/test/obliterate.partialLength.spec.js +167 -137
- package/lib/test/obliterate.partialLength.spec.js.map +1 -1
- package/lib/test/obliterate.spec.js +17 -127
- package/lib/test/obliterate.spec.js.map +1 -1
- package/lib/test/partialLength.spec.js +29 -197
- package/lib/test/partialLength.spec.js.map +1 -1
- package/lib/test/perspective.spec.js +34 -0
- package/lib/test/perspective.spec.js.map +1 -1
- package/lib/test/propertyManager.spec.js +2 -2
- package/lib/test/propertyManager.spec.js.map +1 -1
- package/lib/test/resetPendingSegmentsToOp.spec.js +0 -2
- package/lib/test/resetPendingSegmentsToOp.spec.js.map +1 -1
- package/lib/test/segmentGroupCollection.spec.js +10 -4
- package/lib/test/segmentGroupCollection.spec.js.map +1 -1
- package/lib/test/testClient.d.ts +1 -0
- package/lib/test/testClient.d.ts.map +1 -1
- package/lib/test/testClient.js +18 -28
- package/lib/test/testClient.js.map +1 -1
- package/lib/test/testClientLogger.d.ts.map +1 -1
- package/lib/test/testClientLogger.js +3 -10
- package/lib/test/testClientLogger.js.map +1 -1
- package/lib/test/testServer.d.ts +2 -1
- package/lib/test/testServer.d.ts.map +1 -1
- package/lib/test/testServer.js +7 -5
- package/lib/test/testServer.js.map +1 -1
- package/lib/test/testUtils.d.ts +36 -56
- package/lib/test/testUtils.d.ts.map +1 -1
- package/lib/test/testUtils.js +66 -48
- package/lib/test/testUtils.js.map +1 -1
- package/lib/test/text.d.ts +2 -2
- package/lib/test/text.d.ts.map +1 -1
- package/lib/test/text.js +6 -3
- package/lib/test/text.js.map +1 -1
- package/lib/textSegment.d.ts +0 -6
- package/lib/textSegment.d.ts.map +1 -1
- package/lib/textSegment.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/zamboni.d.ts.map +1 -1
- package/lib/zamboni.js +32 -28
- package/lib/zamboni.js.map +1 -1
- package/package.json +17 -20
- package/src/MergeTreeTextHelper.ts +17 -12
- package/src/client.ts +141 -197
- package/src/endOfTreeSegment.ts +11 -8
- package/src/index.ts +4 -3
- package/src/mergeTree.ts +482 -633
- package/src/mergeTreeDeltaCallback.ts +4 -8
- package/src/mergeTreeNodes.ts +66 -45
- package/src/partialLengths.ts +181 -137
- package/src/perspective.ts +17 -95
- package/src/revertibles.ts +2 -7
- package/src/segmentInfos.ts +48 -141
- package/src/segmentPropertiesManager.ts +2 -16
- package/src/snapshotLoader.ts +62 -30
- package/src/snapshotV1.ts +36 -28
- package/src/snapshotlegacy.ts +7 -16
- package/src/stamps.ts +1 -1
- package/src/textSegment.ts +0 -13
- package/src/zamboni.ts +38 -32
- package/tsconfig.json +1 -0
- package/prettier.config.cjs +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTree.annotate.deltaCallback.spec.js","sourceRoot":"","sources":["../../src/test/mergeTree.annotate.deltaCallback.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,6CAA+C;AAE/C,
|
|
1
|
+
{"version":3,"file":"mergeTree.annotate.deltaCallback.spec.js","sourceRoot":"","sources":["../../src/test/mergeTree.annotate.deltaCallback.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,6CAA+C;AAE/C,kDAA4C;AAC5C,4EAAwE;AACxE,sCAA+C;AAC/C,sDAAgD;AAEhD,iDAAmE;AAEnE,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IAC1B,IAAI,SAAoB,CAAC;IACzB,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,IAAI,qBAA6B,CAAC;IAClC,UAAU,CAAC,GAAG,EAAE;QACf,SAAS,GAAG,IAAI,wBAAS,EAAE,CAAC;QAC5B,SAAS,CAAC,cAAc,CACvB,CAAC,EACD,CAAC,4BAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EACjC,SAAS,CAAC,gBAAgB,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uC,EAAE,GAAG,EAAE;YAChD,MAAM,YAAY,GAAG,IAAA,+BAAgB,EAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;YACxD,IAAI,oBAAoB,GAAG,qBAAqB,CAAC;YAEjD,SAAS,CAAC,gBAAgB,CACzB,CAAC,EACD,CAAC,EACD,SAAS,CAAC,gBAAgB,EAC1B,SAAS,CAAC,YAAY,CAAC,2BAA2B,EAAE,EACpD,SAAkB,CAClB,CAAC;YAEF,MAAM,KAAK,GAAG,IAAA,8BAAe,EAAC,SAAS,CAAC,CAAC;YAEzC,SAAS,CAAC,aAAa,CACtB,CAAC,EACD,CAAC,EACD;gBACC,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE;aACrB,EACD,YAAY,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC,EAC5D,YAAY,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,EAAE,CAAC,EACrD,SAAkB,CAClB,CAAC;YAEF,oBAAM,CAAC,eAAe,CAAC,KAAK,EAAE;gBAC7B,CAAC,oDAAwB,CAAC,KAAK,CAAC,EAAE,CAAC;aACnC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { MergeTree } from \"../mergeTree.js\";\nimport { MergeTreeMaintenanceType } from \"../mergeTreeDeltaCallback.js\";\nimport { MergeTreeDeltaType } from \"../ops.js\";\nimport { TextSegment } from \"../textSegment.js\";\n\nimport { countOperations, makeRemoteClient } from \"./testUtils.js\";\n\ndescribe(\"MergeTree\", () => {\n\tlet mergeTree: MergeTree;\n\tconst localClientId = 17;\n\tlet currentSequenceNumber: number;\n\tbeforeEach(() => {\n\t\tmergeTree = new MergeTree();\n\t\tmergeTree.insertSegments(\n\t\t\t0,\n\t\t\t[TextSegment.make(\"hello world\")],\n\t\t\tmergeTree.localPerspective,\n\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\tundefined,\n\t\t);\n\n\t\tcurrentSequenceNumber = 0;\n\t\tmergeTree.startCollaboration(\n\t\t\tlocalClientId,\n\t\t\t/* minSeq: */ currentSequenceNumber,\n\t\t\t/* currentSeq: */ currentSequenceNumber,\n\t\t);\n\t});\n\n\tdescribe(\"annotateRange\", () => {\n\t\tit(\"Event on annotation\", () => {\n\t\t\tconst count = countOperations(mergeTree);\n\n\t\t\tmergeTree.annotateRange(\n\t\t\t\t4,\n\t\t\t\t6,\n\t\t\t\t{\n\t\t\t\t\tprops: { foo: \"bar\" },\n\t\t\t\t},\n\t\t\t\tmergeTree.localPerspective,\n\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tassert.deepStrictEqual(count, {\n\t\t\t\t[MergeTreeDeltaType.ANNOTATE]: 1,\n\t\t\t\t[MergeTreeMaintenanceType.SPLIT]: 2,\n\t\t\t});\n\t\t});\n\n\t\tit(\"No event on annotation of empty range\", () => {\n\t\t\tconst count = countOperations(mergeTree);\n\t\t\tmergeTree.annotateRange(\n\t\t\t\t3,\n\t\t\t\t3,\n\t\t\t\t{\n\t\t\t\t\tprops: { foo: \"bar\" },\n\t\t\t\t},\n\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t{ seq: ++currentSequenceNumber, clientId: localClientId },\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tassert.deepStrictEqual(count, {\n\t\t\t\t[MergeTreeMaintenanceType.SPLIT]: 1,\n\t\t\t});\n\t\t});\n\n\t\tit(\"Annotate over local insertion\", () => {\n\t\t\tmergeTree.insertSegments(\n\t\t\t\t4,\n\t\t\t\t[TextSegment.make(\"a\")],\n\t\t\t\tmergeTree.localPerspective,\n\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\tundefined,\n\t\t\t);\n\n\t\t\tconst count = countOperations(mergeTree);\n\n\t\t\tmergeTree.annotateRange(\n\t\t\t\t3,\n\t\t\t\t8,\n\t\t\t\t{\n\t\t\t\t\tprops: { foo: \"bar\" },\n\t\t\t\t},\n\t\t\t\tmergeTree.localPerspective,\n\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tassert.deepStrictEqual(count, {\n\t\t\t\t[MergeTreeDeltaType.ANNOTATE]: 1,\n\t\t\t\t[MergeTreeMaintenanceType.SPLIT]: 2,\n\t\t\t});\n\t\t});\n\n\t\tit(\"Annotate over remote insertion\", () => {\n\t\t\tconst remoteClient = makeRemoteClient({ clientId: 35 });\n\t\t\tlet remoteSequenceNumber = currentSequenceNumber;\n\n\t\t\tmergeTree.insertSegments(\n\t\t\t\t4,\n\t\t\t\t[TextSegment.make(\"a\")],\n\t\t\t\tremoteClient.perspectiveAt({ refSeq: remoteSequenceNumber }),\n\t\t\t\tremoteClient.stampAt({ seq: ++remoteSequenceNumber }),\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tconst count = countOperations(mergeTree);\n\n\t\t\tmergeTree.annotateRange(\n\t\t\t\t3,\n\t\t\t\t8,\n\t\t\t\t{\n\t\t\t\t\tprops: { foo: \"bar\" },\n\t\t\t\t},\n\t\t\t\tmergeTree.localPerspective,\n\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tassert.deepStrictEqual(count, {\n\t\t\t\t[MergeTreeDeltaType.ANNOTATE]: 1,\n\t\t\t\t[MergeTreeMaintenanceType.SPLIT]: 2,\n\t\t\t});\n\t\t});\n\n\t\tit(\"Annotate over remote deletion\", () => {\n\t\t\tconst remoteClient = makeRemoteClient({ clientId: 35 });\n\t\t\tlet remoteSequenceNumber = currentSequenceNumber;\n\n\t\t\tmergeTree.markRangeRemoved(\n\t\t\t\t4,\n\t\t\t\t6,\n\t\t\t\tremoteClient.perspectiveAt({ refSeq: remoteSequenceNumber }),\n\t\t\t\tremoteClient.stampAt({ seq: ++remoteSequenceNumber }),\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tconst count = countOperations(mergeTree);\n\n\t\t\tmergeTree.annotateRange(\n\t\t\t\t3,\n\t\t\t\t8,\n\t\t\t\t{\n\t\t\t\t\tprops: { foo: \"bar\" },\n\t\t\t\t},\n\t\t\t\tmergeTree.localPerspective,\n\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tassert.deepStrictEqual(count, {\n\t\t\t\t[MergeTreeDeltaType.ANNOTATE]: 1,\n\t\t\t\t[MergeTreeMaintenanceType.SPLIT]: 2,\n\t\t\t});\n\t\t});\n\n\t\tit(\"Remote annotate within local deletion\", () => {\n\t\t\tconst remoteClient = makeRemoteClient({ clientId: 35 });\n\t\t\tlet remoteSequenceNumber = currentSequenceNumber;\n\n\t\t\tmergeTree.markRangeRemoved(\n\t\t\t\t3,\n\t\t\t\t8,\n\t\t\t\tmergeTree.localPerspective,\n\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tconst count = countOperations(mergeTree);\n\n\t\t\tmergeTree.annotateRange(\n\t\t\t\t4,\n\t\t\t\t6,\n\t\t\t\t{\n\t\t\t\t\tprops: { foo: \"bar\" },\n\t\t\t\t},\n\t\t\t\tremoteClient.perspectiveAt({ refSeq: remoteSequenceNumber }),\n\t\t\t\tremoteClient.stampAt({ seq: ++remoteSequenceNumber }),\n\t\t\t\tundefined as never,\n\t\t\t);\n\n\t\t\tassert.deepStrictEqual(count, {\n\t\t\t\t[MergeTreeMaintenanceType.SPLIT]: 2,\n\t\t\t});\n\t\t});\n\t});\n});\n"]}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const node_assert_1 = require("node:assert");
|
|
8
|
-
const constants_js_1 = require("../constants.js");
|
|
9
8
|
const mergeTree_js_1 = require("../mergeTree.js");
|
|
10
9
|
const mergeTreeNodes_js_1 = require("../mergeTreeNodes.js");
|
|
11
10
|
const ops_js_1 = require("../ops.js");
|
|
11
|
+
const perspective_js_1 = require("../perspective.js");
|
|
12
12
|
const segmentInfos_js_1 = require("../segmentInfos.js");
|
|
13
13
|
const textSegment_js_1 = require("../textSegment.js");
|
|
14
14
|
const testUtils_js_1 = require("./testUtils.js");
|
|
@@ -17,12 +17,12 @@ function splitAt(mergeTree, pos) {
|
|
|
17
17
|
mergeTree.mapRange((seg) => {
|
|
18
18
|
segment = seg;
|
|
19
19
|
return false;
|
|
20
|
-
},
|
|
20
|
+
}, new perspective_js_1.LocalDefaultPerspective(mergeTree.collabWindow.clientId), undefined, pos, pos + 1, true);
|
|
21
21
|
return segment;
|
|
22
22
|
}
|
|
23
23
|
describe("MergeTree", () => {
|
|
24
24
|
let mergeTree;
|
|
25
|
-
const
|
|
25
|
+
const remoteClient = (0, testUtils_js_1.makeRemoteClient)({ clientId: 35 });
|
|
26
26
|
const localClientId = 17;
|
|
27
27
|
let currentSequenceNumber;
|
|
28
28
|
const annotateStart = 1;
|
|
@@ -31,41 +31,25 @@ describe("MergeTree", () => {
|
|
|
31
31
|
const splitPos = Math.floor((annotateEnd - annotateStart) / 2) + annotateStart;
|
|
32
32
|
beforeEach(() => {
|
|
33
33
|
mergeTree = new mergeTree_js_1.MergeTree();
|
|
34
|
-
(0,
|
|
35
|
-
mergeTree,
|
|
36
|
-
pos: 0,
|
|
37
|
-
segments: [textSegment_js_1.TextSegment.make("hello world!")],
|
|
38
|
-
refSeq: constants_js_1.UniversalSequenceNumber,
|
|
39
|
-
clientId: constants_js_1.LocalClientId,
|
|
40
|
-
seq: constants_js_1.UniversalSequenceNumber,
|
|
41
|
-
opArgs: undefined,
|
|
42
|
-
});
|
|
34
|
+
mergeTree.insertSegments(0, [textSegment_js_1.TextSegment.make("hello world!")], mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
43
35
|
currentSequenceNumber = 0;
|
|
44
|
-
(
|
|
45
|
-
mergeTree,
|
|
46
|
-
pos: markerPosition,
|
|
47
|
-
segments: [mergeTreeNodes_js_1.Marker.make(ops_js_1.ReferenceType.Tile)],
|
|
48
|
-
refSeq: currentSequenceNumber,
|
|
49
|
-
clientId: remoteClientId,
|
|
50
|
-
seq: ++currentSequenceNumber,
|
|
51
|
-
opArgs: undefined,
|
|
52
|
-
});
|
|
36
|
+
mergeTree.insertSegments(markerPosition, [mergeTreeNodes_js_1.Marker.make(ops_js_1.ReferenceType.Tile)], remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: ++currentSequenceNumber }), undefined);
|
|
53
37
|
});
|
|
54
38
|
describe("annotateRange", () => {
|
|
55
39
|
describe("not collaborating", () => {
|
|
56
40
|
it("remote", () => {
|
|
57
41
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
58
42
|
props: { propertySource: "remote" },
|
|
59
|
-
}, currentSequenceNumber
|
|
60
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
43
|
+
}, remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: currentSequenceNumber + 1 }), undefined);
|
|
44
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
61
45
|
const segment = segmentInfo.segment;
|
|
62
46
|
node_assert_1.strict.equal(segment?.properties?.propertySource, "remote");
|
|
63
47
|
});
|
|
64
48
|
it("local", () => {
|
|
65
49
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
66
50
|
props: { propertySource: "local" },
|
|
67
|
-
},
|
|
68
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
51
|
+
}, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
52
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
69
53
|
const segment = segmentInfo.segment;
|
|
70
54
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local");
|
|
71
55
|
});
|
|
@@ -81,23 +65,23 @@ describe("MergeTree", () => {
|
|
|
81
65
|
props: { propertySource: "local" },
|
|
82
66
|
};
|
|
83
67
|
beforeEach(() => {
|
|
84
|
-
mergeTree.annotateRange(annotateStart, annotateEnd, props,
|
|
68
|
+
mergeTree.annotateRange(annotateStart, annotateEnd, props, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
85
69
|
});
|
|
86
70
|
it("unsequenced local", () => {
|
|
87
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
71
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
88
72
|
const segment = segmentInfo.segment;
|
|
89
73
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local");
|
|
90
74
|
});
|
|
91
75
|
it("unsequenced local after unsequenced local", () => {
|
|
92
76
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
93
77
|
props: { secondProperty: "local" },
|
|
94
|
-
},
|
|
95
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
78
|
+
}, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
79
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
96
80
|
const segment = segmentInfo.segment;
|
|
97
81
|
node_assert_1.strict.equal(segment.properties?.secondProperty, "local");
|
|
98
82
|
});
|
|
99
83
|
it("unsequenced local split", () => {
|
|
100
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
84
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
101
85
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
102
86
|
const splitSegment = splitAt(mergeTree, splitPos);
|
|
103
87
|
(0, segmentInfos_js_1.assertMergeNode)(splitSegment);
|
|
@@ -110,16 +94,16 @@ describe("MergeTree", () => {
|
|
|
110
94
|
secondChange: 1,
|
|
111
95
|
},
|
|
112
96
|
};
|
|
113
|
-
mergeTree.annotateRange(annotateStart, annotateEnd, secondChangeProps,
|
|
97
|
+
mergeTree.annotateRange(annotateStart, annotateEnd, secondChangeProps, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
114
98
|
const splitOnlyProps = {
|
|
115
99
|
props: {
|
|
116
100
|
splitOnly: 1,
|
|
117
101
|
},
|
|
118
102
|
};
|
|
119
|
-
mergeTree.annotateRange(splitPos, annotateEnd, splitOnlyProps,
|
|
120
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
103
|
+
mergeTree.annotateRange(splitPos, annotateEnd, splitOnlyProps, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
104
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
121
105
|
const segment = segmentInfo.segment;
|
|
122
|
-
const splitSegmentInfo = mergeTree.getContainingSegment(splitPos,
|
|
106
|
+
const splitSegmentInfo = mergeTree.getContainingSegment(splitPos, mergeTree.localPerspective);
|
|
123
107
|
const splitSegment = splitSegmentInfo.segment;
|
|
124
108
|
node_assert_1.strict.equal(segment.segmentGroups?.size, 2);
|
|
125
109
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local");
|
|
@@ -190,8 +174,8 @@ describe("MergeTree", () => {
|
|
|
190
174
|
it("unsequenced local before remote", () => {
|
|
191
175
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
192
176
|
props: { propertySource: "remote", remoteProperty: 1 },
|
|
193
|
-
}, currentSequenceNumber
|
|
194
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
177
|
+
}, remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: ++currentSequenceNumber }), undefined);
|
|
178
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
195
179
|
const segment = segmentInfo.segment;
|
|
196
180
|
node_assert_1.strict.equal(segment.segmentGroups?.size, 1);
|
|
197
181
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local");
|
|
@@ -209,7 +193,7 @@ describe("MergeTree", () => {
|
|
|
209
193
|
sequenceNumber: ++currentSequenceNumber,
|
|
210
194
|
},
|
|
211
195
|
});
|
|
212
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
196
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
213
197
|
const segment = segmentInfo.segment;
|
|
214
198
|
node_assert_1.strict.equal(segment.segmentGroups?.size, 0);
|
|
215
199
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local");
|
|
@@ -228,21 +212,21 @@ describe("MergeTree", () => {
|
|
|
228
212
|
});
|
|
229
213
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
230
214
|
props: { propertySource: "remote", remoteProperty: 1 },
|
|
231
|
-
}, currentSequenceNumber
|
|
232
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
215
|
+
}, remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: ++currentSequenceNumber }), undefined);
|
|
216
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
233
217
|
const segment = segmentInfo.segment;
|
|
234
218
|
node_assert_1.strict.equal(segment.segmentGroups?.size, 0);
|
|
235
219
|
node_assert_1.strict.equal(segment.properties?.propertySource, "remote");
|
|
236
220
|
node_assert_1.strict.equal(segment.properties?.remoteProperty, 1);
|
|
237
221
|
});
|
|
238
222
|
it("three local changes", () => {
|
|
239
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
223
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
240
224
|
const segment = segmentInfo.segment;
|
|
241
225
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local");
|
|
242
226
|
const props2 = {
|
|
243
227
|
props: { propertySource: "local2", secondSource: 1 },
|
|
244
228
|
};
|
|
245
|
-
mergeTree.annotateRange(annotateStart, annotateEnd, props2,
|
|
229
|
+
mergeTree.annotateRange(annotateStart, annotateEnd, props2, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
246
230
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local2");
|
|
247
231
|
node_assert_1.strict.equal(segment.properties?.secondSource, 1);
|
|
248
232
|
const props3 = {
|
|
@@ -250,7 +234,7 @@ describe("MergeTree", () => {
|
|
|
250
234
|
thirdSource: 1,
|
|
251
235
|
},
|
|
252
236
|
};
|
|
253
|
-
mergeTree.annotateRange(annotateStart, annotateEnd, props3,
|
|
237
|
+
mergeTree.annotateRange(annotateStart, annotateEnd, props3, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
254
238
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local2");
|
|
255
239
|
node_assert_1.strict.equal(segment.properties?.secondSource, 1);
|
|
256
240
|
node_assert_1.strict.equal(segment.properties?.thirdSource, 1);
|
|
@@ -300,7 +284,7 @@ describe("MergeTree", () => {
|
|
|
300
284
|
it("two local changes with interleaved remote", () => {
|
|
301
285
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
302
286
|
props: { secondSource: "local2" },
|
|
303
|
-
},
|
|
287
|
+
}, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
304
288
|
mergeTree.ackPendingSegment({
|
|
305
289
|
op: {
|
|
306
290
|
pos1: annotateStart,
|
|
@@ -314,8 +298,8 @@ describe("MergeTree", () => {
|
|
|
314
298
|
});
|
|
315
299
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
316
300
|
props: { propertySource: "remote", remoteOnly: 1, secondSource: "remote" },
|
|
317
|
-
}, currentSequenceNumber
|
|
318
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
301
|
+
}, remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: ++currentSequenceNumber }), undefined);
|
|
302
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
319
303
|
const segment = segmentInfo.segment;
|
|
320
304
|
node_assert_1.strict.equal(segment.properties?.remoteOnly, 1);
|
|
321
305
|
node_assert_1.strict.equal(segment.properties?.propertySource, "remote");
|
|
@@ -326,18 +310,18 @@ describe("MergeTree", () => {
|
|
|
326
310
|
beforeEach(() => {
|
|
327
311
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
328
312
|
props: { propertySource: "remote", remoteProperty: 1 },
|
|
329
|
-
}, currentSequenceNumber
|
|
330
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
313
|
+
}, remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: ++currentSequenceNumber }), undefined);
|
|
314
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
331
315
|
(0, node_assert_1.strict)(segmentInfo.segment?.segmentGroups?.size !== 0);
|
|
332
316
|
});
|
|
333
317
|
it("remote only", () => {
|
|
334
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
318
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
335
319
|
const segment = segmentInfo.segment;
|
|
336
320
|
node_assert_1.strict.equal(segment.properties?.propertySource, "remote");
|
|
337
321
|
node_assert_1.strict.equal(segment.properties?.remoteProperty, 1);
|
|
338
322
|
});
|
|
339
323
|
it("split remote", () => {
|
|
340
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
324
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
341
325
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
342
326
|
const splitSegment = splitAt(mergeTree, annotateStart + 1);
|
|
343
327
|
(0, segmentInfos_js_1.assertMergeNode)(splitSegment);
|
|
@@ -348,8 +332,8 @@ describe("MergeTree", () => {
|
|
|
348
332
|
it("remote before unsequenced local", () => {
|
|
349
333
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
350
334
|
props: { propertySource: "local" },
|
|
351
|
-
},
|
|
352
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
335
|
+
}, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
336
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
353
337
|
const segment = segmentInfo.segment;
|
|
354
338
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local");
|
|
355
339
|
node_assert_1.strict.equal(segment.properties?.remoteProperty, 1);
|
|
@@ -358,9 +342,9 @@ describe("MergeTree", () => {
|
|
|
358
342
|
const props = {
|
|
359
343
|
props: { propertySource: "local" },
|
|
360
344
|
};
|
|
361
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
345
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
362
346
|
(0, node_assert_1.strict)(segmentInfo.segment?.segmentGroups?.empty !== false);
|
|
363
|
-
mergeTree.annotateRange(annotateStart, annotateEnd, props,
|
|
347
|
+
mergeTree.annotateRange(annotateStart, annotateEnd, props, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
364
348
|
node_assert_1.strict.equal(segmentInfo.segment?.segmentGroups?.size, 1);
|
|
365
349
|
mergeTree.ackPendingSegment({
|
|
366
350
|
op: {
|
|
@@ -383,13 +367,13 @@ describe("MergeTree", () => {
|
|
|
383
367
|
props: { propertySource: "local" },
|
|
384
368
|
};
|
|
385
369
|
beforeEach(() => {
|
|
386
|
-
mergeTree.annotateRange(annotateStart, annotateEnd, props,
|
|
370
|
+
mergeTree.annotateRange(annotateStart, annotateEnd, props, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
387
371
|
});
|
|
388
372
|
it("unsequenced local after unsequenced local", () => {
|
|
389
373
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
390
374
|
props: { propertySource: "local2", secondProperty: "local" },
|
|
391
|
-
},
|
|
392
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
375
|
+
}, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
376
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
393
377
|
const segment = segmentInfo.segment;
|
|
394
378
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local2");
|
|
395
379
|
node_assert_1.strict.equal(segment.properties?.secondProperty, "local");
|
|
@@ -397,8 +381,8 @@ describe("MergeTree", () => {
|
|
|
397
381
|
it("unsequenced local before remote", () => {
|
|
398
382
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
399
383
|
props: { propertySource: "remote", remoteProperty: 1 },
|
|
400
|
-
}, currentSequenceNumber
|
|
401
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
384
|
+
}, remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: ++currentSequenceNumber }), undefined);
|
|
385
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
402
386
|
const segment = segmentInfo.segment;
|
|
403
387
|
node_assert_1.strict.equal(segment.segmentGroups?.size, 1);
|
|
404
388
|
node_assert_1.strict.equal(segment.properties?.propertySource, "local");
|
|
@@ -418,8 +402,8 @@ describe("MergeTree", () => {
|
|
|
418
402
|
});
|
|
419
403
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
420
404
|
props: { propertySource: "remote", remoteProperty: 1 },
|
|
421
|
-
}, currentSequenceNumber
|
|
422
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
405
|
+
}, remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: ++currentSequenceNumber }), undefined);
|
|
406
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
423
407
|
const segment = segmentInfo.segment;
|
|
424
408
|
node_assert_1.strict.equal(segment.segmentGroups?.size, 0);
|
|
425
409
|
node_assert_1.strict.equal(segment.properties?.propertySource, "remote");
|
|
@@ -428,7 +412,7 @@ describe("MergeTree", () => {
|
|
|
428
412
|
it("two local changes with interleaved remote", () => {
|
|
429
413
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
430
414
|
props: { secondSource: "local2" },
|
|
431
|
-
},
|
|
415
|
+
}, mergeTree.localPerspective, mergeTree.collabWindow.mintNextLocalOperationStamp(), undefined);
|
|
432
416
|
mergeTree.ackPendingSegment({
|
|
433
417
|
op: {
|
|
434
418
|
pos1: annotateStart,
|
|
@@ -442,8 +426,8 @@ describe("MergeTree", () => {
|
|
|
442
426
|
});
|
|
443
427
|
mergeTree.annotateRange(annotateStart, annotateEnd, {
|
|
444
428
|
props: { propertySource: "remote", remoteOnly: 1, secondSource: "remote" },
|
|
445
|
-
}, currentSequenceNumber
|
|
446
|
-
const segmentInfo = mergeTree.getContainingSegment(annotateStart,
|
|
429
|
+
}, remoteClient.perspectiveAt({ refSeq: currentSequenceNumber }), remoteClient.stampAt({ seq: ++currentSequenceNumber }), undefined);
|
|
430
|
+
const segmentInfo = mergeTree.getContainingSegment(annotateStart, mergeTree.localPerspective);
|
|
447
431
|
const segment = segmentInfo.segment;
|
|
448
432
|
node_assert_1.strict.equal(segment.properties?.remoteOnly, 1);
|
|
449
433
|
node_assert_1.strict.equal(segment.properties?.propertySource, "remote");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTree.annotate.spec.js","sourceRoot":"","sources":["../../src/test/mergeTree.annotate.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,6CAA+C;AAI/C,kDAIyB;AACzB,kDAA4C;AAC5C,4DAAoE;AACpE,sCAA8D;AAC9D,wDAAqD;AAErD,sDAAgD;AAEhD,iDAAgD;AAEhD,SAAS,OAAO,CAAC,SAAoB,EAAE,GAAW;IACjD,IAAI,OAAoC,CAAC;IACzC,SAAS,CAAC,QAAQ,CACjB,CAAC,GAAG,EAAE,EAAE;QACP,OAAO,GAAG,GAAG,CAAC;QACd,OAAO,KAAK,CAAC;IACd,CAAC,EACD,SAAS,CAAC,YAAY,CAAC,UAAU,EACjC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAC/B,SAAS,EACT,GAAG,EACH,GAAG,GAAG,CAAC,EACP,IAAI,CACJ,CAAC;IACF,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IAC1B,IAAI,SAAoB,CAAC;IACzB,MAAM,cAAc,GAAG,EAAE,CAAC;IAC1B,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,IAAI,qBAA6B,CAAC;IAElC,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,cAAc,GAAG,aAAa,GAAG,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,cAAc,GAAG,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC;IAE/E,UAAU,CAAC,GAAG,EAAE;QACf,SAAS,GAAG,IAAI,wBAAS,EAAE,CAAC;QAC5B,IAAA,6BAAc,EAAC;YACd,SAAS;YACT,GAAG,EAAE,CAAC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E,EAAE;4BACH,IAAI,EAAE,aAAa;4BACnB,IAAI,EAAE,WAAW;4BACjB,GAAG,KAAK;4BACR,IAAI,EAAE,2BAAkB,CAAC,QAAQ;yBACjC;wBACD,gBAAgB,EAAE;4BACjB,cAAc,EAAE,EAAE,qBAAqB;yBACC;qBACzC,CAAC,CAAC;oBAEH,SAAS,CAAC,aAAa,CACtB,aAAa,EACb,WAAW,EACX;wBACC,KAAK,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE;qBAC1E,EACD,qBAAqB,EACrB,cAAc,EACd,EAAE,qBAAqB,EACvB,SAAkB,CAClB,CAAC;oBAEF,MAAM,WAAW,GAAG,SAAS,CAAC,oBAAoB,CACjD,aAAa,EACb,qBAAqB,EACrB,aAAa,CACb,CAAC;oBACF,MAAM,OAAO,GAAG,WAAW,CAAC,OAA0B,CAAC;oBAEvD,oBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;oBAChD,oBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;oBAC3D,oBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;gBAC1D,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLocalClientId,\n\tUnassignedSequenceNumber,\n\tUniversalSequenceNumber,\n} from \"../constants.js\";\nimport { MergeTree } from \"../mergeTree.js\";\nimport { Marker, type ISegmentPrivate } from \"../mergeTreeNodes.js\";\nimport { MergeTreeDeltaType, ReferenceType } from \"../ops.js\";\nimport { assertMergeNode } from \"../segmentInfos.js\";\nimport type { PropsOrAdjust } from \"../segmentPropertiesManager.js\";\nimport { TextSegment } from \"../textSegment.js\";\n\nimport { insertSegments } from \"./testUtils.js\";\n\nfunction splitAt(mergeTree: MergeTree, pos: number): ISegmentPrivate | undefined {\n\tlet segment: ISegmentPrivate | undefined;\n\tmergeTree.mapRange(\n\t\t(seg) => {\n\t\t\tsegment = seg;\n\t\t\treturn false;\n\t\t},\n\t\tmergeTree.collabWindow.currentSeq,\n\t\tmergeTree.collabWindow.clientId,\n\t\tundefined,\n\t\tpos,\n\t\tpos + 1,\n\t\ttrue,\n\t);\n\treturn segment;\n}\n\ndescribe(\"MergeTree\", () => {\n\tlet mergeTree: MergeTree;\n\tconst remoteClientId = 35;\n\tconst localClientId = 17;\n\tlet currentSequenceNumber: number;\n\n\tconst annotateStart = 1;\n\tconst markerPosition = annotateStart + 2;\n\tconst annotateEnd = markerPosition + 2;\n\tconst splitPos = Math.floor((annotateEnd - annotateStart) / 2) + annotateStart;\n\n\tbeforeEach(() => {\n\t\tmergeTree = new MergeTree();\n\t\tinsertSegments({\n\t\t\tmergeTree,\n\t\t\tpos: 0,\n\t\t\tsegments: [TextSegment.make(\"hello world!\")],\n\t\t\trefSeq: UniversalSequenceNumber,\n\t\t\tclientId: LocalClientId,\n\t\t\tseq: UniversalSequenceNumber,\n\t\t\topArgs: undefined as never,\n\t\t});\n\n\t\tcurrentSequenceNumber = 0;\n\t\tinsertSegments({\n\t\t\tmergeTree,\n\t\t\tpos: markerPosition,\n\t\t\tsegments: [Marker.make(ReferenceType.Tile)],\n\t\t\trefSeq: currentSequenceNumber,\n\t\t\tclientId: remoteClientId,\n\t\t\tseq: ++currentSequenceNumber,\n\t\t\topArgs: undefined as never,\n\t\t});\n\t});\n\n\tdescribe(\"annotateRange\", () => {\n\t\tdescribe(\"not collaborating\", () => {\n\t\t\tit(\"remote\", () => {\n\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\tannotateStart,\n\t\t\t\t\tannotateEnd,\n\t\t\t\t\t{\n\t\t\t\t\t\tprops: { propertySource: \"remote\" },\n\t\t\t\t\t},\n\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\tremoteClientId,\n\t\t\t\t\tcurrentSequenceNumber + 1,\n\t\t\t\t\tundefined as never,\n\t\t\t\t);\n\n\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\tannotateStart,\n\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\tlocalClientId,\n\t\t\t\t);\n\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\tassert.equal(segment?.properties?.propertySource, \"remote\");\n\t\t\t});\n\n\t\t\tit(\"local\", () => {\n\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\tannotateStart,\n\t\t\t\t\tannotateEnd,\n\t\t\t\t\t{\n\t\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t\t},\n\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\tlocalClientId,\n\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\tundefined as never,\n\t\t\t\t);\n\n\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\tannotateStart,\n\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\tlocalClientId,\n\t\t\t\t);\n\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t});\n\t\t});\n\t\tdescribe(\"collaborating\", () => {\n\t\t\tbeforeEach(() => {\n\t\t\t\tmergeTree.startCollaboration(\n\t\t\t\t\tlocalClientId,\n\t\t\t\t\t/* minSeq: */ currentSequenceNumber,\n\t\t\t\t\t/* currentSeq: */ currentSequenceNumber,\n\t\t\t\t);\n\t\t\t});\n\t\t\tdescribe(\"local first\", () => {\n\t\t\t\tconst props: PropsOrAdjust = {\n\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t};\n\t\t\t\tbeforeEach(() => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local after unsequenced local\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { secondProperty: \"local\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.secondProperty, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local split\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst splitSegment = splitAt(mergeTree, splitPos)!;\n\t\t\t\t\tassertMergeNode(splitSegment);\n\t\t\t\t\tassert.notEqual(segmentInfo.segment?.ordinal, splitSegment.ordinal);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local after unsequenced local split\", () => {\n\t\t\t\t\tconst secondChangeProps: PropsOrAdjust = {\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\tsecondChange: 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tsecondChangeProps,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst splitOnlyProps: PropsOrAdjust = {\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\tsplitOnly: 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tsplitPos,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tsplitOnlyProps,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tconst splitSegmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tsplitPos,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst splitSegment = splitSegmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 2);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.secondChange, 1);\n\t\t\t\t\tassert(!segment.properties?.splitOnly);\n\n\t\t\t\t\tassert.equal(splitSegment.segmentGroups?.size, 3);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.secondChange, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.splitOnly, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.secondChange, 1);\n\t\t\t\t\tassert(!segment.properties?.splitOnly);\n\n\t\t\t\t\tassert.equal(splitSegment?.segmentGroups?.size, 2);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.secondChange, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.splitOnly, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...secondChangeProps,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.secondChange, 1);\n\t\t\t\t\tassert(!segment.properties?.splitOnly);\n\n\t\t\t\t\tassert.equal(splitSegment.segmentGroups?.size, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.secondChange, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.splitOnly, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: splitPos,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...splitOnlyProps,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.secondChange, 1);\n\t\t\t\t\tassert(!segment.properties?.splitOnly);\n\n\t\t\t\t\tassert.equal(splitSegment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.secondChange, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.splitOnly, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local before remote\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tremoteClientId,\n\t\t\t\t\t\t++currentSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"sequenced local\", () => {\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"sequenced local before remote\", () => {\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tremoteClientId,\n\t\t\t\t\t\t++currentSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"three local changes\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\n\t\t\t\t\tconst props2: PropsOrAdjust = {\n\t\t\t\t\t\tprops: { propertySource: \"local2\", secondSource: 1 },\n\t\t\t\t\t};\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops2,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\n\t\t\t\t\tconst props3: PropsOrAdjust = {\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\tthirdSource: 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops3,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\t\t\t\t\tassert.equal(segment.properties?.thirdSource, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\t\t\t\t\tassert.equal(segment.properties?.thirdSource, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props2,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\t\t\t\t\tassert.equal(segment.properties?.thirdSource, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props3,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\t\t\t\t\tassert.equal(segment.properties?.thirdSource, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"two local changes with interleaved remote\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { secondSource: \"local2\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteOnly: 1, secondSource: \"remote\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tremoteClientId,\n\t\t\t\t\t\t++currentSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.properties?.remoteOnly, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, \"local2\");\n\t\t\t\t});\n\t\t\t});\n\t\t\tdescribe(\"remote first\", () => {\n\t\t\t\tbeforeEach(() => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tremoteClientId,\n\t\t\t\t\t\t++currentSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tassert(segmentInfo.segment?.segmentGroups?.size !== 0);\n\t\t\t\t});\n\t\t\t\tit(\"remote only\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"split remote\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst splitSegment = splitAt(mergeTree, annotateStart + 1)!;\n\t\t\t\t\tassertMergeNode(splitSegment);\n\t\t\t\t\tassert.notEqual(segmentInfo.segment?.ordinal, splitSegment.ordinal);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"remote before unsequenced local\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"remote before sequenced local\", () => {\n\t\t\t\t\tconst props: PropsOrAdjust = {\n\t\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t\t};\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tassert(segmentInfo.segment?.segmentGroups?.empty !== false);\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert.equal(segmentInfo.segment?.segmentGroups?.size, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert(segmentInfo.segment?.segmentGroups?.empty);\n\t\t\t\t\tassert.equal(segmentInfo.segment?.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segmentInfo.segment?.properties?.remoteProperty, 1);\n\t\t\t\t});\n\t\t\t});\n\t\t\tdescribe(\"local with rewrite first\", () => {\n\t\t\t\tconst props: PropsOrAdjust = {\n\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t};\n\t\t\t\tbeforeEach(() => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local after unsequenced local\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"local2\", secondProperty: \"local\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondProperty, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local before remote\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tremoteClientId,\n\t\t\t\t\t\t++currentSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"sequenced local before remote\", () => {\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tremoteClientId,\n\t\t\t\t\t\t++currentSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"two local changes with interleaved remote\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { secondSource: \"local2\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t\tUnassignedSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteOnly: 1, secondSource: \"remote\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tremoteClientId,\n\t\t\t\t\t\t++currentSequenceNumber,\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tcurrentSequenceNumber,\n\t\t\t\t\t\tlocalClientId,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.properties?.remoteOnly, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, \"local2\");\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n});\n"]}
|
|
1
|
+
{"version":3,"file":"mergeTree.annotate.spec.js","sourceRoot":"","sources":["../../src/test/mergeTree.annotate.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,6CAA+C;AAI/C,kDAA4C;AAC5C,4DAAoE;AACpE,sCAA8D;AAC9D,sDAA4D;AAC5D,wDAAqD;AAErD,sDAAgD;AAEhD,iDAAkD;AAElD,SAAS,OAAO,CAAC,SAA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OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,qBAAqB,EAAE,CAAC,EACtD,SAAkB,CAClB,CAAC;oBAEF,MAAM,WAAW,GAAG,SAAS,CAAC,oBAAoB,CACjD,aAAa,EACb,SAAS,CAAC,gBAAgB,CAC1B,CAAC;oBACF,MAAM,OAAO,GAAG,WAAW,CAAC,OAA0B,CAAC;oBAEvD,oBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;oBAChD,oBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;oBAC3D,oBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;gBAC1D,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport { MergeTree } from \"../mergeTree.js\";\nimport { Marker, type ISegmentPrivate } from \"../mergeTreeNodes.js\";\nimport { MergeTreeDeltaType, ReferenceType } from \"../ops.js\";\nimport { LocalDefaultPerspective } from \"../perspective.js\";\nimport { assertMergeNode } from \"../segmentInfos.js\";\nimport type { PropsOrAdjust } from \"../segmentPropertiesManager.js\";\nimport { TextSegment } from \"../textSegment.js\";\n\nimport { makeRemoteClient } from \"./testUtils.js\";\n\nfunction splitAt(mergeTree: MergeTree, pos: number): ISegmentPrivate | undefined {\n\tlet segment: ISegmentPrivate | undefined;\n\tmergeTree.mapRange(\n\t\t(seg) => {\n\t\t\tsegment = seg;\n\t\t\treturn false;\n\t\t},\n\t\tnew LocalDefaultPerspective(mergeTree.collabWindow.clientId),\n\t\tundefined,\n\t\tpos,\n\t\tpos + 1,\n\t\ttrue,\n\t);\n\treturn segment;\n}\n\ndescribe(\"MergeTree\", () => {\n\tlet mergeTree: MergeTree;\n\tconst remoteClient = makeRemoteClient({ clientId: 35 });\n\tconst localClientId = 17;\n\tlet currentSequenceNumber: number;\n\n\tconst annotateStart = 1;\n\tconst markerPosition = annotateStart + 2;\n\tconst annotateEnd = markerPosition + 2;\n\tconst splitPos = Math.floor((annotateEnd - annotateStart) / 2) + annotateStart;\n\n\tbeforeEach(() => {\n\t\tmergeTree = new MergeTree();\n\t\tmergeTree.insertSegments(\n\t\t\t0,\n\t\t\t[TextSegment.make(\"hello world!\")],\n\t\t\tmergeTree.localPerspective,\n\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\tundefined,\n\t\t);\n\n\t\tcurrentSequenceNumber = 0;\n\t\tmergeTree.insertSegments(\n\t\t\tmarkerPosition,\n\t\t\t[Marker.make(ReferenceType.Tile)],\n\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\tremoteClient.stampAt({ seq: ++currentSequenceNumber }),\n\t\t\tundefined,\n\t\t);\n\t});\n\n\tdescribe(\"annotateRange\", () => {\n\t\tdescribe(\"not collaborating\", () => {\n\t\t\tit(\"remote\", () => {\n\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\tannotateStart,\n\t\t\t\t\tannotateEnd,\n\t\t\t\t\t{\n\t\t\t\t\t\tprops: { propertySource: \"remote\" },\n\t\t\t\t\t},\n\t\t\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\t\t\tremoteClient.stampAt({ seq: currentSequenceNumber + 1 }),\n\t\t\t\t\tundefined as never,\n\t\t\t\t);\n\n\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\tannotateStart,\n\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t);\n\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\tassert.equal(segment?.properties?.propertySource, \"remote\");\n\t\t\t});\n\n\t\t\tit(\"local\", () => {\n\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\tannotateStart,\n\t\t\t\t\tannotateEnd,\n\t\t\t\t\t{\n\t\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t\t},\n\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\tundefined as never,\n\t\t\t\t);\n\n\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\tannotateStart,\n\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t);\n\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t});\n\t\t});\n\t\tdescribe(\"collaborating\", () => {\n\t\t\tbeforeEach(() => {\n\t\t\t\tmergeTree.startCollaboration(\n\t\t\t\t\tlocalClientId,\n\t\t\t\t\t/* minSeq: */ currentSequenceNumber,\n\t\t\t\t\t/* currentSeq: */ currentSequenceNumber,\n\t\t\t\t);\n\t\t\t});\n\t\t\tdescribe(\"local first\", () => {\n\t\t\t\tconst props: PropsOrAdjust = {\n\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t};\n\t\t\t\tbeforeEach(() => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local after unsequenced local\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { secondProperty: \"local\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.secondProperty, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local split\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst splitSegment = splitAt(mergeTree, splitPos)!;\n\t\t\t\t\tassertMergeNode(splitSegment);\n\t\t\t\t\tassert.notEqual(segmentInfo.segment?.ordinal, splitSegment.ordinal);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local after unsequenced local split\", () => {\n\t\t\t\t\tconst secondChangeProps: PropsOrAdjust = {\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\tsecondChange: 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tsecondChangeProps,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst splitOnlyProps: PropsOrAdjust = {\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\tsplitOnly: 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tsplitPos,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tsplitOnlyProps,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tconst splitSegmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tsplitPos,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst splitSegment = splitSegmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 2);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.secondChange, 1);\n\t\t\t\t\tassert(!segment.properties?.splitOnly);\n\n\t\t\t\t\tassert.equal(splitSegment.segmentGroups?.size, 3);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.secondChange, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.splitOnly, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.secondChange, 1);\n\t\t\t\t\tassert(!segment.properties?.splitOnly);\n\n\t\t\t\t\tassert.equal(splitSegment?.segmentGroups?.size, 2);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.secondChange, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.splitOnly, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...secondChangeProps,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.secondChange, 1);\n\t\t\t\t\tassert(!segment.properties?.splitOnly);\n\n\t\t\t\t\tassert.equal(splitSegment.segmentGroups?.size, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.secondChange, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.splitOnly, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: splitPos,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...splitOnlyProps,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.secondChange, 1);\n\t\t\t\t\tassert(!segment.properties?.splitOnly);\n\n\t\t\t\t\tassert.equal(splitSegment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.secondChange, 1);\n\t\t\t\t\tassert.equal(splitSegment.properties?.splitOnly, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local before remote\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\t\t\t\tremoteClient.stampAt({ seq: ++currentSequenceNumber }),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"sequenced local\", () => {\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"sequenced local before remote\", () => {\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\t\t\t\tremoteClient.stampAt({ seq: ++currentSequenceNumber }),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"three local changes\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\n\t\t\t\t\tconst props2: PropsOrAdjust = {\n\t\t\t\t\t\tprops: { propertySource: \"local2\", secondSource: 1 },\n\t\t\t\t\t};\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops2,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\n\t\t\t\t\tconst props3: PropsOrAdjust = {\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\tthirdSource: 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops3,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\t\t\t\t\tassert.equal(segment.properties?.thirdSource, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\t\t\t\t\tassert.equal(segment.properties?.thirdSource, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props2,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\t\t\t\t\tassert.equal(segment.properties?.thirdSource, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props3,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, 1);\n\t\t\t\t\tassert.equal(segment.properties?.thirdSource, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"two local changes with interleaved remote\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { secondSource: \"local2\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteOnly: 1, secondSource: \"remote\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\t\t\t\tremoteClient.stampAt({ seq: ++currentSequenceNumber }),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.properties?.remoteOnly, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, \"local2\");\n\t\t\t\t});\n\t\t\t});\n\t\t\tdescribe(\"remote first\", () => {\n\t\t\t\tbeforeEach(() => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\t\t\t\tremoteClient.stampAt({ seq: ++currentSequenceNumber }),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tassert(segmentInfo.segment?.segmentGroups?.size !== 0);\n\t\t\t\t});\n\t\t\t\tit(\"remote only\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"split remote\", () => {\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst splitSegment = splitAt(mergeTree, annotateStart + 1)!;\n\t\t\t\t\tassertMergeNode(splitSegment);\n\t\t\t\t\tassert.notEqual(segmentInfo.segment?.ordinal, splitSegment.ordinal);\n\t\t\t\t\tassert.equal(splitSegment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(splitSegment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"remote before unsequenced local\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"remote before sequenced local\", () => {\n\t\t\t\t\tconst props: PropsOrAdjust = {\n\t\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t\t};\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tassert(segmentInfo.segment?.segmentGroups?.empty !== false);\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert.equal(segmentInfo.segment?.segmentGroups?.size, 1);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tassert(segmentInfo.segment?.segmentGroups?.empty);\n\t\t\t\t\tassert.equal(segmentInfo.segment?.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segmentInfo.segment?.properties?.remoteProperty, 1);\n\t\t\t\t});\n\t\t\t});\n\t\t\tdescribe(\"local with rewrite first\", () => {\n\t\t\t\tconst props: PropsOrAdjust = {\n\t\t\t\t\tprops: { propertySource: \"local\" },\n\t\t\t\t};\n\t\t\t\tbeforeEach(() => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\tprops,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local after unsequenced local\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"local2\", secondProperty: \"local\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local2\");\n\t\t\t\t\tassert.equal(segment.properties?.secondProperty, \"local\");\n\t\t\t\t});\n\n\t\t\t\tit(\"unsequenced local before remote\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\t\t\t\tremoteClient.stampAt({ seq: ++currentSequenceNumber }),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"local\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"sequenced local before remote\", () => {\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteProperty: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\t\t\t\tremoteClient.stampAt({ seq: ++currentSequenceNumber }),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.segmentGroups?.size, 0);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.remoteProperty, 1);\n\t\t\t\t});\n\n\t\t\t\tit(\"two local changes with interleaved remote\", () => {\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { secondSource: \"local2\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t\tmergeTree.collabWindow.mintNextLocalOperationStamp(),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tmergeTree.ackPendingSegment({\n\t\t\t\t\t\top: {\n\t\t\t\t\t\t\tpos1: annotateStart,\n\t\t\t\t\t\t\tpos2: annotateEnd,\n\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\ttype: MergeTreeDeltaType.ANNOTATE,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsequencedMessage: {\n\t\t\t\t\t\t\tsequenceNumber: ++currentSequenceNumber,\n\t\t\t\t\t\t} as unknown as ISequencedDocumentMessage,\n\t\t\t\t\t});\n\n\t\t\t\t\tmergeTree.annotateRange(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tannotateEnd,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprops: { propertySource: \"remote\", remoteOnly: 1, secondSource: \"remote\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremoteClient.perspectiveAt({ refSeq: currentSequenceNumber }),\n\t\t\t\t\t\tremoteClient.stampAt({ seq: ++currentSequenceNumber }),\n\t\t\t\t\t\tundefined as never,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst segmentInfo = mergeTree.getContainingSegment(\n\t\t\t\t\t\tannotateStart,\n\t\t\t\t\t\tmergeTree.localPerspective,\n\t\t\t\t\t);\n\t\t\t\t\tconst segment = segmentInfo.segment as ISegmentPrivate;\n\n\t\t\t\t\tassert.equal(segment.properties?.remoteOnly, 1);\n\t\t\t\t\tassert.equal(segment.properties?.propertySource, \"remote\");\n\t\t\t\t\tassert.equal(segment.properties?.secondSource, \"local2\");\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n});\n"]}
|