@fluidframework/merge-tree 2.0.0-rc.1.0.2 → 2.0.0-rc.1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/merge-tree",
3
- "version": "2.0.0-rc.1.0.2",
3
+ "version": "2.0.0-rc.1.0.3",
4
4
  "description": "Merge tree",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -97,29 +97,29 @@
97
97
  "temp-directory": "nyc/.nyc_output"
98
98
  },
99
99
  "dependencies": {
100
- "@fluid-internal/client-utils": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
101
- "@fluidframework/container-definitions": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
102
- "@fluidframework/core-interfaces": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
103
- "@fluidframework/core-utils": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
104
- "@fluidframework/datastore-definitions": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
100
+ "@fluid-internal/client-utils": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
101
+ "@fluidframework/container-definitions": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
102
+ "@fluidframework/core-interfaces": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
103
+ "@fluidframework/core-utils": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
104
+ "@fluidframework/datastore-definitions": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
105
105
  "@fluidframework/protocol-definitions": "^3.1.0",
106
- "@fluidframework/runtime-definitions": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
107
- "@fluidframework/runtime-utils": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
108
- "@fluidframework/shared-object-base": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
109
- "@fluidframework/telemetry-utils": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0"
106
+ "@fluidframework/runtime-definitions": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
107
+ "@fluidframework/runtime-utils": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
108
+ "@fluidframework/shared-object-base": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
109
+ "@fluidframework/telemetry-utils": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@arethetypeswrong/cli": "^0.13.3",
113
- "@fluid-private/stochastic-test-utils": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
114
- "@fluid-private/test-pairwise-generator": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
113
+ "@fluid-private/stochastic-test-utils": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
114
+ "@fluid-private/test-pairwise-generator": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
115
115
  "@fluid-tools/benchmark": "^0.48.0",
116
116
  "@fluid-tools/build-cli": "^0.29.0",
117
117
  "@fluidframework/build-common": "^2.0.3",
118
118
  "@fluidframework/build-tools": "^0.29.0",
119
119
  "@fluidframework/eslint-config-fluid": "^3.2.0",
120
120
  "@fluidframework/merge-tree-previous": "npm:@fluidframework/merge-tree@2.0.0-internal.8.0.0",
121
- "@fluidframework/mocha-test-setup": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
122
- "@fluidframework/test-runtime-utils": ">=2.0.0-rc.1.0.2 <2.0.0-rc.1.1.0",
121
+ "@fluidframework/mocha-test-setup": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
122
+ "@fluidframework/test-runtime-utils": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0",
123
123
  "@microsoft/api-extractor": "^7.38.3",
124
124
  "@types/diff": "^3.5.1",
125
125
  "@types/mocha": "^9.1.1",
package/src/mergeTree.ts CHANGED
@@ -102,11 +102,11 @@ function markSegmentMoved(seg: ISegment, moveInfo: IMoveInfo): void {
102
102
  seg.wasMovedOnInsert = moveInfo.wasMovedOnInsert;
103
103
  }
104
104
 
105
- function isMoved(segment: ISegment): boolean {
105
+ function isMoved(segment: ISegment): segment is ISegment & IMoveInfo {
106
106
  return toMoveInfo(segment) !== undefined;
107
107
  }
108
108
 
109
- function isRemoved(segment: ISegment): boolean {
109
+ function isRemoved(segment: ISegment): segment is ISegment & IRemovalInfo {
110
110
  return toRemovalInfo(segment) !== undefined;
111
111
  }
112
112
 
@@ -115,7 +115,7 @@ function isRemovedAndAcked(segment: ISegment): segment is ISegment & IRemovalInf
115
115
  return removalInfo !== undefined && removalInfo.removedSeq !== UnassignedSequenceNumber;
116
116
  }
117
117
 
118
- function isMovedAndAcked(segment: ISegment): boolean {
118
+ function isMovedAndAcked(segment: ISegment): segment is ISegment & IMoveInfo {
119
119
  const moveInfo = toMoveInfo(segment);
120
120
  return moveInfo !== undefined && moveInfo.movedSeq !== UnassignedSequenceNumber;
121
121
  }
@@ -1270,7 +1270,12 @@ export class MergeTree {
1270
1270
 
1271
1271
  // TODO: error checking
1272
1272
  public getMarkerFromId(id: string): Marker | undefined {
1273
- return this.idToMarker.get(id);
1273
+ const marker = this.idToMarker.get(id);
1274
+ return marker === undefined ||
1275
+ isRemoved(marker) ||
1276
+ (isMoved(marker) && marker.moveDst === undefined)
1277
+ ? undefined
1278
+ : marker;
1274
1279
  }
1275
1280
 
1276
1281
  /**