@fluidframework/sequence 2.0.0-internal.5.4.0 → 2.0.0-internal.6.1.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 +24 -0
- package/dist/defaultMap.js +3 -5
- package/dist/defaultMap.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/intervalCollection.d.ts +0 -9
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +33 -68
- package/dist/intervalCollection.js.map +1 -1
- package/dist/intervalIndex/intervalIndexUtils.js +2 -3
- package/dist/intervalIndex/intervalIndexUtils.js.map +1 -1
- package/dist/intervalTree.d.ts +1 -9
- package/dist/intervalTree.d.ts.map +1 -1
- package/dist/intervalTree.js +2 -11
- package/dist/intervalTree.js.map +1 -1
- package/dist/intervals/interval.d.ts +4 -4
- package/dist/intervals/interval.js +7 -9
- package/dist/intervals/interval.js.map +1 -1
- package/dist/intervals/sequenceInterval.d.ts +4 -4
- package/dist/intervals/sequenceInterval.js +6 -8
- package/dist/intervals/sequenceInterval.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/revertibles.js +6 -20
- package/dist/revertibles.js.map +1 -1
- package/dist/sequence.d.ts +6 -0
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +28 -35
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceDeltaEvent.js +1 -2
- package/dist/sequenceDeltaEvent.js.map +1 -1
- package/dist/sharedSequence.d.ts.map +1 -1
- package/dist/sharedSequence.js +1 -4
- package/dist/sharedSequence.js.map +1 -1
- package/dist/sharedString.d.ts.map +1 -1
- package/dist/sharedString.js +9 -29
- package/dist/sharedString.js.map +1 -1
- package/lib/defaultMap.js +3 -5
- package/lib/defaultMap.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/intervalCollection.d.ts +0 -9
- package/lib/intervalCollection.d.ts.map +1 -1
- package/lib/intervalCollection.js +33 -68
- package/lib/intervalCollection.js.map +1 -1
- package/lib/intervalIndex/intervalIndexUtils.js +2 -3
- package/lib/intervalIndex/intervalIndexUtils.js.map +1 -1
- package/lib/intervalTree.d.ts +1 -9
- package/lib/intervalTree.d.ts.map +1 -1
- package/lib/intervalTree.js +2 -11
- package/lib/intervalTree.js.map +1 -1
- package/lib/intervals/interval.d.ts +4 -4
- package/lib/intervals/interval.js +7 -9
- package/lib/intervals/interval.js.map +1 -1
- package/lib/intervals/sequenceInterval.d.ts +4 -4
- package/lib/intervals/sequenceInterval.js +6 -8
- package/lib/intervals/sequenceInterval.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/revertibles.js +6 -20
- package/lib/revertibles.js.map +1 -1
- package/lib/sequence.d.ts +6 -0
- package/lib/sequence.d.ts.map +1 -1
- package/lib/sequence.js +28 -35
- package/lib/sequence.js.map +1 -1
- package/lib/sequenceDeltaEvent.js +1 -2
- package/lib/sequenceDeltaEvent.js.map +1 -1
- package/lib/sharedSequence.d.ts.map +1 -1
- package/lib/sharedSequence.js +1 -4
- package/lib/sharedSequence.js.map +1 -1
- package/lib/sharedString.d.ts.map +1 -1
- package/lib/sharedString.js +9 -29
- package/lib/sharedString.js.map +1 -1
- package/package.json +19 -19
- package/src/index.ts +0 -1
- package/src/intervalCollection.ts +0 -14
- package/src/intervalTree.ts +2 -21
- package/src/intervals/interval.ts +4 -4
- package/src/intervals/sequenceInterval.ts +4 -4
- package/src/packageVersion.ts +1 -1
- package/src/sequence.ts +17 -27
- package/src/sharedSequence.ts +1 -4
- package/src/sharedString.ts +6 -25
|
@@ -2,17 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
6
|
-
var t = {};
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
10
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
11
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
12
|
-
t[p[i]] = s[p[i]];
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
16
5
|
/* eslint-disable no-bitwise */
|
|
17
6
|
import { assert, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
18
7
|
import { UsageError } from "@fluidframework/container-utils";
|
|
@@ -32,7 +21,7 @@ function decompressInterval(interval, label) {
|
|
|
32
21
|
end: interval[1],
|
|
33
22
|
sequenceNumber: interval[2],
|
|
34
23
|
intervalType: interval[3],
|
|
35
|
-
properties:
|
|
24
|
+
properties: { ...interval[4], [reservedRangeLabelsKey]: [label] },
|
|
36
25
|
stickiness: interval[5],
|
|
37
26
|
};
|
|
38
27
|
}
|
|
@@ -47,7 +36,9 @@ function compressInterval(interval) {
|
|
|
47
36
|
end,
|
|
48
37
|
sequenceNumber,
|
|
49
38
|
intervalType,
|
|
50
|
-
|
|
39
|
+
// remove the `referenceRangeLabels` property as it is already stored
|
|
40
|
+
// in the `label` field of the summary
|
|
41
|
+
{ ...properties, [reservedRangeLabelsKey]: undefined },
|
|
51
42
|
];
|
|
52
43
|
if (interval.stickiness !== undefined && interval.stickiness !== IntervalStickiness.END) {
|
|
53
44
|
base.push(interval.stickiness);
|
|
@@ -92,8 +83,7 @@ export class LocalIntervalCollection {
|
|
|
92
83
|
* @returns The interval's existing or newly created id
|
|
93
84
|
*/
|
|
94
85
|
ensureSerializedId(serializedInterval) {
|
|
95
|
-
|
|
96
|
-
let id = (_a = serializedInterval.properties) === null || _a === void 0 ? void 0 : _a[reservedIntervalIdKey];
|
|
86
|
+
let id = serializedInterval.properties?.[reservedIntervalIdKey];
|
|
97
87
|
if (id === undefined) {
|
|
98
88
|
// Back-compat: 0.39 and earlier did not have IDs on intervals. If an interval from such a client
|
|
99
89
|
// comes over the wire, create a non-unique one based on start/end.
|
|
@@ -132,7 +122,6 @@ export class LocalIntervalCollection {
|
|
|
132
122
|
}
|
|
133
123
|
addInterval(start, end, intervalType, props, op, stickiness = IntervalStickiness.END) {
|
|
134
124
|
var _a;
|
|
135
|
-
var _b;
|
|
136
125
|
const interval = this.createInterval(start, end, intervalType, op, stickiness);
|
|
137
126
|
if (interval) {
|
|
138
127
|
if (!interval.properties) {
|
|
@@ -148,7 +137,7 @@ export class LocalIntervalCollection {
|
|
|
148
137
|
}
|
|
149
138
|
interval.addProperties(props);
|
|
150
139
|
}
|
|
151
|
-
(_a =
|
|
140
|
+
(_a = interval.properties)[reservedIntervalIdKey] ?? (_a[reservedIntervalIdKey] = uuid());
|
|
152
141
|
this.add(interval);
|
|
153
142
|
}
|
|
154
143
|
return interval;
|
|
@@ -208,12 +197,11 @@ export class LocalIntervalCollection {
|
|
|
208
197
|
this.removeIntervalFromIndexes(interval);
|
|
209
198
|
}
|
|
210
199
|
}, () => {
|
|
211
|
-
var _a;
|
|
212
200
|
assert(previousInterval !== undefined, 0x3fa /* Invalid interleaving of before/after slide */);
|
|
213
201
|
pendingChanges--;
|
|
214
202
|
if (pendingChanges === 0) {
|
|
215
203
|
this.addIntervalToIndexes(interval);
|
|
216
|
-
|
|
204
|
+
this.onPositionChange?.(interval, previousInterval);
|
|
217
205
|
previousInterval = undefined;
|
|
218
206
|
}
|
|
219
207
|
});
|
|
@@ -280,7 +268,7 @@ export function makeOpsMap() {
|
|
|
280
268
|
const rebase = (collection, op, localOpMetadata) => {
|
|
281
269
|
const { localSeq } = localOpMetadata;
|
|
282
270
|
const rebasedValue = collection.rebaseLocalInterval(op.opName, op.value, localSeq);
|
|
283
|
-
const rebasedOp =
|
|
271
|
+
const rebasedOp = { ...op, value: rebasedValue };
|
|
284
272
|
return { rebasedOp, rebasedLocalOpMetadata: localOpMetadata };
|
|
285
273
|
};
|
|
286
274
|
return new Map([
|
|
@@ -374,25 +362,23 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
374
362
|
* {@inheritdoc IIntervalCollection.attachIndex}
|
|
375
363
|
*/
|
|
376
364
|
attachIndex(index) {
|
|
377
|
-
var _a;
|
|
378
365
|
if (!this.attached) {
|
|
379
366
|
throw new LoggingError("The local interval collection must exist");
|
|
380
367
|
}
|
|
381
368
|
for (const interval of this) {
|
|
382
369
|
index.add(interval);
|
|
383
370
|
}
|
|
384
|
-
|
|
371
|
+
this.localCollection?.appendIndex(index);
|
|
385
372
|
}
|
|
386
373
|
/**
|
|
387
374
|
* {@inheritdoc IIntervalCollection.detachIndex}
|
|
388
375
|
*/
|
|
389
376
|
detachIndex(index) {
|
|
390
|
-
var _a;
|
|
391
377
|
if (!this.attached) {
|
|
392
378
|
throw new LoggingError("The local interval collection must exist");
|
|
393
379
|
}
|
|
394
380
|
// Avoid removing intervals if the index does not exist
|
|
395
|
-
if (!
|
|
381
|
+
if (!this.localCollection?.removeIndex(index)) {
|
|
396
382
|
return false;
|
|
397
383
|
}
|
|
398
384
|
for (const interval of this) {
|
|
@@ -401,7 +387,6 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
401
387
|
return true;
|
|
402
388
|
}
|
|
403
389
|
rebasePositionWithSegmentSlide(pos, seqNumberFrom, localSeq) {
|
|
404
|
-
var _a;
|
|
405
390
|
if (!this.client) {
|
|
406
391
|
throw new LoggingError("mergeTree client must exist");
|
|
407
392
|
}
|
|
@@ -412,7 +397,7 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
412
397
|
}, localSeq);
|
|
413
398
|
// if segment is undefined, it slid off the string
|
|
414
399
|
assert(segment !== undefined, 0x54e /* No segment found */);
|
|
415
|
-
const segoff =
|
|
400
|
+
const segoff = getSlideToSegoff({ segment, offset }) ?? segment;
|
|
416
401
|
// case happens when rebasing op, but concurrently entire string has been deleted
|
|
417
402
|
if (segoff.segment === undefined || segoff.offset === undefined) {
|
|
418
403
|
return DetachedReferencePosition;
|
|
@@ -424,7 +409,7 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
424
409
|
assert(this.client !== undefined, 0x550 /* Client should be defined when computing rebased position */);
|
|
425
410
|
const original = this.localSeqToSerializedInterval.get(localSeq);
|
|
426
411
|
assert(original !== undefined, 0x551 /* Failed to store pending serialized interval info for this localSeq. */);
|
|
427
|
-
const rebased =
|
|
412
|
+
const rebased = { ...original };
|
|
428
413
|
const { start, end, sequenceNumber } = original;
|
|
429
414
|
if (start !== undefined) {
|
|
430
415
|
rebased.start = this.rebasePositionWithSegmentSlide(start, sequenceNumber, localSeq);
|
|
@@ -506,7 +491,6 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
506
491
|
* {@inheritdoc IIntervalCollection.add}
|
|
507
492
|
*/
|
|
508
493
|
add(start, end, intervalType, props, stickiness = IntervalStickiness.END) {
|
|
509
|
-
var _a, _b;
|
|
510
494
|
if (!this.localCollection) {
|
|
511
495
|
throw new LoggingError("attach must be called prior to adding intervals");
|
|
512
496
|
}
|
|
@@ -522,7 +506,7 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
522
506
|
end,
|
|
523
507
|
intervalType,
|
|
524
508
|
properties: interval.properties,
|
|
525
|
-
sequenceNumber:
|
|
509
|
+
sequenceNumber: this.client?.getCurrentSeq() ?? 0,
|
|
526
510
|
start,
|
|
527
511
|
stickiness,
|
|
528
512
|
};
|
|
@@ -654,9 +638,8 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
654
638
|
entries.push(serializedInterval);
|
|
655
639
|
}
|
|
656
640
|
removePendingChange(serializedInterval) {
|
|
657
|
-
var _a;
|
|
658
641
|
// Change ops always have an ID.
|
|
659
|
-
const id =
|
|
642
|
+
const id = serializedInterval.properties?.[reservedIntervalIdKey];
|
|
660
643
|
if (serializedInterval.start !== undefined) {
|
|
661
644
|
this.removePendingChangeHelper(id, this.pendingChangesStart, serializedInterval);
|
|
662
645
|
}
|
|
@@ -671,8 +654,8 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
671
654
|
if (entries.length === 0) {
|
|
672
655
|
pendingChanges.delete(id);
|
|
673
656
|
}
|
|
674
|
-
if (
|
|
675
|
-
|
|
657
|
+
if (pendingChange?.start !== serializedInterval.start ||
|
|
658
|
+
pendingChange?.end !== serializedInterval.end) {
|
|
676
659
|
throw new LoggingError("Mismatch in pending changes");
|
|
677
660
|
}
|
|
678
661
|
}
|
|
@@ -687,20 +670,19 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
687
670
|
}
|
|
688
671
|
/** @internal */
|
|
689
672
|
ackChange(serializedInterval, local, op, localOpMetadata) {
|
|
690
|
-
var _a, _b, _c, _d;
|
|
691
673
|
if (!this.localCollection) {
|
|
692
674
|
throw new LoggingError("Attach must be called before accessing intervals");
|
|
693
675
|
}
|
|
694
676
|
if (local) {
|
|
695
677
|
assert(localOpMetadata !== undefined, 0x552 /* op metadata should be defined for local op */);
|
|
696
|
-
this.localSeqToSerializedInterval.delete(localOpMetadata
|
|
678
|
+
this.localSeqToSerializedInterval.delete(localOpMetadata?.localSeq);
|
|
697
679
|
// This is an ack from the server. Remove the pending change.
|
|
698
680
|
this.removePendingChange(serializedInterval);
|
|
699
681
|
}
|
|
700
682
|
// Note that the ID is in the property bag only to allow us to find the interval.
|
|
701
683
|
// This API cannot change the ID, and writing to the ID property will result in an exception. So we
|
|
702
684
|
// strip it out of the properties here.
|
|
703
|
-
const
|
|
685
|
+
const { [reservedIntervalIdKey]: id, ...newProps } = serializedInterval.properties ?? {};
|
|
704
686
|
assert(id !== undefined, 0x3fe /* id must exist on the interval */);
|
|
705
687
|
const interval = this.getIntervalById(id);
|
|
706
688
|
if (!interval) {
|
|
@@ -709,9 +691,9 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
709
691
|
}
|
|
710
692
|
if (local) {
|
|
711
693
|
// Let the propertyManager prune its pending change-properties set.
|
|
712
|
-
|
|
694
|
+
interval.propertyManager?.ackPendingProperties({
|
|
713
695
|
type: MergeTreeDeltaType.ANNOTATE,
|
|
714
|
-
props:
|
|
696
|
+
props: serializedInterval.properties ?? {},
|
|
715
697
|
});
|
|
716
698
|
this.ackInterval(interval, op);
|
|
717
699
|
}
|
|
@@ -732,7 +714,7 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
732
714
|
// If changeInterval gives us a new interval, work with that one. Otherwise keep working with
|
|
733
715
|
// the one we originally found in the tree.
|
|
734
716
|
newInterval =
|
|
735
|
-
|
|
717
|
+
this.localCollection.changeInterval(interval, start, end, op) ?? interval;
|
|
736
718
|
}
|
|
737
719
|
const deltaProps = newInterval.addProperties(newProps, true, op.sequenceNumber);
|
|
738
720
|
if (this.onDeserialize) {
|
|
@@ -747,18 +729,6 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
747
729
|
}
|
|
748
730
|
}
|
|
749
731
|
}
|
|
750
|
-
/**
|
|
751
|
-
* @deprecated - This functionality was useful when adding two intervals at the same start/end positions resulted
|
|
752
|
-
* in a conflict. This is no longer the case (as of PR#6407), as interval collections support multiple intervals
|
|
753
|
-
* at the same location and gives each interval a unique id.
|
|
754
|
-
*
|
|
755
|
-
* As such, the conflict resolver is never invoked and unnecessary. This API will be removed in an upcoming release.
|
|
756
|
-
*/
|
|
757
|
-
addConflictResolver(_) {
|
|
758
|
-
if (!this.localCollection) {
|
|
759
|
-
throw new LoggingError("attachSequence must be called");
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
732
|
/**
|
|
763
733
|
* {@inheritdoc IIntervalCollection.attachDeserializer}
|
|
764
734
|
*/
|
|
@@ -782,7 +752,6 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
782
752
|
* @internal
|
|
783
753
|
*/
|
|
784
754
|
rebaseLocalInterval(opName, serializedInterval, localSeq) {
|
|
785
|
-
var _a, _b, _c, _d, _e, _f;
|
|
786
755
|
if (!this.client) {
|
|
787
756
|
// If there's no associated mergeTree client, the originally submitted op is still correct.
|
|
788
757
|
return serializedInterval;
|
|
@@ -791,14 +760,14 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
791
760
|
throw new LoggingError("attachSequence must be called");
|
|
792
761
|
}
|
|
793
762
|
const { intervalType, properties } = serializedInterval;
|
|
794
|
-
const { start: startRebased, end: endRebased } =
|
|
795
|
-
const intervalId = properties
|
|
796
|
-
const localInterval =
|
|
763
|
+
const { start: startRebased, end: endRebased } = this.localSeqToRebasedInterval.get(localSeq) ?? this.computeRebasedPositions(localSeq);
|
|
764
|
+
const intervalId = properties?.[reservedIntervalIdKey];
|
|
765
|
+
const localInterval = this.localCollection?.idIntervalIndex.getIntervalById(intervalId);
|
|
797
766
|
const rebased = {
|
|
798
767
|
start: startRebased,
|
|
799
768
|
end: endRebased,
|
|
800
769
|
intervalType,
|
|
801
|
-
sequenceNumber:
|
|
770
|
+
sequenceNumber: this.client?.getCurrentSeq() ?? 0,
|
|
802
771
|
properties,
|
|
803
772
|
};
|
|
804
773
|
if (opName === "change" &&
|
|
@@ -810,7 +779,7 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
810
779
|
if (startRebased === DetachedReferencePosition ||
|
|
811
780
|
endRebased === DetachedReferencePosition) {
|
|
812
781
|
if (localInterval) {
|
|
813
|
-
|
|
782
|
+
this.localCollection?.removeExistingInterval(localInterval);
|
|
814
783
|
}
|
|
815
784
|
return undefined;
|
|
816
785
|
}
|
|
@@ -819,17 +788,16 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
819
788
|
assert(localInterval instanceof SequenceInterval, 0x3a0 /* localInterval must be `SequenceInterval` when used with client */);
|
|
820
789
|
// The rebased op may place this interval's endpoints on different segments. Calling `changeInterval` here
|
|
821
790
|
// updates the local client's state to be consistent with the emitted op.
|
|
822
|
-
|
|
791
|
+
this.localCollection?.changeInterval(localInterval, startRebased, endRebased, undefined, localSeq);
|
|
823
792
|
}
|
|
824
793
|
return rebased;
|
|
825
794
|
}
|
|
826
795
|
getSlideToSegment(lref) {
|
|
827
|
-
var _a, _b;
|
|
828
796
|
if (!this.client) {
|
|
829
797
|
throw new LoggingError("client does not exist");
|
|
830
798
|
}
|
|
831
799
|
const segoff = { segment: lref.getSegment(), offset: lref.getOffset() };
|
|
832
|
-
if (
|
|
800
|
+
if (segoff.segment?.localRefs?.has(lref) !== true) {
|
|
833
801
|
return undefined;
|
|
834
802
|
}
|
|
835
803
|
const newSegoff = getSlideToSegoff(segoff);
|
|
@@ -845,7 +813,6 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
845
813
|
lref.refType = refType;
|
|
846
814
|
}
|
|
847
815
|
ackInterval(interval, op) {
|
|
848
|
-
var _a, _b;
|
|
849
816
|
// Only SequenceIntervals need potential sliding
|
|
850
817
|
if (!(interval instanceof SequenceInterval)) {
|
|
851
818
|
return;
|
|
@@ -890,7 +857,7 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
890
857
|
// remove and rebuild start interval as transient for event
|
|
891
858
|
this.client.removeLocalReferencePosition(oldInterval.start);
|
|
892
859
|
oldInterval.start.refType = ReferenceType.Transient;
|
|
893
|
-
|
|
860
|
+
oldSeg?.localRefs?.addLocalRef(oldInterval.start, oldInterval.start.getOffset());
|
|
894
861
|
}
|
|
895
862
|
if (needsEndUpdate) {
|
|
896
863
|
const props = interval.end.properties;
|
|
@@ -902,7 +869,7 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
902
869
|
const oldSeg = oldInterval.end.getSegment();
|
|
903
870
|
this.client.removeLocalReferencePosition(oldInterval.end);
|
|
904
871
|
oldInterval.end.refType = ReferenceType.Transient;
|
|
905
|
-
|
|
872
|
+
oldSeg?.localRefs?.addLocalRef(oldInterval.end, oldInterval.end.getOffset());
|
|
906
873
|
}
|
|
907
874
|
this.localCollection.add(interval);
|
|
908
875
|
this.emitChange(interval, oldInterval, true, true, op);
|
|
@@ -910,11 +877,10 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
910
877
|
}
|
|
911
878
|
/** @internal */
|
|
912
879
|
ackAdd(serializedInterval, local, op, localOpMetadata) {
|
|
913
|
-
var _a;
|
|
914
880
|
if (local) {
|
|
915
881
|
assert(localOpMetadata !== undefined, 0x553 /* op metadata should be defined for local op */);
|
|
916
882
|
this.localSeqToSerializedInterval.delete(localOpMetadata.localSeq);
|
|
917
|
-
const id =
|
|
883
|
+
const id = serializedInterval.properties?.[reservedIntervalIdKey];
|
|
918
884
|
const localInterval = this.getIntervalById(id);
|
|
919
885
|
if (localInterval) {
|
|
920
886
|
this.ackInterval(localInterval, op);
|
|
@@ -1068,9 +1034,8 @@ export class IntervalCollection extends TypedEventEmitter {
|
|
|
1068
1034
|
* endpoint is a part of.
|
|
1069
1035
|
*/
|
|
1070
1036
|
export function intervalLocatorFromEndpoint(potentialEndpoint) {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
return interval && (collectionNameArray === null || collectionNameArray === void 0 ? void 0 : collectionNameArray.length) === 1
|
|
1037
|
+
const { interval, [reservedRangeLabelsKey]: collectionNameArray } = potentialEndpoint.properties ?? {};
|
|
1038
|
+
return interval && collectionNameArray?.length === 1
|
|
1074
1039
|
? { label: collectionNameArray[0], interval }
|
|
1075
1040
|
: undefined;
|
|
1076
1041
|
}
|