@fluidframework/sequence 0.59.2000-61729 → 0.59.2001
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/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/sequence.d.ts +2 -2
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +6 -6
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceDeltaEvent.d.ts +20 -17
- package/dist/sequenceDeltaEvent.d.ts.map +1 -1
- package/dist/sequenceDeltaEvent.js +18 -28
- package/dist/sequenceDeltaEvent.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/sequence.d.ts +2 -2
- package/lib/sequence.d.ts.map +1 -1
- package/lib/sequence.js +6 -6
- package/lib/sequence.js.map +1 -1
- package/lib/sequenceDeltaEvent.d.ts +20 -17
- package/lib/sequenceDeltaEvent.d.ts.map +1 -1
- package/lib/sequenceDeltaEvent.js +18 -28
- package/lib/sequenceDeltaEvent.js.map +1 -1
- package/package.json +23 -19
- package/src/packageVersion.ts +1 -1
- package/src/sequence.ts +7 -8
- package/src/sequenceDeltaEvent.ts +29 -32
package/src/packageVersion.ts
CHANGED
package/src/sequence.ts
CHANGED
|
@@ -579,7 +579,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
579
579
|
const handled = this.intervalMapKernel.tryProcessMessage(message.contents, local, message, localOpMetadata);
|
|
580
580
|
|
|
581
581
|
if (!handled) {
|
|
582
|
-
this.processMergeTreeMsg(message);
|
|
582
|
+
this.processMergeTreeMsg(message, local);
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
}
|
|
@@ -597,6 +597,10 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
597
597
|
this.loadFinished();
|
|
598
598
|
}
|
|
599
599
|
|
|
600
|
+
protected applyStashedOp(content: any) {
|
|
601
|
+
return this.client.applyStashedOp(content);
|
|
602
|
+
}
|
|
603
|
+
|
|
600
604
|
private summarizeMergeTree(serializer: IFluidSerializer): ISummaryTreeWithStats {
|
|
601
605
|
// Are we fully loaded? If not, things will go south
|
|
602
606
|
assert(this.loadedDeferred.isCompleted, 0x074 /* "Snapshot called when not fully loaded" */);
|
|
@@ -609,8 +613,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
609
613
|
return this.client.summarize(this.runtime, this.handle, serializer, this.messagesSinceMSNChange);
|
|
610
614
|
}
|
|
611
615
|
|
|
612
|
-
private processMergeTreeMsg(
|
|
613
|
-
rawMessage: ISequencedDocumentMessage) {
|
|
616
|
+
private processMergeTreeMsg(rawMessage: ISequencedDocumentMessage, local?: boolean) {
|
|
614
617
|
const message = parseHandles(rawMessage, this.serializer);
|
|
615
618
|
|
|
616
619
|
const ops: IMergeTreeDeltaOp[] = [];
|
|
@@ -625,7 +628,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
625
628
|
}
|
|
626
629
|
}
|
|
627
630
|
|
|
628
|
-
this.client.applyMsg(message);
|
|
631
|
+
this.client.applyMsg(message, local);
|
|
629
632
|
|
|
630
633
|
if (this.runtime.options?.newMergeTreeSnapshotFormat !== true) {
|
|
631
634
|
if (needsTransformation) {
|
|
@@ -709,8 +712,4 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
709
712
|
intervalCollection.attachGraph(this.client, key);
|
|
710
713
|
}
|
|
711
714
|
}
|
|
712
|
-
|
|
713
|
-
protected applyStashedOp() {
|
|
714
|
-
throw new Error("not implemented");
|
|
715
|
-
}
|
|
716
715
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { assert } from "@fluidframework/common-utils";
|
|
6
7
|
import {
|
|
7
8
|
Client,
|
|
8
9
|
IMergeTreeDeltaCallbackArgs,
|
|
@@ -19,22 +20,28 @@ import {
|
|
|
19
20
|
/**
|
|
20
21
|
* Base class for SequenceDeltaEvent and SequenceMaintenanceEvent.
|
|
21
22
|
*
|
|
22
|
-
* The properties of this object and its sub-objects represent
|
|
23
|
-
*
|
|
24
|
-
* performed to the underlying sequence and merge tree.
|
|
23
|
+
* The properties of this object and its sub-objects represent the state of the sequence at the
|
|
24
|
+
* point in time at which the operation was applied.
|
|
25
|
+
* They will not take into any future modifications performed to the underlying sequence and merge tree.
|
|
25
26
|
*/
|
|
26
27
|
export abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated - Events no longer fire when the change they correspond to had no impact (e.g. a remote delete
|
|
30
|
+
* event for a range that had already been deleted locally).
|
|
31
|
+
* Clients can therefore assume this property is false.
|
|
32
|
+
*/
|
|
27
33
|
public readonly isEmpty: boolean;
|
|
28
34
|
public readonly deltaOperation: TOperation;
|
|
29
35
|
private readonly sortedRanges: Lazy<SortedSegmentSet<ISequenceDeltaRange<TOperation>>>;
|
|
30
|
-
private readonly pFirst: Lazy<ISequenceDeltaRange<TOperation
|
|
31
|
-
private readonly pLast: Lazy<ISequenceDeltaRange<TOperation
|
|
36
|
+
private readonly pFirst: Lazy<ISequenceDeltaRange<TOperation>>;
|
|
37
|
+
private readonly pLast: Lazy<ISequenceDeltaRange<TOperation>>;
|
|
32
38
|
|
|
33
39
|
constructor(
|
|
34
40
|
public readonly deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>,
|
|
35
41
|
private readonly mergeTreeClient: Client,
|
|
36
42
|
) {
|
|
37
|
-
|
|
43
|
+
assert(deltaArgs.deltaSegments.length > 0, 0x2d8 /* "Empty change event should not be emitted." */);
|
|
44
|
+
this.isEmpty = false;
|
|
38
45
|
this.deltaOperation = deltaArgs.operation;
|
|
39
46
|
|
|
40
47
|
this.sortedRanges = new Lazy<SortedSegmentSet<ISequenceDeltaRange<TOperation>>>(
|
|
@@ -53,25 +60,17 @@ export abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTy
|
|
|
53
60
|
});
|
|
54
61
|
|
|
55
62
|
this.pFirst = new Lazy<ISequenceDeltaRange<TOperation>>(
|
|
56
|
-
() =>
|
|
57
|
-
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
return this.sortedRanges.value.items[0];
|
|
61
|
-
});
|
|
63
|
+
() => this.sortedRanges.value.items[0],
|
|
64
|
+
);
|
|
62
65
|
|
|
63
66
|
this.pLast = new Lazy<ISequenceDeltaRange<TOperation>>(
|
|
64
|
-
() =>
|
|
65
|
-
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
return this.sortedRanges.value.items[this.sortedRanges.value.size - 1];
|
|
69
|
-
});
|
|
67
|
+
() => this.sortedRanges.value.items[this.sortedRanges.value.size - 1],
|
|
68
|
+
);
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
/**
|
|
73
72
|
* The in-order ranges affected by this delta.
|
|
74
|
-
* These may not be
|
|
73
|
+
* These may not be continuous.
|
|
75
74
|
*/
|
|
76
75
|
public get ranges(): readonly Readonly<ISequenceDeltaRange<TOperation>>[] {
|
|
77
76
|
return this.sortedRanges.value.items;
|
|
@@ -85,18 +84,16 @@ export abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTy
|
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
|
-
* The first of the modified ranges.
|
|
89
|
-
* like in the case where a delete comes in for a previously deleted range
|
|
87
|
+
* The first of the modified ranges.
|
|
90
88
|
*/
|
|
91
|
-
public get first(): Readonly<ISequenceDeltaRange<TOperation>>
|
|
89
|
+
public get first(): Readonly<ISequenceDeltaRange<TOperation>> {
|
|
92
90
|
return this.pFirst.value;
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
/**
|
|
96
|
-
* The last of the modified ranges.
|
|
97
|
-
* like in the case where a delete comes in for a previously deleted range
|
|
94
|
+
* The last of the modified ranges.
|
|
98
95
|
*/
|
|
99
|
-
public get last(): Readonly<ISequenceDeltaRange<TOperation>>
|
|
96
|
+
public get last(): Readonly<ISequenceDeltaRange<TOperation>> {
|
|
100
97
|
return this.pLast.value;
|
|
101
98
|
}
|
|
102
99
|
}
|
|
@@ -104,11 +101,11 @@ export abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTy
|
|
|
104
101
|
/**
|
|
105
102
|
* The event object returned on sequenceDelta events.
|
|
106
103
|
*
|
|
107
|
-
* The properties of this object and its sub-objects represent
|
|
108
|
-
*
|
|
109
|
-
* performed to the underlying sequence and merge tree.
|
|
104
|
+
* The properties of this object and its sub-objects represent the state of the sequence at the
|
|
105
|
+
* point in time at which the operation was applied.
|
|
106
|
+
* They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
|
|
110
107
|
*
|
|
111
|
-
* For group ops, each op will get
|
|
108
|
+
* For group ops, each op will get its own event, and the group op property will be set on the op args.
|
|
112
109
|
*
|
|
113
110
|
* Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.
|
|
114
111
|
*/
|
|
@@ -131,9 +128,9 @@ export class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationTyp
|
|
|
131
128
|
/**
|
|
132
129
|
* The event object returned on maintenance events.
|
|
133
130
|
*
|
|
134
|
-
* The properties of this object and its sub-objects represent
|
|
135
|
-
*
|
|
136
|
-
* performed to the underlying sequence and merge tree.
|
|
131
|
+
* The properties of this object and its sub-objects represent the state of the sequence at the
|
|
132
|
+
* point in time at which the operation was applied.
|
|
133
|
+
* They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
|
|
137
134
|
*/
|
|
138
135
|
export class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {
|
|
139
136
|
constructor(
|