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

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.0",
3
+ "version": "2.0.0-rc.1.0.2",
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.0 <2.0.0-rc.1.1.0",
101
- "@fluidframework/container-definitions": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
102
- "@fluidframework/core-interfaces": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
103
- "@fluidframework/core-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
104
- "@fluidframework/datastore-definitions": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
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",
105
105
  "@fluidframework/protocol-definitions": "^3.1.0",
106
- "@fluidframework/runtime-definitions": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
107
- "@fluidframework/runtime-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
108
- "@fluidframework/shared-object-base": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
109
- "@fluidframework/telemetry-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.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"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@arethetypeswrong/cli": "^0.13.3",
113
- "@fluid-private/stochastic-test-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
114
- "@fluid-private/test-pairwise-generator": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
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",
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.0 <2.0.0-rc.1.1.0",
122
- "@fluidframework/test-runtime-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.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",
123
123
  "@microsoft/api-extractor": "^7.38.3",
124
124
  "@types/diff": "^3.5.1",
125
125
  "@types/mocha": "^9.1.1",
package/src/client.ts CHANGED
@@ -164,6 +164,10 @@ export class Client extends TypedEventEmitter<IClientEvents> {
164
164
  * @param count - The number segment groups to get peek from the tail of the queue. Default 1.
165
165
  */
166
166
  // eslint-disable-next-line import/no-deprecated
167
+ public peekPendingSegmentGroups(): SegmentGroup | undefined;
168
+ // eslint-disable-next-line import/no-deprecated
169
+ public peekPendingSegmentGroups(count: number): SegmentGroup | SegmentGroup[] | undefined;
170
+ // eslint-disable-next-line import/no-deprecated
167
171
  public peekPendingSegmentGroups(count: number = 1): SegmentGroup | SegmentGroup[] | undefined {
168
172
  const pending = this._mergeTree.pendingSegments;
169
173
  let node = pending?.last;
@@ -746,10 +750,9 @@ export class Client extends TypedEventEmitter<IClientEvents> {
746
750
  for (const segment of segmentGroup.segments.sort((a, b) =>
747
751
  a.ordinal < b.ordinal ? -1 : 1,
748
752
  )) {
749
- const segmentSegGroup = segment.segmentGroups.dequeue();
750
753
  assert(
751
- segmentGroup === segmentSegGroup,
752
- 0x035 /* "Segment group not at head of segment pending queue" */,
754
+ segment.segmentGroups.remove?.(segmentGroup) === true,
755
+ 0x035 /* "Segment group not in segment pending queue" */,
753
756
  );
754
757
  assert(
755
758
  segmentGroup.localSeq !== undefined,
@@ -38,6 +38,16 @@ export class SegmentGroupCollection {
38
38
  return this.segmentGroups.shift()?.data;
39
39
  }
40
40
 
41
+ // eslint-disable-next-line import/no-deprecated
42
+ public remove?(segmentGroup: SegmentGroup): boolean {
43
+ const found = this.segmentGroups.find((v) => v.data === segmentGroup);
44
+ if (found === undefined) {
45
+ return false;
46
+ }
47
+ this.segmentGroups.remove(found);
48
+ return true;
49
+ }
50
+
41
51
  // eslint-disable-next-line import/no-deprecated
42
52
  public pop?(): SegmentGroup | undefined {
43
53
  return this.segmentGroups.pop ? this.segmentGroups.pop()?.data : undefined;