@fluidframework/map 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554
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/{.eslintrc.js → .eslintrc.cjs} +10 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +11 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/map.api.md +14 -57
- package/dist/directory.d.ts +14 -51
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +109 -172
- package/dist/directory.js.map +1 -1
- package/dist/index.d.ts +45 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -8
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/internalInterfaces.d.ts +2 -2
- package/dist/internalInterfaces.d.ts.map +1 -1
- package/dist/internalInterfaces.js.map +1 -1
- package/dist/localValues.d.ts +3 -5
- package/dist/localValues.d.ts.map +1 -1
- package/dist/localValues.js +9 -8
- package/dist/localValues.js.map +1 -1
- package/dist/map-alpha.d.ts +31 -116
- package/dist/map-beta.d.ts +24 -105
- package/dist/map-public.d.ts +24 -105
- package/dist/map-untrimmed.d.ts +31 -116
- package/dist/map.d.ts +4 -23
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +6 -29
- package/dist/map.js.map +1 -1
- package/dist/mapKernel.d.ts +3 -4
- package/dist/mapKernel.d.ts.map +1 -1
- package/dist/mapKernel.js +30 -35
- package/dist/mapKernel.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{directory.d.mts → directory.d.ts} +15 -52
- package/lib/directory.d.ts.map +1 -0
- package/lib/{directory.mjs → directory.js} +110 -173
- package/lib/directory.js.map +1 -0
- package/lib/index.d.ts +61 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +55 -0
- package/lib/index.js.map +1 -0
- package/lib/{interfaces.d.mts → interfaces.d.ts} +1 -1
- package/lib/interfaces.d.ts.map +1 -0
- package/lib/{interfaces.mjs → interfaces.js} +1 -1
- package/lib/interfaces.js.map +1 -0
- package/lib/{internalInterfaces.d.mts → internalInterfaces.d.ts} +3 -3
- package/lib/internalInterfaces.d.ts.map +1 -0
- package/lib/{internalInterfaces.mjs → internalInterfaces.js} +1 -1
- package/lib/internalInterfaces.js.map +1 -0
- package/lib/{localValues.d.mts → localValues.d.ts} +4 -6
- package/lib/localValues.d.ts.map +1 -0
- package/lib/{localValues.mjs → localValues.js} +10 -9
- package/lib/localValues.js.map +1 -0
- package/lib/{map-alpha.d.mts → map-alpha.d.ts} +43 -116
- package/lib/{map-beta.d.mts → map-beta.d.ts} +36 -105
- package/lib/{map-public.d.mts → map-public.d.ts} +36 -105
- package/lib/{map-untrimmed.d.mts → map-untrimmed.d.ts} +43 -116
- package/lib/{map.d.mts → map.d.ts} +5 -24
- package/lib/map.d.ts.map +1 -0
- package/lib/{map.mjs → map.js} +5 -28
- package/lib/map.js.map +1 -0
- package/lib/{mapKernel.d.mts → mapKernel.d.ts} +4 -5
- package/lib/mapKernel.d.ts.map +1 -0
- package/lib/{mapKernel.mjs → mapKernel.js} +32 -37
- package/lib/mapKernel.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/test/memory/directory.spec.js +71 -0
- package/lib/test/memory/directory.spec.js.map +1 -0
- package/lib/test/memory/map.spec.js +71 -0
- package/lib/test/memory/map.spec.js.map +1 -0
- package/lib/test/mocha/directory.order.spec.js +422 -0
- package/lib/test/mocha/directory.order.spec.js.map +1 -0
- package/lib/test/mocha/directory.snapshot.spec.js +111 -0
- package/lib/test/mocha/directory.snapshot.spec.js.map +1 -0
- package/lib/test/mocha/directory.spec.js +1406 -0
- package/lib/test/mocha/directory.spec.js.map +1 -0
- package/lib/test/mocha/directoryEquivalenceUtils.js +36 -0
- package/lib/test/mocha/directoryEquivalenceUtils.js.map +1 -0
- package/lib/test/mocha/directoryFuzzTests.spec.js +337 -0
- package/lib/test/mocha/directoryFuzzTests.spec.js.map +1 -0
- package/lib/test/mocha/dirname.cjs +16 -0
- package/lib/test/mocha/dirname.cjs.map +1 -0
- package/lib/test/mocha/map.fuzz.spec.js +114 -0
- package/lib/test/mocha/map.fuzz.spec.js.map +1 -0
- package/lib/test/mocha/map.spec.js +687 -0
- package/lib/test/mocha/map.spec.js.map +1 -0
- package/lib/test/mocha/rebasing.spec.js +158 -0
- package/lib/test/mocha/rebasing.spec.js.map +1 -0
- package/lib/test/mocha/reconnection.spec.js +327 -0
- package/lib/test/mocha/reconnection.spec.js.map +1 -0
- package/lib/test/types/validateMapPrevious.generated.js +66 -0
- package/lib/test/types/validateMapPrevious.generated.js.map +1 -0
- package/package.json +55 -52
- package/src/directory.ts +159 -226
- package/src/index.ts +57 -4
- package/src/interfaces.ts +2 -2
- package/src/internalInterfaces.ts +2 -2
- package/src/localValues.ts +14 -9
- package/src/map.ts +7 -32
- package/src/mapKernel.ts +40 -42
- package/src/packageVersion.ts +1 -1
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/directory.d.mts.map +0 -1
- package/lib/directory.mjs.map +0 -1
- package/lib/index.d.mts +0 -9
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -8
- package/lib/index.mjs.map +0 -1
- package/lib/interfaces.d.mts.map +0 -1
- package/lib/interfaces.mjs.map +0 -1
- package/lib/internalInterfaces.d.mts.map +0 -1
- package/lib/internalInterfaces.mjs.map +0 -1
- package/lib/localValues.d.mts.map +0 -1
- package/lib/localValues.mjs.map +0 -1
- package/lib/map.d.mts.map +0 -1
- package/lib/map.mjs.map +0 -1
- package/lib/mapKernel.d.mts.map +0 -1
- package/lib/mapKernel.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
package/dist/directory.js
CHANGED
|
@@ -18,8 +18,8 @@ const shared_object_base_1 = require("@fluidframework/shared-object-base");
|
|
|
18
18
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
19
19
|
const path_browserify_1 = __importDefault(require("path-browserify"));
|
|
20
20
|
const merge_tree_1 = require("@fluidframework/merge-tree");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
21
|
+
const localValues_js_1 = require("./localValues.js");
|
|
22
|
+
const packageVersion_js_1 = require("./packageVersion.js");
|
|
23
23
|
// We use path-browserify since this code can run safely on the server or the browser.
|
|
24
24
|
// We standardize on using posix slashes everywhere.
|
|
25
25
|
const posix = path_browserify_1.default.posix;
|
|
@@ -71,7 +71,7 @@ DirectoryFactory.Type = "https://graph.microsoft.com/types/directory";
|
|
|
71
71
|
DirectoryFactory.Attributes = {
|
|
72
72
|
type: DirectoryFactory.Type,
|
|
73
73
|
snapshotFormatVersion: "0.1",
|
|
74
|
-
packageVersion:
|
|
74
|
+
packageVersion: packageVersion_js_1.pkgVersion,
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
77
|
* The comparator essentially performs the following procedure to determine the order of subdirectory creation:
|
|
@@ -97,19 +97,19 @@ const seqDataComparator = (a, b) => {
|
|
|
97
97
|
if (isAcknowledgedOrDetached(a)) {
|
|
98
98
|
if (isAcknowledgedOrDetached(b)) {
|
|
99
99
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
100
|
-
return a.seq
|
|
100
|
+
return a.seq === b.seq ? a.clientSeq - b.clientSeq : a.seq - b.seq;
|
|
101
101
|
}
|
|
102
102
|
else {
|
|
103
103
|
return -1;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
return a.seq !== b.seq ? a.seq - b.seq : a.clientSeq - b.clientSeq;
|
|
107
|
+
if (isAcknowledgedOrDetached(b)) {
|
|
108
|
+
return 1;
|
|
110
109
|
}
|
|
111
110
|
else {
|
|
112
|
-
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
112
|
+
return a.seq === b.seq ? a.clientSeq - b.clientSeq : a.seq - b.seq;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
};
|
|
@@ -166,6 +166,9 @@ class DirectoryCreationTracker {
|
|
|
166
166
|
}, keys);
|
|
167
167
|
return keys;
|
|
168
168
|
}
|
|
169
|
+
get size() {
|
|
170
|
+
return this.keyToIndex.size;
|
|
171
|
+
}
|
|
169
172
|
}
|
|
170
173
|
/**
|
|
171
174
|
* {@inheritDoc ISharedDirectory}
|
|
@@ -222,12 +225,12 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
222
225
|
/**
|
|
223
226
|
* Root of the SharedDirectory, most operations on the SharedDirectory itself act on the root.
|
|
224
227
|
*/
|
|
225
|
-
this.root = new SubDirectory({ seq: 0, clientSeq: 0 }, new Set(), this, this.runtime, this.serializer, posix.sep);
|
|
228
|
+
this.root = new SubDirectory({ seq: 0, clientSeq: 0 }, new Set(), this, this.runtime, this.serializer, posix.sep, this.logger);
|
|
226
229
|
/**
|
|
227
230
|
* Mapping of op types to message handlers.
|
|
228
231
|
*/
|
|
229
232
|
this.messageHandlers = new Map();
|
|
230
|
-
this.localValueMaker = new
|
|
233
|
+
this.localValueMaker = new localValues_js_1.LocalValueMaker();
|
|
231
234
|
this.setMessageHandlers();
|
|
232
235
|
// Mirror the containedValueChanged op on the SharedDirectory
|
|
233
236
|
this.root.on("containedValueChanged", (changed, local) => {
|
|
@@ -456,10 +459,7 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
456
459
|
// guaranteed during the serialization process. As a result, it is only essential to utilize the
|
|
457
460
|
// "fake" client sequence number to signify the loading order, and there is no need to retain
|
|
458
461
|
// the actual client sequence number at this point.
|
|
459
|
-
if (createInfo !== undefined && createInfo.csn >
|
|
460
|
-
// If csn is -1, then initialize it with 0, otherwise we will never process ops for this
|
|
461
|
-
// sub directory. This could be done at serialization time too, but we need to maintain
|
|
462
|
-
// back compat too and also we will actually know the state when it was serialized.
|
|
462
|
+
if (createInfo !== undefined && createInfo.csn > 0) {
|
|
463
463
|
if (!tempSeqNums.has(createInfo.csn)) {
|
|
464
464
|
tempSeqNums.set(createInfo.csn, 0);
|
|
465
465
|
}
|
|
@@ -468,14 +468,21 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
468
468
|
tempSeqNums.set(createInfo.csn, ++fakeClientSeq);
|
|
469
469
|
}
|
|
470
470
|
else {
|
|
471
|
+
/**
|
|
472
|
+
* 1. If csn is -1, then initialize it with 0, otherwise we will never process ops for this
|
|
473
|
+
* sub directory. This could be done at serialization time too, but we need to maintain
|
|
474
|
+
* back compat too and also we will actually know the state when it was serialized.
|
|
475
|
+
* 2. We need to make the csn = -1 and csn = 0 share the same counter, there are cases
|
|
476
|
+
* where both -1 and 0 coexist within a single document.
|
|
477
|
+
*/
|
|
471
478
|
seqData = {
|
|
472
479
|
seq: 0,
|
|
473
480
|
clientSeq: ++currentSubDir.localCreationSeq,
|
|
474
481
|
};
|
|
475
482
|
}
|
|
476
|
-
newSubDir = new SubDirectory(seqData, createInfo
|
|
477
|
-
? new Set(
|
|
478
|
-
: new Set(), this, this.runtime, this.serializer, posix.join(currentSubDir.absolutePath, subdirName));
|
|
483
|
+
newSubDir = new SubDirectory(seqData, createInfo === undefined
|
|
484
|
+
? new Set()
|
|
485
|
+
: new Set(createInfo.ccIds), this, this.runtime, this.serializer, posix.join(currentSubDir.absolutePath, subdirName), this.logger);
|
|
479
486
|
currentSubDir.populateSubDirectory(subdirName, newSubDir);
|
|
480
487
|
// Record the newly inserted subdirectory to the creation tracker
|
|
481
488
|
currentSubDir.ackedCreationSeqTracker.set(subdirName, {
|
|
@@ -487,7 +494,9 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
487
494
|
}
|
|
488
495
|
if (currentSubDirObject.storage) {
|
|
489
496
|
for (const [key, serializable] of Object.entries(currentSubDirObject.storage)) {
|
|
490
|
-
const localValue = this.makeLocal(key, currentSubDir.absolutePath,
|
|
497
|
+
const localValue = this.makeLocal(key, currentSubDir.absolutePath,
|
|
498
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
499
|
+
(0, shared_object_base_1.parseHandles)(serializable, this.serializer));
|
|
491
500
|
currentSubDir.populateStorage(key, localValue);
|
|
492
501
|
}
|
|
493
502
|
}
|
|
@@ -536,7 +545,7 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
536
545
|
serializable) {
|
|
537
546
|
(0, core_utils_1.assert)(serializable.type === shared_object_base_1.ValueType[shared_object_base_1.ValueType.Plain] ||
|
|
538
547
|
serializable.type === shared_object_base_1.ValueType[shared_object_base_1.ValueType.Shared], 0x1e4 /* "Unexpected serializable type" */);
|
|
539
|
-
return this.localValueMaker.fromSerializable(serializable);
|
|
548
|
+
return this.localValueMaker.fromSerializable(serializable, this.serializer, this.handle);
|
|
540
549
|
}
|
|
541
550
|
/**
|
|
542
551
|
* This checks if there is pending delete op for local delete for a any subdir in the relative path.
|
|
@@ -583,12 +592,6 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
583
592
|
subdir.resubmitClearMessage(op, localOpMetadata);
|
|
584
593
|
}
|
|
585
594
|
},
|
|
586
|
-
applyStashedOp: (op) => {
|
|
587
|
-
const subdir = this.getWorkingDirectory(op.path);
|
|
588
|
-
if (subdir) {
|
|
589
|
-
return subdir.applyStashedClearMessage(op);
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
595
|
});
|
|
593
596
|
this.messageHandlers.set("delete", {
|
|
594
597
|
process: (msg, op, local, localOpMetadata) => {
|
|
@@ -605,12 +608,6 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
605
608
|
subdir.resubmitKeyMessage(op, localOpMetadata);
|
|
606
609
|
}
|
|
607
610
|
},
|
|
608
|
-
applyStashedOp: (op) => {
|
|
609
|
-
const subdir = this.getWorkingDirectory(op.path);
|
|
610
|
-
if (subdir) {
|
|
611
|
-
return subdir.applyStashedDeleteMessage(op);
|
|
612
|
-
}
|
|
613
|
-
},
|
|
614
611
|
});
|
|
615
612
|
this.messageHandlers.set("set", {
|
|
616
613
|
process: (msg, op, local, localOpMetadata) => {
|
|
@@ -628,13 +625,6 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
628
625
|
subdir.resubmitKeyMessage(op, localOpMetadata);
|
|
629
626
|
}
|
|
630
627
|
},
|
|
631
|
-
applyStashedOp: (op) => {
|
|
632
|
-
const subdir = this.getWorkingDirectory(op.path);
|
|
633
|
-
if (subdir) {
|
|
634
|
-
const context = this.makeLocal(op.key, op.path, op.value);
|
|
635
|
-
return subdir.applyStashedSetMessage(op, context);
|
|
636
|
-
}
|
|
637
|
-
},
|
|
638
628
|
});
|
|
639
629
|
this.messageHandlers.set("createSubDirectory", {
|
|
640
630
|
process: (msg, op, local, localOpMetadata) => {
|
|
@@ -652,12 +642,6 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
652
642
|
parentSubdir.resubmitSubDirectoryMessage(op, localOpMetadata);
|
|
653
643
|
}
|
|
654
644
|
},
|
|
655
|
-
applyStashedOp: (op) => {
|
|
656
|
-
const parentSubdir = this.getWorkingDirectory(op.path);
|
|
657
|
-
if (parentSubdir) {
|
|
658
|
-
return parentSubdir.applyStashedCreateSubDirMessage(op);
|
|
659
|
-
}
|
|
660
|
-
},
|
|
661
645
|
});
|
|
662
646
|
this.messageHandlers.set("deleteSubDirectory", {
|
|
663
647
|
process: (msg, op, local, localOpMetadata) => {
|
|
@@ -675,23 +659,39 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
675
659
|
parentSubdir.resubmitSubDirectoryMessage(op, localOpMetadata);
|
|
676
660
|
}
|
|
677
661
|
},
|
|
678
|
-
applyStashedOp: (op) => {
|
|
679
|
-
const parentSubdir = this.getWorkingDirectory(op.path);
|
|
680
|
-
if (parentSubdir) {
|
|
681
|
-
return parentSubdir.applyStashedDeleteSubDirMessage(op);
|
|
682
|
-
}
|
|
683
|
-
},
|
|
684
662
|
});
|
|
685
663
|
}
|
|
686
664
|
/**
|
|
687
665
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
688
666
|
*/
|
|
689
667
|
applyStashedOp(op) {
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
|
|
668
|
+
const directoryOp = op;
|
|
669
|
+
const dir = this.getWorkingDirectory(directoryOp.path);
|
|
670
|
+
switch (directoryOp.type) {
|
|
671
|
+
case "clear": {
|
|
672
|
+
dir?.clear();
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
case "createSubDirectory": {
|
|
676
|
+
dir?.createSubDirectory(directoryOp.subdirName);
|
|
677
|
+
break;
|
|
678
|
+
}
|
|
679
|
+
case "delete": {
|
|
680
|
+
dir?.delete(directoryOp.key);
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
case "deleteSubDirectory": {
|
|
684
|
+
dir?.deleteSubDirectory(directoryOp.subdirName);
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
case "set": {
|
|
688
|
+
dir?.set(directoryOp.key, this.localValueMaker.fromSerializable(directoryOp.value, this.serializer, this.handle).value);
|
|
689
|
+
break;
|
|
690
|
+
}
|
|
691
|
+
default: {
|
|
692
|
+
(0, core_utils_1.unreachableCase)(directoryOp);
|
|
693
|
+
}
|
|
693
694
|
}
|
|
694
|
-
return handler.applyStashedOp(op);
|
|
695
695
|
}
|
|
696
696
|
serializeDirectory(root, serializer, telemetryContext) {
|
|
697
697
|
const MinValueSizeSeparateSnapshotBlob = 8 * 1024;
|
|
@@ -774,9 +774,11 @@ function isDirectoryLocalOpMetadata(metadata) {
|
|
|
774
774
|
isSubDirLocalOpMetadata(metadata));
|
|
775
775
|
}
|
|
776
776
|
/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */
|
|
777
|
+
// eslint-disable-next-line @rushstack/no-new-null
|
|
777
778
|
function assertNonNullClientId(clientId) {
|
|
778
779
|
(0, core_utils_1.assert)(clientId !== null, 0x6af /* client id should never be null */);
|
|
779
780
|
}
|
|
781
|
+
let hasLoggedDirectoryInconsistency = false;
|
|
780
782
|
/**
|
|
781
783
|
* Node of the directory tree.
|
|
782
784
|
* @sealed
|
|
@@ -791,7 +793,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
791
793
|
* @param serializer - The serializer to serialize / parse handles
|
|
792
794
|
* @param absolutePath - The absolute path of this IDirectory
|
|
793
795
|
*/
|
|
794
|
-
constructor(seqData, clientIds, directory, runtime, serializer, absolutePath) {
|
|
796
|
+
constructor(seqData, clientIds, directory, runtime, serializer, absolutePath, logger) {
|
|
795
797
|
super();
|
|
796
798
|
this.seqData = seqData;
|
|
797
799
|
this.clientIds = clientIds;
|
|
@@ -799,6 +801,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
799
801
|
this.runtime = runtime;
|
|
800
802
|
this.serializer = serializer;
|
|
801
803
|
this.absolutePath = absolutePath;
|
|
804
|
+
this.logger = logger;
|
|
802
805
|
/**
|
|
803
806
|
* Tells if the sub directory is deleted or not.
|
|
804
807
|
*/
|
|
@@ -896,7 +899,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
896
899
|
}
|
|
897
900
|
// Create a local value and serialize it.
|
|
898
901
|
const localValue = this.directory.localValueMaker.fromInMemory(value);
|
|
899
|
-
const serializableValue = (0,
|
|
902
|
+
const serializableValue = (0, localValues_js_1.makeSerializable)(localValue, this.serializer, this.directory.handle);
|
|
900
903
|
// Set the value locally.
|
|
901
904
|
const previousValue = this.setCore(key, localValue, true);
|
|
902
905
|
// If we are not attached, don't submit the op.
|
|
@@ -950,13 +953,15 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
950
953
|
return subDir;
|
|
951
954
|
}
|
|
952
955
|
/**
|
|
953
|
-
*
|
|
956
|
+
* Gets the Sequence Data which should be used for local changes.
|
|
957
|
+
*
|
|
954
958
|
* @remarks While detached, 0 is used rather than -1 to represent a change which should be universally known (as opposed to known
|
|
955
959
|
* only by the local client). This ensures that if the directory is later attached, none of its data needs to be updated (the values
|
|
956
960
|
* last set while detached will now be known to any new client, until they are changed).
|
|
957
961
|
*
|
|
958
962
|
* The client sequence number is incremented by 1 for maintaining the internal order of locally created subdirectories
|
|
959
|
-
*
|
|
963
|
+
*
|
|
964
|
+
* @privateRemarks TODO: Convert these conventions to named constants. The semantics used here match those for merge-tree.
|
|
960
965
|
*/
|
|
961
966
|
getLocalSeq() {
|
|
962
967
|
return this.directory.isAttached()
|
|
@@ -1007,7 +1012,23 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1007
1012
|
const ackedSubdirsInOrder = this.ackedCreationSeqTracker.keys();
|
|
1008
1013
|
const localSubdirsInOrder = this.localCreationSeqTracker.keys((key) => !this.ackedCreationSeqTracker.has(key));
|
|
1009
1014
|
const subdirNames = [...ackedSubdirsInOrder, ...localSubdirsInOrder];
|
|
1010
|
-
|
|
1015
|
+
if (subdirNames.length !== this._subdirectories.size) {
|
|
1016
|
+
// TODO: AB#7022: Hitting this block indicates that the eventual consistency scheme for ordering subdirectories
|
|
1017
|
+
// has failed. Fall back to previous directory behavior, which didn't guarantee ordering.
|
|
1018
|
+
// It's not currently clear how to reach this state, so log some diagnostics to help understand the issue.
|
|
1019
|
+
// This whole block should eventually be replaced by an assert that the two sizes align.
|
|
1020
|
+
if (!hasLoggedDirectoryInconsistency) {
|
|
1021
|
+
this.logger.sendTelemetryEvent({
|
|
1022
|
+
eventName: "inconsistentSubdirectoryOrdering",
|
|
1023
|
+
localKeyCount: this.localCreationSeqTracker.size,
|
|
1024
|
+
ackedKeyCount: this.ackedCreationSeqTracker.size,
|
|
1025
|
+
subdirNamesLength: subdirNames.length,
|
|
1026
|
+
subdirectoriesSize: this._subdirectories.size,
|
|
1027
|
+
});
|
|
1028
|
+
hasLoggedDirectoryInconsistency = true;
|
|
1029
|
+
}
|
|
1030
|
+
return this._subdirectories.entries();
|
|
1031
|
+
}
|
|
1011
1032
|
const entriesIterator = {
|
|
1012
1033
|
index: 0,
|
|
1013
1034
|
dirs: this._subdirectories,
|
|
@@ -1015,6 +1036,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1015
1036
|
if (this.index < subdirNames.length) {
|
|
1016
1037
|
const subdirName = subdirNames[this.index++];
|
|
1017
1038
|
const subdir = this.dirs.get(subdirName);
|
|
1039
|
+
(0, core_utils_1.assert)(subdir !== undefined, 0x8ac /* Could not find expected sub-directory. */);
|
|
1018
1040
|
return { value: [subdirName, subdir], done: false };
|
|
1019
1041
|
}
|
|
1020
1042
|
return { value: undefined, done: true };
|
|
@@ -1163,7 +1185,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1163
1185
|
* @param local - Whether the message originated from the local client
|
|
1164
1186
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1165
1187
|
* For messages from a remote client, this will be undefined.
|
|
1166
|
-
* @internal
|
|
1167
1188
|
*/
|
|
1168
1189
|
processClearMessage(msg, op, local, localOpMetadata) {
|
|
1169
1190
|
this.throwIfDisposed();
|
|
@@ -1178,24 +1199,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1178
1199
|
}
|
|
1179
1200
|
this.clearExceptPendingKeys(false);
|
|
1180
1201
|
}
|
|
1181
|
-
/**
|
|
1182
|
-
* Apply clear operation locally and generate metadata
|
|
1183
|
-
* @param op - Op to apply
|
|
1184
|
-
* @returns metadata generated for stahed op
|
|
1185
|
-
*/
|
|
1186
|
-
applyStashedClearMessage(op) {
|
|
1187
|
-
this.throwIfDisposed();
|
|
1188
|
-
const previousValue = new Map(this._storage);
|
|
1189
|
-
this.clearExceptPendingKeys(true);
|
|
1190
|
-
const pendingMsgId = ++this.pendingMessageId;
|
|
1191
|
-
this.pendingClearMessageIds.push(pendingMsgId);
|
|
1192
|
-
const metadata = {
|
|
1193
|
-
type: "clear",
|
|
1194
|
-
pendingMessageId: pendingMsgId,
|
|
1195
|
-
previousStorage: previousValue,
|
|
1196
|
-
};
|
|
1197
|
-
return metadata;
|
|
1198
|
-
}
|
|
1199
1202
|
/**
|
|
1200
1203
|
* Process a delete operation.
|
|
1201
1204
|
* @param msg - The message from the server to apply.
|
|
@@ -1203,7 +1206,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1203
1206
|
* @param local - Whether the message originated from the local client
|
|
1204
1207
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1205
1208
|
* For messages from a remote client, this will be undefined.
|
|
1206
|
-
* @internal
|
|
1207
1209
|
*/
|
|
1208
1210
|
processDeleteMessage(msg, op, local, localOpMetadata) {
|
|
1209
1211
|
this.throwIfDisposed();
|
|
@@ -1213,22 +1215,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1213
1215
|
}
|
|
1214
1216
|
this.deleteCore(op.key, local);
|
|
1215
1217
|
}
|
|
1216
|
-
/**
|
|
1217
|
-
* Apply delete operation locally and generate metadata
|
|
1218
|
-
* @param op - Op to apply
|
|
1219
|
-
* @returns metadata generated for stahed op
|
|
1220
|
-
*/
|
|
1221
|
-
applyStashedDeleteMessage(op) {
|
|
1222
|
-
this.throwIfDisposed();
|
|
1223
|
-
const previousValue = this.deleteCore(op.key, true);
|
|
1224
|
-
const pendingMessageId = this.getKeyMessageId(op);
|
|
1225
|
-
const localMetadata = {
|
|
1226
|
-
type: "edit",
|
|
1227
|
-
pendingMessageId,
|
|
1228
|
-
previousValue,
|
|
1229
|
-
};
|
|
1230
|
-
return localMetadata;
|
|
1231
|
-
}
|
|
1232
1218
|
/**
|
|
1233
1219
|
* Process a set operation.
|
|
1234
1220
|
* @param msg - The message from the server to apply.
|
|
@@ -1236,7 +1222,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1236
1222
|
* @param local - Whether the message originated from the local client
|
|
1237
1223
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1238
1224
|
* For messages from a remote client, this will be undefined.
|
|
1239
|
-
* @internal
|
|
1240
1225
|
*/
|
|
1241
1226
|
processSetMessage(msg, op, context, local, localOpMetadata) {
|
|
1242
1227
|
this.throwIfDisposed();
|
|
@@ -1249,24 +1234,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1249
1234
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1250
1235
|
this.setCore(op.key, context, local);
|
|
1251
1236
|
}
|
|
1252
|
-
/**
|
|
1253
|
-
* Apply set operation locally and generate metadata
|
|
1254
|
-
* @param op - Op to apply
|
|
1255
|
-
* @returns metadata generated for stahed op
|
|
1256
|
-
*/
|
|
1257
|
-
applyStashedSetMessage(op, context) {
|
|
1258
|
-
this.throwIfDisposed();
|
|
1259
|
-
// Set the value locally.
|
|
1260
|
-
const previousValue = this.setCore(op.key, context, true);
|
|
1261
|
-
// Create metadata
|
|
1262
|
-
const pendingMessageId = this.getKeyMessageId(op);
|
|
1263
|
-
const localMetadata = {
|
|
1264
|
-
type: "edit",
|
|
1265
|
-
pendingMessageId,
|
|
1266
|
-
previousValue,
|
|
1267
|
-
};
|
|
1268
|
-
return localMetadata;
|
|
1269
|
-
}
|
|
1270
1237
|
/**
|
|
1271
1238
|
* Process a create subdirectory operation.
|
|
1272
1239
|
* @param msg - The message from the server to apply.
|
|
@@ -1274,7 +1241,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1274
1241
|
* @param local - Whether the message originated from the local client
|
|
1275
1242
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1276
1243
|
* For messages from a remote client, this will be undefined.
|
|
1277
|
-
* @internal
|
|
1278
1244
|
*/
|
|
1279
1245
|
processCreateSubDirectoryMessage(msg, op, local, localOpMetadata) {
|
|
1280
1246
|
this.throwIfDisposed();
|
|
@@ -1285,21 +1251,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1285
1251
|
assertNonNullClientId(msg.clientId);
|
|
1286
1252
|
this.createSubDirectoryCore(op.subdirName, local, { seq: msg.sequenceNumber, clientSeq: msg.clientSequenceNumber }, msg.clientId);
|
|
1287
1253
|
}
|
|
1288
|
-
/**
|
|
1289
|
-
* Apply createSubDirectory operation locally and generate metadata
|
|
1290
|
-
* @param op - Op to apply
|
|
1291
|
-
* @returns metadata generated for stahed op
|
|
1292
|
-
*/
|
|
1293
|
-
applyStashedCreateSubDirMessage(op) {
|
|
1294
|
-
this.throwIfDisposed();
|
|
1295
|
-
// Create the sub directory locally first.
|
|
1296
|
-
this.createSubDirectoryCore(op.subdirName, true, this.getLocalSeq(), this.runtime.clientId ?? "detached");
|
|
1297
|
-
this.updatePendingSubDirMessageCount(op);
|
|
1298
|
-
const localOpMetadata = {
|
|
1299
|
-
type: "createSubDir",
|
|
1300
|
-
};
|
|
1301
|
-
return localOpMetadata;
|
|
1302
|
-
}
|
|
1303
1254
|
/**
|
|
1304
1255
|
* Process a delete subdirectory operation.
|
|
1305
1256
|
* @param msg - The message from the server to apply.
|
|
@@ -1307,7 +1258,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1307
1258
|
* @param local - Whether the message originated from the local client
|
|
1308
1259
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1309
1260
|
* For messages from a remote client, this will be undefined.
|
|
1310
|
-
* @internal
|
|
1311
1261
|
*/
|
|
1312
1262
|
processDeleteSubDirectoryMessage(msg, op, local, localOpMetadata) {
|
|
1313
1263
|
this.throwIfDisposed();
|
|
@@ -1317,21 +1267,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1317
1267
|
}
|
|
1318
1268
|
this.deleteSubDirectoryCore(op.subdirName, local);
|
|
1319
1269
|
}
|
|
1320
|
-
/**
|
|
1321
|
-
* Apply deleteSubDirectory operation locally and generate metadata
|
|
1322
|
-
* @param op - Op to apply
|
|
1323
|
-
* @returns metadata generated for stahed op
|
|
1324
|
-
*/
|
|
1325
|
-
applyStashedDeleteSubDirMessage(op) {
|
|
1326
|
-
this.throwIfDisposed();
|
|
1327
|
-
const subDir = this.deleteSubDirectoryCore(op.subdirName, true);
|
|
1328
|
-
this.updatePendingSubDirMessageCount(op);
|
|
1329
|
-
const metadata = {
|
|
1330
|
-
type: "deleteSubDir",
|
|
1331
|
-
subDirectory: subDir,
|
|
1332
|
-
};
|
|
1333
|
-
return metadata;
|
|
1334
|
-
}
|
|
1335
1270
|
/**
|
|
1336
1271
|
* Submit a clear operation.
|
|
1337
1272
|
* @param op - The operation
|
|
@@ -1350,7 +1285,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1350
1285
|
/**
|
|
1351
1286
|
* Resubmit a clear operation.
|
|
1352
1287
|
* @param op - The operation
|
|
1353
|
-
* @internal
|
|
1354
1288
|
*/
|
|
1355
1289
|
resubmitClearMessage(op, localOpMetadata) {
|
|
1356
1290
|
(0, core_utils_1.assert)(isClearLocalOpMetadata(localOpMetadata), 0x32b /* Invalid localOpMetadata for clear */);
|
|
@@ -1369,11 +1303,11 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1369
1303
|
// We don't reuse the metadata pendingMessageId but send a new one on each submit.
|
|
1370
1304
|
const pendingMessageId = ++this.pendingMessageId;
|
|
1371
1305
|
const pendingMessageIds = this.pendingKeys.get(op.key);
|
|
1372
|
-
if (pendingMessageIds
|
|
1373
|
-
|
|
1306
|
+
if (pendingMessageIds === undefined) {
|
|
1307
|
+
this.pendingKeys.set(op.key, [pendingMessageId]);
|
|
1374
1308
|
}
|
|
1375
1309
|
else {
|
|
1376
|
-
|
|
1310
|
+
pendingMessageIds.push(pendingMessageId);
|
|
1377
1311
|
}
|
|
1378
1312
|
return pendingMessageId;
|
|
1379
1313
|
}
|
|
@@ -1392,7 +1326,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1392
1326
|
* Submit a key message to remote clients based on a previous submit.
|
|
1393
1327
|
* @param op - The map key message
|
|
1394
1328
|
* @param localOpMetadata - Metadata from the previous submit
|
|
1395
|
-
* @internal
|
|
1396
1329
|
*/
|
|
1397
1330
|
resubmitKeyMessage(op, localOpMetadata) {
|
|
1398
1331
|
(0, core_utils_1.assert)(isKeyEditLocalOpMetadata(localOpMetadata), 0x32d /* Invalid localOpMetadata in submit */);
|
|
@@ -1401,7 +1334,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1401
1334
|
// Only submit the op, if we have record for it, otherwise it is possible that the older instance
|
|
1402
1335
|
// is already deleted, in which case we don't need to submit the op.
|
|
1403
1336
|
if (pendingMessageIds !== undefined) {
|
|
1404
|
-
const index = pendingMessageIds.
|
|
1337
|
+
const index = pendingMessageIds.indexOf(localOpMetadata.pendingMessageId);
|
|
1405
1338
|
if (index === -1) {
|
|
1406
1339
|
return;
|
|
1407
1340
|
}
|
|
@@ -1465,7 +1398,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1465
1398
|
* Submit a subdirectory operation again
|
|
1466
1399
|
* @param op - The operation
|
|
1467
1400
|
* @param localOpMetadata - metadata submitted with the op originally
|
|
1468
|
-
* @internal
|
|
1469
1401
|
*/
|
|
1470
1402
|
resubmitSubDirectoryMessage(op, localOpMetadata) {
|
|
1471
1403
|
(0, core_utils_1.assert)(isSubDirLocalOpMetadata(localOpMetadata), 0x32f /* Invalid localOpMetadata for sub directory op */);
|
|
@@ -1492,7 +1424,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1492
1424
|
* Get the storage of this subdirectory in a serializable format, to be used in snapshotting.
|
|
1493
1425
|
* @param serializer - The serializer to use to serialize handles in its values.
|
|
1494
1426
|
* @returns The JSONable string representing the storage of this subdirectory
|
|
1495
|
-
* @internal
|
|
1496
1427
|
*/
|
|
1497
1428
|
*getSerializedStorage(serializer) {
|
|
1498
1429
|
this.throwIfDisposed();
|
|
@@ -1506,7 +1437,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1506
1437
|
this.throwIfDisposed();
|
|
1507
1438
|
const createInfo = {
|
|
1508
1439
|
csn: this.seqData.seq,
|
|
1509
|
-
ccIds:
|
|
1440
|
+
ccIds: [...this.clientIds],
|
|
1510
1441
|
};
|
|
1511
1442
|
return createInfo;
|
|
1512
1443
|
}
|
|
@@ -1514,7 +1445,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1514
1445
|
* Populate a key value in this subdirectory's storage, to be used when loading from snapshot.
|
|
1515
1446
|
* @param key - The key to populate
|
|
1516
1447
|
* @param localValue - The local value to populate into it
|
|
1517
|
-
* @internal
|
|
1518
1448
|
*/
|
|
1519
1449
|
populateStorage(key, localValue) {
|
|
1520
1450
|
this.throwIfDisposed();
|
|
@@ -1524,7 +1454,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1524
1454
|
* Populate a subdirectory into this subdirectory, to be used when loading from snapshot.
|
|
1525
1455
|
* @param subdirName - The name of the subdirectory to add
|
|
1526
1456
|
* @param newSubDir - The new subdirectory to add
|
|
1527
|
-
* @internal
|
|
1528
1457
|
*/
|
|
1529
1458
|
populateSubDirectory(subdirName, newSubDir) {
|
|
1530
1459
|
this.throwIfDisposed();
|
|
@@ -1535,7 +1464,6 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1535
1464
|
* value so op handlers can be retrieved
|
|
1536
1465
|
* @param key - The key to retrieve from
|
|
1537
1466
|
* @returns The local value
|
|
1538
|
-
* @internal
|
|
1539
1467
|
*/
|
|
1540
1468
|
getLocalValue(key) {
|
|
1541
1469
|
this.throwIfDisposed();
|
|
@@ -1578,37 +1506,46 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1578
1506
|
}
|
|
1579
1507
|
}
|
|
1580
1508
|
else if ((op.type === "delete" || op.type === "set") && localOpMetadata.type === "edit") {
|
|
1509
|
+
const key = op.key;
|
|
1510
|
+
(0, core_utils_1.assert)(key !== undefined, 0x8ad /* "key" property is missing from edit operation. */);
|
|
1511
|
+
(0, core_utils_1.assert)(typeof key === "string", 0x8ae /* "key" property in edit operation is misconfigured. Expected a string. */);
|
|
1581
1512
|
if (localOpMetadata.previousValue === undefined) {
|
|
1582
|
-
this.deleteCore(
|
|
1513
|
+
this.deleteCore(key, true);
|
|
1583
1514
|
}
|
|
1584
1515
|
else {
|
|
1585
|
-
this.setCore(
|
|
1516
|
+
this.setCore(key, localOpMetadata.previousValue, true);
|
|
1586
1517
|
}
|
|
1587
|
-
this.rollbackPendingMessageId(this.pendingKeys,
|
|
1518
|
+
this.rollbackPendingMessageId(this.pendingKeys, key, localOpMetadata.pendingMessageId);
|
|
1588
1519
|
}
|
|
1589
1520
|
else if (op.type === "createSubDirectory" && localOpMetadata.type === "createSubDir") {
|
|
1590
|
-
|
|
1591
|
-
|
|
1521
|
+
const subdirName = op.subdirName;
|
|
1522
|
+
(0, core_utils_1.assert)(subdirName !== undefined, 0x8af /* "subdirName" property is missing from "createSubDirectory" operation. */);
|
|
1523
|
+
(0, core_utils_1.assert)(typeof subdirName === "string", 0x8b0 /* "subdirName" property in "createSubDirectory" operation is misconfigured. Expected a string. */);
|
|
1524
|
+
this.deleteSubDirectoryCore(subdirName, true);
|
|
1525
|
+
this.decrementPendingSubDirCount(this.pendingCreateSubDirectoriesTracker, subdirName);
|
|
1592
1526
|
}
|
|
1593
1527
|
else if (op.type === "deleteSubDirectory" && localOpMetadata.type === "deleteSubDir") {
|
|
1528
|
+
const subdirName = op.subdirName;
|
|
1529
|
+
(0, core_utils_1.assert)(subdirName !== undefined, 0x8b1 /* "subdirName" property is missing from "deleteSubDirectory" operation. */);
|
|
1530
|
+
(0, core_utils_1.assert)(typeof subdirName === "string", 0x8b2 /* "subdirName" property in "deleteSubDirectory" operation is misconfigured. Expected a string. */);
|
|
1594
1531
|
if (localOpMetadata.subDirectory !== undefined) {
|
|
1595
1532
|
this.undeleteSubDirectoryTree(localOpMetadata.subDirectory);
|
|
1596
1533
|
// don't need to register events because deleting never unregistered
|
|
1597
|
-
this._subdirectories.set(
|
|
1534
|
+
this._subdirectories.set(subdirName, localOpMetadata.subDirectory);
|
|
1598
1535
|
// Restore the record in creation tracker
|
|
1599
1536
|
if (isAcknowledgedOrDetached(localOpMetadata.subDirectory.seqData)) {
|
|
1600
|
-
this.ackedCreationSeqTracker.set(
|
|
1537
|
+
this.ackedCreationSeqTracker.set(subdirName, {
|
|
1601
1538
|
...localOpMetadata.subDirectory.seqData,
|
|
1602
1539
|
});
|
|
1603
1540
|
}
|
|
1604
1541
|
else {
|
|
1605
|
-
this.localCreationSeqTracker.set(
|
|
1542
|
+
this.localCreationSeqTracker.set(subdirName, {
|
|
1606
1543
|
...localOpMetadata.subDirectory.seqData,
|
|
1607
1544
|
});
|
|
1608
1545
|
}
|
|
1609
|
-
this.emit("subDirectoryCreated",
|
|
1546
|
+
this.emit("subDirectoryCreated", subdirName, true, this);
|
|
1610
1547
|
}
|
|
1611
|
-
this.decrementPendingSubDirCount(this.pendingDeleteSubDirectoriesTracker,
|
|
1548
|
+
this.decrementPendingSubDirCount(this.pendingDeleteSubDirectoriesTracker, subdirName);
|
|
1612
1549
|
}
|
|
1613
1550
|
else {
|
|
1614
1551
|
throw new Error("Unsupported op for rollback");
|
|
@@ -1852,16 +1789,16 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1852
1789
|
const subdir = this._subdirectories.get(subdirName);
|
|
1853
1790
|
if (subdir === undefined) {
|
|
1854
1791
|
const absolutePath = posix.join(this.absolutePath, subdirName);
|
|
1855
|
-
const subDir = new SubDirectory({ ...seqData }, new Set([clientId]), this.directory, this.runtime, this.serializer, absolutePath);
|
|
1792
|
+
const subDir = new SubDirectory({ ...seqData }, new Set([clientId]), this.directory, this.runtime, this.serializer, absolutePath, this.logger);
|
|
1856
1793
|
/**
|
|
1857
1794
|
* Store the sequnce numbers of newly created subdirectory to the proper creation tracker, based
|
|
1858
1795
|
* on whether the creation behavior has been ack'd or not
|
|
1859
1796
|
*/
|
|
1860
|
-
if (
|
|
1861
|
-
this.
|
|
1797
|
+
if (isAcknowledgedOrDetached(seqData)) {
|
|
1798
|
+
this.ackedCreationSeqTracker.set(subdirName, { ...seqData });
|
|
1862
1799
|
}
|
|
1863
1800
|
else {
|
|
1864
|
-
this.
|
|
1801
|
+
this.localCreationSeqTracker.set(subdirName, { ...seqData });
|
|
1865
1802
|
}
|
|
1866
1803
|
this.registerEventsOnSubDirectory(subDir, subdirName);
|
|
1867
1804
|
this._subdirectories.set(subdirName, subDir);
|