@fluidframework/sequence 2.50.0-345060 → 2.51.0-347100
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 +4 -0
- package/dist/intervalCollection.d.ts +4 -5
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +94 -95
- package/dist/intervalCollection.js.map +1 -1
- package/dist/intervalCollectionMapInterfaces.d.ts +1 -11
- package/dist/intervalCollectionMapInterfaces.d.ts.map +1 -1
- package/dist/intervalCollectionMapInterfaces.js.map +1 -1
- package/dist/intervals/sequenceInterval.d.ts +7 -3
- package/dist/intervals/sequenceInterval.d.ts.map +1 -1
- package/dist/intervals/sequenceInterval.js +72 -30
- 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/lib/intervalCollection.d.ts +4 -5
- package/lib/intervalCollection.d.ts.map +1 -1
- package/lib/intervalCollection.js +94 -95
- package/lib/intervalCollection.js.map +1 -1
- package/lib/intervalCollectionMapInterfaces.d.ts +1 -11
- package/lib/intervalCollectionMapInterfaces.d.ts.map +1 -1
- package/lib/intervalCollectionMapInterfaces.js.map +1 -1
- package/lib/intervals/sequenceInterval.d.ts +7 -3
- package/lib/intervals/sequenceInterval.d.ts.map +1 -1
- package/lib/intervals/sequenceInterval.js +74 -32
- 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/package.json +18 -19
- package/src/intervalCollection.ts +106 -103
- package/src/intervalCollectionMapInterfaces.ts +1 -9
- package/src/intervals/sequenceInterval.ts +88 -32
- package/src/packageVersion.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -41,7 +41,7 @@ export declare class LocalIntervalCollection {
|
|
|
41
41
|
appendIndex(index: SequenceIntervalIndex): void;
|
|
42
42
|
removeIndex(index: SequenceIntervalIndex): boolean;
|
|
43
43
|
removeExistingInterval(interval: SequenceIntervalClass): void;
|
|
44
|
-
addInterval(id: string, start: SequencePlace, end: SequencePlace, props?: PropertySet, op?: ISequencedDocumentMessage
|
|
44
|
+
addInterval(id: string, start: SequencePlace, end: SequencePlace, props?: PropertySet, op?: ISequencedDocumentMessage): SequenceIntervalClass;
|
|
45
45
|
private linkEndpointsToInterval;
|
|
46
46
|
private addIntervalToIndexes;
|
|
47
47
|
add(interval: SequenceIntervalClass): void;
|
|
@@ -351,12 +351,11 @@ export declare class IntervalCollection extends TypedEventEmitter<ISequenceInter
|
|
|
351
351
|
/**
|
|
352
352
|
* {@inheritdoc IIntervalCollection.add}
|
|
353
353
|
*/
|
|
354
|
-
add({ id, start, end, props,
|
|
354
|
+
add({ id, start, end, props, }: {
|
|
355
355
|
id?: string;
|
|
356
356
|
start: SequencePlace;
|
|
357
357
|
end: SequencePlace;
|
|
358
358
|
props?: PropertySet;
|
|
359
|
-
rollback?: boolean;
|
|
360
359
|
}): SequenceIntervalClass;
|
|
361
360
|
private deleteExistingInterval;
|
|
362
361
|
/**
|
|
@@ -374,7 +373,7 @@ export declare class IntervalCollection extends TypedEventEmitter<ISequenceInter
|
|
|
374
373
|
}): SequenceIntervalClass | undefined;
|
|
375
374
|
private get isCollaborating();
|
|
376
375
|
private hasPendingEndpointChanges;
|
|
377
|
-
ackChange(serializedInterval: SerializedIntervalDelta, local: boolean, op: ISequencedDocumentMessage):
|
|
376
|
+
ackChange(serializedInterval: SerializedIntervalDelta, local: boolean, op: ISequencedDocumentMessage, localOpMetadata: IntervalChangeLocalMetadata | undefined): SequenceIntervalClass | undefined;
|
|
378
377
|
/**
|
|
379
378
|
* {@inheritdoc IIntervalCollection.attachDeserializer}
|
|
380
379
|
*/
|
|
@@ -388,7 +387,7 @@ export declare class IntervalCollection extends TypedEventEmitter<ISequenceInter
|
|
|
388
387
|
rebaseLocalInterval(original: SerializedIntervalDelta, localOpMetadata: IntervalAddLocalMetadata | IntervalChangeLocalMetadata, squash: boolean): SerializedIntervalDelta | undefined;
|
|
389
388
|
private getSlideToSegment;
|
|
390
389
|
private ackInterval;
|
|
391
|
-
ackAdd(serializedInterval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage, localOpMetadata: IntervalAddLocalMetadata | undefined): SequenceIntervalClass
|
|
390
|
+
ackAdd(serializedInterval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage, localOpMetadata: IntervalAddLocalMetadata | undefined): SequenceIntervalClass;
|
|
392
391
|
ackDelete(serializedInterval: SerializedIntervalDelta, local: boolean, op: ISequencedDocumentMessage): void;
|
|
393
392
|
serializeInternal(version: "1" | "2"): ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2;
|
|
394
393
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalCollection.d.ts","sourceRoot":"","sources":["../src/intervalCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAOzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EACN,MAAM,EAEN,sBAAsB,EACtB,WAAW,EAKX,IAAI,EACJ,aAAa,EAKb,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EAEN,eAAe,EACf,KAAK,qCAAqC,EAC1C,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAIN,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,kCAAkC,EACvC,KAAK,qBAAqB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,4BAA4B,EAC5B,mBAAmB,EAGnB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EAIvB,MAAM,sBAAsB,CAAC;AAE9B,MA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GAAG,GAAG,GAAG,GAChB,+BAA+B,GAAG,+BAA+B;IAQpE;;OAEG;IACI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,0BAA0B;IAKtD;;OAEG;IACI,sCAAsC,CAC5C,aAAa,EAAE,MAAM,GACnB,0BAA0B;IAK7B;;OAEG;IACI,uCAAuC,CAC7C,aAAa,EAAE,MAAM,GACnB,0BAA0B;IAK7B;;OAEG;IACI,oCAAoC,CAC1C,WAAW,EAAE,MAAM,GACjB,0BAA0B;IAK7B;;OAEG;IACI,qCAAqC,CAC3C,WAAW,EAAE,MAAM,GACjB,0BAA0B;IAK7B;;OAEG;IACI,sBAAsB,CAC5B,OAAO,EAAE,qBAAqB,EAAE,EAChC,eAAe,EAAE,OAAO,EACxB,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM;IAcb;;OAEG;IACI,wBAAwB,CAC9B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GACjB,gBAAgB,EAAE;IAWrB;;OAEG;IACI,GAAG,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI;IAUxD;;OAEG;IACI,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAQlE;;OAEG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;CAO9D;AASD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAC1C,iBAAiB,EAAE,sBAAsB,GACvC,eAAe,GAAG,SAAS,CAM7B"}
|
|
@@ -104,7 +104,7 @@ class LocalIntervalCollection {
|
|
|
104
104
|
this.removeIntervalFromIndexes(interval);
|
|
105
105
|
this.removeIntervalListeners(interval);
|
|
106
106
|
}
|
|
107
|
-
addInterval(id, start, end, props, op
|
|
107
|
+
addInterval(id, start, end, props, op) {
|
|
108
108
|
// This check is intended to prevent scenarios where a random interval is created and then
|
|
109
109
|
// inserted into a collection. The aim is to ensure that the collection is created first
|
|
110
110
|
// then the user can create/add intervals based on the collection
|
|
@@ -112,7 +112,7 @@ class LocalIntervalCollection {
|
|
|
112
112
|
props[internal_2.reservedRangeLabelsKey][0] !== this.label) {
|
|
113
113
|
throw new internal_3.LoggingError("Adding an interval that belongs to another interval collection is not permitted");
|
|
114
114
|
}
|
|
115
|
-
const interval = (0, index_js_2.createSequenceInterval)(this.label, id, start, end, this.client, index_js_2.IntervalType.SlideOnRemove, op, undefined, this.options.mergeTreeReferencesCanSlideToEndpoint, props,
|
|
115
|
+
const interval = (0, index_js_2.createSequenceInterval)(this.label, id, start, end, this.client, index_js_2.IntervalType.SlideOnRemove, op, undefined, this.options.mergeTreeReferencesCanSlideToEndpoint, props, false);
|
|
116
116
|
this.add(interval);
|
|
117
117
|
return interval;
|
|
118
118
|
}
|
|
@@ -213,12 +213,12 @@ function removeMetadataFromPendingChanges(localOpMetadataNode) {
|
|
|
213
213
|
}
|
|
214
214
|
function clearEmptyPendingEntry(pendingChanges, id) {
|
|
215
215
|
const pending = pendingChanges[id];
|
|
216
|
-
|
|
217
|
-
if (pending.local.empty) {
|
|
216
|
+
if (pending !== undefined && pending.local.empty) {
|
|
218
217
|
(0, internal_1.assert)(pending.endpointChanges?.empty !== false, 0xbc0 /* endpointChanges must be empty if not pending changes */);
|
|
219
218
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
220
219
|
delete pendingChanges[id];
|
|
221
220
|
}
|
|
221
|
+
return pending;
|
|
222
222
|
}
|
|
223
223
|
function hasEndpointChanges(serialized) {
|
|
224
224
|
return serialized.start !== undefined && serialized.end !== undefined;
|
|
@@ -234,15 +234,15 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
234
234
|
super();
|
|
235
235
|
this.options = options;
|
|
236
236
|
this.pending = {};
|
|
237
|
-
this.submitDelta = (op, md) => {
|
|
237
|
+
this.submitDelta = (op, md, consensus) => {
|
|
238
238
|
const { id } = (0, index_js_2.getSerializedProperties)(op.value);
|
|
239
239
|
const pending = (this.pending[id] ??= {
|
|
240
240
|
local: new internal_1.DoublyLinkedList(),
|
|
241
|
+
consensus,
|
|
241
242
|
});
|
|
242
243
|
if (md.type === "add" || (md.type === "change" && hasEndpointChanges(op.value))) {
|
|
243
244
|
const endpointChanges = (pending.endpointChanges ??= new internal_1.DoublyLinkedList());
|
|
244
245
|
md.endpointChangesNode = endpointChanges.push(md).last;
|
|
245
|
-
md.rebased = undefined;
|
|
246
246
|
}
|
|
247
247
|
submitDelta(op, pending.local.push(md).last);
|
|
248
248
|
};
|
|
@@ -282,57 +282,60 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
282
282
|
const localOpMetadata = removeMetadataFromPendingChanges(maybeMetadata);
|
|
283
283
|
const { value } = op;
|
|
284
284
|
const { id, properties } = (0, index_js_2.getSerializedProperties)(value);
|
|
285
|
-
const
|
|
285
|
+
const pending = clearEmptyPendingEntry(this.pending, id);
|
|
286
|
+
const previous = pending?.local.empty
|
|
287
|
+
? pending.consensus
|
|
288
|
+
: pending?.local.last?.data.interval;
|
|
289
|
+
const { type, interval } = localOpMetadata;
|
|
286
290
|
switch (type) {
|
|
287
291
|
case "add": {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
this.deleteExistingInterval({ interval, local: true, rollback: true });
|
|
291
|
-
}
|
|
292
|
+
this.deleteExistingInterval({ interval, local: true, rollback: true });
|
|
293
|
+
interval.dispose();
|
|
292
294
|
break;
|
|
293
295
|
}
|
|
294
296
|
case "change": {
|
|
295
|
-
const
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
? toOptionalSequencePlace(previous.start, previous.startSide)
|
|
299
|
-
: undefined;
|
|
300
|
-
const end = endpointsChanged
|
|
301
|
-
? toOptionalSequencePlace(previous.end, previous.endSide)
|
|
297
|
+
const changeProperties = Object.keys(properties).length > 0;
|
|
298
|
+
const deltaProps = changeProperties
|
|
299
|
+
? interval.changeProperties(properties, undefined, true)
|
|
302
300
|
: undefined;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
301
|
+
if (localOpMetadata.endpointChangesNode !== undefined) {
|
|
302
|
+
if (previous !== undefined) {
|
|
303
|
+
this.localCollection?.removeExistingInterval(interval);
|
|
304
|
+
this.localCollection?.add(previous);
|
|
305
|
+
this.emitChange(previous, interval, true, true);
|
|
306
|
+
}
|
|
307
|
+
if (previous !== interval) {
|
|
308
|
+
interval.dispose();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (changeProperties) {
|
|
312
|
+
this.emit("propertyChanged", previous, deltaProps, true, undefined);
|
|
313
|
+
}
|
|
309
314
|
break;
|
|
310
315
|
}
|
|
311
316
|
case "delete": {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
props: Object.keys(properties).length > 0 ? properties : undefined,
|
|
318
|
-
rollback: true,
|
|
319
|
-
});
|
|
317
|
+
// a remote could delete the same interval, so it may not exist to re-add
|
|
318
|
+
if (previous !== undefined) {
|
|
319
|
+
this.localCollection?.add(previous);
|
|
320
|
+
this.emit("addInterval", previous, true, undefined);
|
|
321
|
+
}
|
|
320
322
|
break;
|
|
321
323
|
}
|
|
322
324
|
default:
|
|
323
325
|
(0, internal_1.unreachableCase)(type);
|
|
324
326
|
}
|
|
325
|
-
clearEmptyPendingEntry(this.pending, id);
|
|
326
327
|
}
|
|
327
328
|
process(op, local, message, maybeMetadata) {
|
|
328
329
|
const localOpMetadata = local
|
|
329
330
|
? removeMetadataFromPendingChanges(maybeMetadata)
|
|
330
331
|
: undefined;
|
|
331
332
|
const { opName, value } = op;
|
|
333
|
+
const { id } = (0, index_js_2.getSerializedProperties)(value);
|
|
332
334
|
(0, internal_1.assert)((local === false && localOpMetadata === undefined) || opName === localOpMetadata?.type, 0xbc1 /* must be same type */);
|
|
335
|
+
let newConsensus = localOpMetadata?.interval;
|
|
333
336
|
switch (opName) {
|
|
334
337
|
case "add": {
|
|
335
|
-
this.ackAdd(value, local, message,
|
|
338
|
+
newConsensus = this.ackAdd(value, local, message,
|
|
336
339
|
// this cast is safe because of the above assert which
|
|
337
340
|
// validates the op and metadata types match for local changes
|
|
338
341
|
localOpMetadata);
|
|
@@ -343,15 +346,17 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
343
346
|
break;
|
|
344
347
|
}
|
|
345
348
|
case "change": {
|
|
346
|
-
this.ackChange(value, local, message
|
|
349
|
+
newConsensus = this.ackChange(value, local, message, // this cast is safe because of the above assert which
|
|
350
|
+
// validates the op and metadata types match for local changes
|
|
351
|
+
localOpMetadata);
|
|
347
352
|
break;
|
|
348
353
|
}
|
|
349
354
|
default:
|
|
350
355
|
(0, internal_1.unreachableCase)(opName);
|
|
351
356
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
357
|
+
const pending = clearEmptyPendingEntry(this.pending, id);
|
|
358
|
+
if (pending !== undefined) {
|
|
359
|
+
pending.consensus = newConsensus;
|
|
355
360
|
}
|
|
356
361
|
}
|
|
357
362
|
resubmitMessage(op, maybeMetadata, squash) {
|
|
@@ -449,7 +454,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
449
454
|
for (const pending of Object.values(this.pending)) {
|
|
450
455
|
if (pending?.endpointChanges !== undefined) {
|
|
451
456
|
for (const local of pending.endpointChanges) {
|
|
452
|
-
local.data.
|
|
457
|
+
this.rebaseLocalInterval(local.data.interval.serialize(), local.data, squash);
|
|
453
458
|
}
|
|
454
459
|
}
|
|
455
460
|
}
|
|
@@ -512,7 +517,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
512
517
|
/**
|
|
513
518
|
* {@inheritdoc IIntervalCollection.add}
|
|
514
519
|
*/
|
|
515
|
-
add({ id, start, end, props,
|
|
520
|
+
add({ id, start, end, props, }) {
|
|
516
521
|
if (!this.localCollection) {
|
|
517
522
|
throw new internal_3.LoggingError("attach must be called prior to adding intervals");
|
|
518
523
|
}
|
|
@@ -523,7 +528,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
523
528
|
endSide !== undefined, 0x793 /* start and end cannot be undefined because they were not passed in as undefined */);
|
|
524
529
|
this.assertStickinessEnabled(start, end);
|
|
525
530
|
const intervalId = id ?? (0, uuid_1.v4)();
|
|
526
|
-
const interval = this.localCollection.addInterval(intervalId, toSequencePlace(startPos, startSide), toSequencePlace(endPos, endSide), props, undefined
|
|
531
|
+
const interval = this.localCollection.addInterval(intervalId, toSequencePlace(startPos, startSide), toSequencePlace(endPos, endSide), props, undefined);
|
|
527
532
|
if (interval) {
|
|
528
533
|
if (!this.isCollaborating) {
|
|
529
534
|
setSlideOnRemove(interval.start);
|
|
@@ -531,7 +536,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
531
536
|
}
|
|
532
537
|
const serializedInterval = interval.serialize();
|
|
533
538
|
const localSeq = this.getNextLocalSeq();
|
|
534
|
-
if (this.isCollaborating
|
|
539
|
+
if (this.isCollaborating) {
|
|
535
540
|
this.submitDelta({
|
|
536
541
|
opName: "add",
|
|
537
542
|
value: serializedInterval,
|
|
@@ -561,8 +566,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
561
566
|
}, {
|
|
562
567
|
type: "delete",
|
|
563
568
|
localSeq: this.getNextLocalSeq(),
|
|
564
|
-
|
|
565
|
-
});
|
|
569
|
+
}, interval);
|
|
566
570
|
}
|
|
567
571
|
else {
|
|
568
572
|
if (this.onDeserialize) {
|
|
@@ -579,7 +583,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
579
583
|
if (!this.localCollection) {
|
|
580
584
|
throw new internal_3.LoggingError("Attach must be called before accessing intervals");
|
|
581
585
|
}
|
|
582
|
-
const interval = this.
|
|
586
|
+
const interval = this.getIntervalById(id);
|
|
583
587
|
if (interval) {
|
|
584
588
|
this.deleteExistingInterval({ interval, local: true });
|
|
585
589
|
}
|
|
@@ -627,13 +631,12 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
627
631
|
const metadata = {
|
|
628
632
|
type: "change",
|
|
629
633
|
localSeq,
|
|
630
|
-
previous: interval.serialize(),
|
|
631
634
|
interval: newInterval ?? interval,
|
|
632
635
|
};
|
|
633
636
|
this.submitDelta({
|
|
634
637
|
opName: "change",
|
|
635
638
|
value: serializedInterval,
|
|
636
|
-
}, metadata);
|
|
639
|
+
}, metadata, interval);
|
|
637
640
|
}
|
|
638
641
|
if (deltaProps !== undefined) {
|
|
639
642
|
this.emit("propertyChanged", interval, deltaProps, true, undefined);
|
|
@@ -657,7 +660,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
657
660
|
hasPendingEndpointChanges(id) {
|
|
658
661
|
return this.pending[id]?.endpointChanges?.empty === false;
|
|
659
662
|
}
|
|
660
|
-
ackChange(serializedInterval, local, op) {
|
|
663
|
+
ackChange(serializedInterval, local, op, localOpMetadata) {
|
|
661
664
|
if (!this.localCollection) {
|
|
662
665
|
throw new internal_3.LoggingError("Attach must be called before accessing intervals");
|
|
663
666
|
}
|
|
@@ -666,44 +669,39 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
666
669
|
// strip it out of the properties here.
|
|
667
670
|
const { id, properties } = (0, index_js_2.getSerializedProperties)(serializedInterval);
|
|
668
671
|
(0, internal_1.assert)(id !== undefined, 0x3fe /* id must exist on the interval */);
|
|
669
|
-
const interval = this.getIntervalById(id);
|
|
670
|
-
if (!interval) {
|
|
671
|
-
// The interval has been removed locally; no-op.
|
|
672
|
-
return;
|
|
673
|
-
}
|
|
674
672
|
if (local) {
|
|
673
|
+
(0, internal_1.assert)(localOpMetadata !== undefined, 0xbd4 /* local must have metadata */);
|
|
674
|
+
const { interval } = localOpMetadata;
|
|
675
675
|
interval.ackPropertiesChange(properties, op);
|
|
676
676
|
this.ackInterval(interval, op);
|
|
677
|
+
return interval;
|
|
677
678
|
}
|
|
678
679
|
else {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
this.
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
}
|
|
699
|
-
if (newInterval !== interval) {
|
|
700
|
-
this.emitChange(newInterval, interval, local, false, op);
|
|
680
|
+
const latestInterval = this.getIntervalById(id);
|
|
681
|
+
const intervalToChange = this.pending[id]?.consensus ?? latestInterval;
|
|
682
|
+
const isLatestInterval = intervalToChange === latestInterval;
|
|
683
|
+
if (!intervalToChange) {
|
|
684
|
+
return intervalToChange;
|
|
685
|
+
}
|
|
686
|
+
const deltaProps = intervalToChange.changeProperties(properties, op);
|
|
687
|
+
let newInterval = intervalToChange;
|
|
688
|
+
if (hasEndpointChanges(serializedInterval)) {
|
|
689
|
+
const { start, end, startSide, endSide } = serializedInterval;
|
|
690
|
+
newInterval = intervalToChange.modify("", toOptionalSequencePlace(start, startSide ?? internal_2.Side.Before), toOptionalSequencePlace(end, endSide ?? internal_2.Side.Before), op);
|
|
691
|
+
if (isLatestInterval) {
|
|
692
|
+
this.localCollection.removeExistingInterval(intervalToChange);
|
|
693
|
+
this.localCollection.add(newInterval);
|
|
694
|
+
this.emitChange(newInterval, intervalToChange, local, false, op);
|
|
695
|
+
if (this.onDeserialize) {
|
|
696
|
+
this.onDeserialize(newInterval);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
701
699
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
this.emit("
|
|
705
|
-
this.emit("changed", interval, deltaProps, undefined, local, false);
|
|
700
|
+
if (deltaProps !== undefined && Object.keys(deltaProps).length > 0) {
|
|
701
|
+
this.emit("propertyChanged", latestInterval, deltaProps, local, op);
|
|
702
|
+
this.emit("changed", latestInterval, deltaProps, undefined, local, false);
|
|
706
703
|
}
|
|
704
|
+
return newInterval;
|
|
707
705
|
}
|
|
708
706
|
}
|
|
709
707
|
/**
|
|
@@ -737,8 +735,8 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
737
735
|
}
|
|
738
736
|
const { localSeq, interval } = localOpMetadata;
|
|
739
737
|
const { id } = (0, index_js_2.getSerializedProperties)(original);
|
|
740
|
-
const rebasedEndpoint =
|
|
741
|
-
const localInterval = this.
|
|
738
|
+
const rebasedEndpoint = this.computeRebasedPositions(localOpMetadata, squash);
|
|
739
|
+
const localInterval = this.getIntervalById(id);
|
|
742
740
|
// if the interval slid off the string, rebase the op to be a noop and delete the interval.
|
|
743
741
|
if (rebasedEndpoint === "detached") {
|
|
744
742
|
if (localInterval !== undefined &&
|
|
@@ -761,8 +759,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
761
759
|
this.localCollection.add(interval);
|
|
762
760
|
this.emitChange(interval, old, true, true);
|
|
763
761
|
}
|
|
764
|
-
|
|
765
|
-
this.client.removeLocalReferencePosition(old.end);
|
|
762
|
+
old.dispose();
|
|
766
763
|
}
|
|
767
764
|
return {
|
|
768
765
|
...original,
|
|
@@ -811,10 +808,13 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
811
808
|
}
|
|
812
809
|
// `interval`'s endpoints will get modified in-place, so clone it prior to doing so for event emission.
|
|
813
810
|
const oldInterval = interval.clone();
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
811
|
+
const isLatestInterval = this.getIntervalById(id) === interval;
|
|
812
|
+
if (isLatestInterval) {
|
|
813
|
+
// In this case, where we change the start or end of an interval,
|
|
814
|
+
// it is necessary to remove and re-add the interval listeners.
|
|
815
|
+
// This ensures that the correct listeners are added to the LocalReferencePosition.
|
|
816
|
+
this.localCollection.removeExistingInterval(interval);
|
|
817
|
+
}
|
|
818
818
|
if (!this.client) {
|
|
819
819
|
throw new internal_3.LoggingError("client does not exist");
|
|
820
820
|
}
|
|
@@ -856,19 +856,18 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
856
856
|
oldInterval.end.refType = internal_2.ReferenceType.Transient;
|
|
857
857
|
oldSeg?.localRefs?.addLocalRef(oldInterval.end, oldInterval.end.getOffset());
|
|
858
858
|
}
|
|
859
|
-
|
|
860
|
-
|
|
859
|
+
if (isLatestInterval) {
|
|
860
|
+
this.localCollection.add(interval);
|
|
861
|
+
this.emitChange(interval, oldInterval, true, true, op);
|
|
862
|
+
}
|
|
861
863
|
}
|
|
862
864
|
}
|
|
863
865
|
ackAdd(serializedInterval, local, op, localOpMetadata) {
|
|
864
866
|
const { id, properties } = (0, index_js_2.getSerializedProperties)(serializedInterval);
|
|
865
867
|
if (local) {
|
|
866
868
|
(0, internal_1.assert)(localOpMetadata !== undefined, 0x553 /* op metadata should be defined for local op */);
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
this.ackInterval(localInterval, op);
|
|
870
|
-
}
|
|
871
|
-
return;
|
|
869
|
+
this.ackInterval(localOpMetadata.interval, op);
|
|
870
|
+
return localOpMetadata.interval;
|
|
872
871
|
}
|
|
873
872
|
if (!this.localCollection) {
|
|
874
873
|
throw new internal_3.LoggingError("attachSequence must be called");
|
|
@@ -893,7 +892,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
893
892
|
throw new internal_3.LoggingError("attach must be called prior to deleting intervals");
|
|
894
893
|
}
|
|
895
894
|
const { id } = (0, index_js_2.getSerializedProperties)(serializedInterval);
|
|
896
|
-
const interval = this.
|
|
895
|
+
const interval = this.getIntervalById(id);
|
|
897
896
|
if (interval) {
|
|
898
897
|
this.deleteExistingInterval({ interval, local, op });
|
|
899
898
|
}
|