@fluidframework/sequence 0.59.2000 → 0.59.3000-67119
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/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +7 -7
- package/dist/intervalCollection.js.map +1 -1
- package/dist/localValues.js +4 -4
- package/dist/localValues.js.map +1 -1
- package/dist/mapKernel.d.ts.map +1 -1
- package/dist/mapKernel.js +9 -9
- package/dist/mapKernel.js.map +1 -1
- 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 +21 -3
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +39 -20
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceDeltaEvent.js +1 -1
- package/dist/sequenceDeltaEvent.js.map +1 -1
- package/dist/sharedIntervalCollection.js +5 -3
- package/dist/sharedIntervalCollection.js.map +1 -1
- package/dist/sparsematrix.js +8 -8
- package/dist/sparsematrix.js.map +1 -1
- package/lib/intervalCollection.d.ts.map +1 -1
- package/lib/intervalCollection.js +1 -1
- package/lib/intervalCollection.js.map +1 -1
- package/lib/mapKernel.d.ts.map +1 -1
- package/lib/mapKernel.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 +21 -3
- package/lib/sequence.d.ts.map +1 -1
- package/lib/sequence.js +26 -7
- package/lib/sequence.js.map +1 -1
- package/lib/sharedIntervalCollection.js +3 -1
- package/lib/sharedIntervalCollection.js.map +1 -1
- package/lib/sparsematrix.js.map +1 -1
- package/package.json +72 -18
- package/src/intervalCollection.ts +11 -19
- package/src/mapKernel.ts +8 -8
- package/src/packageVersion.ts +1 -1
- package/src/sequence.ts +42 -11
- package/src/sharedIntervalCollection.ts +1 -1
- package/src/sparsematrix.ts +1 -1
package/src/mapKernel.ts
CHANGED
|
@@ -54,9 +54,9 @@ interface IMapMessageHandler {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
interface IMapMessageLocalMetadata{
|
|
57
|
-
pendingClearMessageId?: number
|
|
58
|
-
pendingMessageId?: number
|
|
59
|
-
lastProcessedSeq: number
|
|
57
|
+
pendingClearMessageId?: number;
|
|
58
|
+
pendingMessageId?: number;
|
|
59
|
+
lastProcessedSeq: number;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -510,7 +510,7 @@ export class MapKernel implements IValueTypeCreator {
|
|
|
510
510
|
const mapLocalMetadata: Partial<IMapMessageLocalMetadata> = localOpMetadata;
|
|
511
511
|
// we don't know how to rebase these operations, so if any other op has come in
|
|
512
512
|
// we will fail.
|
|
513
|
-
if(this.lastProcessedSeq !== mapLocalMetadata?.lastProcessedSeq) {
|
|
513
|
+
if (this.lastProcessedSeq !== mapLocalMetadata?.lastProcessedSeq) {
|
|
514
514
|
throw new Error("SharedInterval does not support reconnect in presence of external changes");
|
|
515
515
|
}
|
|
516
516
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -777,7 +777,7 @@ export class MapKernel implements IValueTypeCreator {
|
|
|
777
777
|
this.eventEmitter.emit("valueChanged", event, local, message, this.eventEmitter);
|
|
778
778
|
},
|
|
779
779
|
submit: (op: IMapValueTypeOperation) => {
|
|
780
|
-
this.submitMessage(op, {lastProcessedSeq: this.lastProcessedSeq});
|
|
780
|
+
this.submitMessage(op, { lastProcessedSeq: this.lastProcessedSeq });
|
|
781
781
|
},
|
|
782
782
|
getStashedOpLocalMetadata: (op: IMapValueTypeOperation) => {
|
|
783
783
|
assert(false, 0x016 /* "apply stashed op not implemented for custom value type ops" */);
|
|
@@ -799,7 +799,7 @@ export class MapKernel implements IValueTypeCreator {
|
|
|
799
799
|
*/
|
|
800
800
|
private submitMapClearMessage(op: IMapClearOperation): void {
|
|
801
801
|
const pendingClearMessageId = this.getMapClearMessageLocalMetadata(op);
|
|
802
|
-
this.submitMessage(op, {pendingClearMessageId, lastProcessedSeq: this.lastProcessedSeq});
|
|
802
|
+
this.submitMessage(op, { pendingClearMessageId, lastProcessedSeq: this.lastProcessedSeq });
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
private getMapKeyMessageLocalMetadata(op: IMapKeyOperation): number {
|
|
@@ -814,7 +814,7 @@ export class MapKernel implements IValueTypeCreator {
|
|
|
814
814
|
*/
|
|
815
815
|
private submitMapKeyMessage(op: IMapKeyOperation): void {
|
|
816
816
|
const pendingMessageId = this.getMapKeyMessageLocalMetadata(op);
|
|
817
|
-
this.submitMessage(op, {pendingMessageId, lastProcessedSeq: this.lastProcessedSeq});
|
|
817
|
+
this.submitMessage(op, { pendingMessageId, lastProcessedSeq: this.lastProcessedSeq });
|
|
818
818
|
}
|
|
819
819
|
|
|
820
820
|
/**
|
|
@@ -839,7 +839,7 @@ export class MapKernel implements IValueTypeCreator {
|
|
|
839
839
|
},
|
|
840
840
|
};
|
|
841
841
|
// Send the localOpMetadata as undefined because we don't care about the ack.
|
|
842
|
-
this.submitMessage(op, {lastProcessedSeq: this.lastProcessedSeq});
|
|
842
|
+
this.submitMessage(op, { lastProcessedSeq: this.lastProcessedSeq });
|
|
843
843
|
|
|
844
844
|
const event: IValueChanged = { key, previousValue };
|
|
845
845
|
this.eventEmitter.emit("valueChanged", event, true, null, this.eventEmitter);
|
package/src/packageVersion.ts
CHANGED
package/src/sequence.ts
CHANGED
|
@@ -175,7 +175,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
175
175
|
) {
|
|
176
176
|
super(id, dataStoreRuntime, attributes);
|
|
177
177
|
|
|
178
|
-
this.loadedDeferred.promise.catch((error)=>{
|
|
178
|
+
this.loadedDeferred.promise.catch((error) => {
|
|
179
179
|
this.logger.sendErrorEvent({ eventName: "SequenceLoadFailed" }, error);
|
|
180
180
|
});
|
|
181
181
|
|
|
@@ -294,6 +294,9 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
294
294
|
return this.client.getRangeExtentsOfPosition(pos);
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
+
/**
|
|
298
|
+
* @deprecated - use createLocalReferencePosition
|
|
299
|
+
*/
|
|
297
300
|
public createPositionReference(
|
|
298
301
|
segment: T,
|
|
299
302
|
offset: number,
|
|
@@ -305,12 +308,27 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
305
308
|
return lref;
|
|
306
309
|
}
|
|
307
310
|
|
|
311
|
+
public createLocalReferencePosition(
|
|
312
|
+
segment: T,
|
|
313
|
+
offset: number,
|
|
314
|
+
refType: ReferenceType,
|
|
315
|
+
properties: PropertySet | undefined): ReferencePosition {
|
|
316
|
+
return this.client.createLocalReferencePosition(
|
|
317
|
+
segment,
|
|
318
|
+
offset,
|
|
319
|
+
refType,
|
|
320
|
+
properties);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @deprecated - use localReferencePositionToPosition
|
|
325
|
+
*/
|
|
308
326
|
public localRefToPos(localRef: LocalReference) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
327
|
+
return this.client.localReferencePositionToPosition(localRef);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
public localReferencePositionToPosition(lref: ReferencePosition): number {
|
|
331
|
+
return this.client.localReferencePositionToPosition(lref);
|
|
314
332
|
}
|
|
315
333
|
|
|
316
334
|
/**
|
|
@@ -355,12 +373,22 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
355
373
|
}
|
|
356
374
|
}
|
|
357
375
|
|
|
376
|
+
/**
|
|
377
|
+
* @deprecated - use createLocalReferencePosition
|
|
378
|
+
*/
|
|
358
379
|
public addLocalReference(lref: LocalReference) {
|
|
359
380
|
return this.client.addLocalReference(lref);
|
|
360
381
|
}
|
|
361
382
|
|
|
383
|
+
/**
|
|
384
|
+
* @deprecated - use removeLocalReferencePosition
|
|
385
|
+
*/
|
|
362
386
|
public removeLocalReference(lref: LocalReference) {
|
|
363
|
-
return this.client.
|
|
387
|
+
return this.client.removeLocalReferencePosition(lref);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
public removeLocalReferencePosition(lref: ReferencePosition) {
|
|
391
|
+
return this.client.removeLocalReferencePosition(lref);
|
|
364
392
|
}
|
|
365
393
|
|
|
366
394
|
/**
|
|
@@ -539,12 +567,12 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
539
567
|
|| m.sequenceNumber <= collabWindow.currentSeq) {
|
|
540
568
|
throw new Error(`Invalid catchup operations in snapshot: ${
|
|
541
569
|
JSON.stringify({
|
|
542
|
-
op:{
|
|
570
|
+
op: {
|
|
543
571
|
seq: m.sequenceNumber,
|
|
544
572
|
minSeq: m.minimumSequenceNumber,
|
|
545
|
-
refSeq:m.referenceSequenceNumber,
|
|
573
|
+
refSeq: m.referenceSequenceNumber,
|
|
546
574
|
},
|
|
547
|
-
collabWindow:{
|
|
575
|
+
collabWindow: {
|
|
548
576
|
seq: collabWindow.currentSeq,
|
|
549
577
|
minSeq: collabWindow.minSeq,
|
|
550
578
|
},
|
|
@@ -597,7 +625,10 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
597
625
|
this.loadFinished();
|
|
598
626
|
}
|
|
599
627
|
|
|
600
|
-
|
|
628
|
+
/**
|
|
629
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
630
|
+
*/
|
|
631
|
+
protected applyStashedOp(content: any): unknown {
|
|
601
632
|
return this.client.applyStashedOp(content);
|
|
602
633
|
}
|
|
603
634
|
|
|
@@ -160,7 +160,7 @@ export class SharedIntervalCollection<TInterval extends ISerializableInterval =
|
|
|
160
160
|
*/
|
|
161
161
|
protected async loadCore(storage: IChannelStorageService) {
|
|
162
162
|
const blob = await storage.readBlob(snapshotFileName);
|
|
163
|
-
const header = bufferToString(blob,"utf8");
|
|
163
|
+
const header = bufferToString(blob, "utf8");
|
|
164
164
|
this.intervalMapKernel.populate(header);
|
|
165
165
|
}
|
|
166
166
|
|
package/src/sparsematrix.ts
CHANGED
|
@@ -349,7 +349,7 @@ export class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
|
|
|
349
349
|
const removeColEnd = srcCol + numCols;
|
|
350
350
|
const ops = [];
|
|
351
351
|
|
|
352
|
-
for (let r = 0, rowStart = 0; r < this.numRows; r
|
|
352
|
+
for (let r = 0, rowStart = 0; r < this.numRows; r++, rowStart += maxCols) {
|
|
353
353
|
ops.push(this.client.removeRangeLocal(rowStart + removeColStart, rowStart + removeColEnd));
|
|
354
354
|
const insertPos = rowStart + destCol;
|
|
355
355
|
const segment = new PaddingSegment(numCols);
|