@fluidframework/map 2.0.0-internal.7.4.5 → 2.0.0-internal.7.4.6
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/directory.cjs +26 -5
- package/dist/directory.cjs.map +1 -1
- package/dist/directory.d.ts +4 -1
- package/dist/directory.d.ts.map +1 -1
- package/dist/packageVersion.cjs +1 -1
- package/dist/packageVersion.cjs.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/lib/directory.d.ts +4 -1
- package/lib/directory.d.ts.map +1 -1
- package/lib/directory.mjs +26 -5
- package/lib/directory.mjs.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.mjs +1 -1
- package/lib/packageVersion.mjs.map +1 -1
- package/map.test-files.tar +0 -0
- package/package.json +15 -15
- package/src/directory.ts +29 -5
- package/src/packageVersion.ts +1 -1
package/dist/directory.cjs
CHANGED
|
@@ -186,6 +186,9 @@ class DirectoryCreationTracker {
|
|
|
186
186
|
}, keys);
|
|
187
187
|
return keys;
|
|
188
188
|
}
|
|
189
|
+
get size() {
|
|
190
|
+
return this.keyToIndex.size;
|
|
191
|
+
}
|
|
189
192
|
}
|
|
190
193
|
/**
|
|
191
194
|
* {@inheritDoc ISharedDirectory}
|
|
@@ -242,7 +245,7 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
242
245
|
/**
|
|
243
246
|
* Root of the SharedDirectory, most operations on the SharedDirectory itself act on the root.
|
|
244
247
|
*/
|
|
245
|
-
this.root = new SubDirectory({ seq: 0, clientSeq: 0 }, new Set(), this, this.runtime, this.serializer, posix.sep);
|
|
248
|
+
this.root = new SubDirectory({ seq: 0, clientSeq: 0 }, new Set(), this, this.runtime, this.serializer, posix.sep, this.logger);
|
|
246
249
|
/**
|
|
247
250
|
* Mapping of op types to message handlers.
|
|
248
251
|
*/
|
|
@@ -499,7 +502,7 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
499
502
|
}
|
|
500
503
|
newSubDir = new SubDirectory(seqData, createInfo !== undefined
|
|
501
504
|
? new Set(createInfo.ccIds)
|
|
502
|
-
: new Set(), this, this.runtime, this.serializer, posix.join(currentSubDir.absolutePath, subdirName));
|
|
505
|
+
: new Set(), this, this.runtime, this.serializer, posix.join(currentSubDir.absolutePath, subdirName), this.logger);
|
|
503
506
|
currentSubDir.populateSubDirectory(subdirName, newSubDir);
|
|
504
507
|
// Record the newly inserted subdirectory to the creation tracker
|
|
505
508
|
currentSubDir.ackedCreationSeqTracker.set(subdirName, {
|
|
@@ -801,6 +804,7 @@ function isDirectoryLocalOpMetadata(metadata) {
|
|
|
801
804
|
function assertNonNullClientId(clientId) {
|
|
802
805
|
(0, core_utils_1.assert)(clientId !== null, 0x6af /* client id should never be null */);
|
|
803
806
|
}
|
|
807
|
+
let hasLoggedDirectoryInconsistency = false;
|
|
804
808
|
/**
|
|
805
809
|
* Node of the directory tree.
|
|
806
810
|
* @sealed
|
|
@@ -815,7 +819,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
815
819
|
* @param serializer - The serializer to serialize / parse handles
|
|
816
820
|
* @param absolutePath - The absolute path of this IDirectory
|
|
817
821
|
*/
|
|
818
|
-
constructor(seqData, clientIds, directory, runtime, serializer, absolutePath) {
|
|
822
|
+
constructor(seqData, clientIds, directory, runtime, serializer, absolutePath, logger) {
|
|
819
823
|
super();
|
|
820
824
|
this.seqData = seqData;
|
|
821
825
|
this.clientIds = clientIds;
|
|
@@ -823,6 +827,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
823
827
|
this.runtime = runtime;
|
|
824
828
|
this.serializer = serializer;
|
|
825
829
|
this.absolutePath = absolutePath;
|
|
830
|
+
this.logger = logger;
|
|
826
831
|
/**
|
|
827
832
|
* Tells if the sub directory is deleted or not.
|
|
828
833
|
*/
|
|
@@ -1031,7 +1036,23 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1031
1036
|
const ackedSubdirsInOrder = this.ackedCreationSeqTracker.keys();
|
|
1032
1037
|
const localSubdirsInOrder = this.localCreationSeqTracker.keys((key) => !this.ackedCreationSeqTracker.has(key));
|
|
1033
1038
|
const subdirNames = [...ackedSubdirsInOrder, ...localSubdirsInOrder];
|
|
1034
|
-
|
|
1039
|
+
if (subdirNames.length !== this._subdirectories.size) {
|
|
1040
|
+
// TODO: AB#7022: Hitting this block indicates that the eventual consistency scheme for ordering subdirectories
|
|
1041
|
+
// has failed. Fall back to previous directory behavior, which didn't guarantee ordering.
|
|
1042
|
+
// It's not currently clear how to reach this state, so log some diagnostics to help understand the issue.
|
|
1043
|
+
// This whole block should eventually be replaced by an assert that the two sizes align.
|
|
1044
|
+
if (!hasLoggedDirectoryInconsistency) {
|
|
1045
|
+
this.logger.sendTelemetryEvent({
|
|
1046
|
+
eventName: "inconsistentSubdirectoryOrdering",
|
|
1047
|
+
localKeyCount: this.localCreationSeqTracker.size,
|
|
1048
|
+
ackedKeyCount: this.ackedCreationSeqTracker.size,
|
|
1049
|
+
subdirNamesLength: subdirNames.length,
|
|
1050
|
+
subdirectoriesSize: this._subdirectories.size,
|
|
1051
|
+
});
|
|
1052
|
+
hasLoggedDirectoryInconsistency = true;
|
|
1053
|
+
}
|
|
1054
|
+
return this._subdirectories.entries();
|
|
1055
|
+
}
|
|
1035
1056
|
const entriesIterator = {
|
|
1036
1057
|
index: 0,
|
|
1037
1058
|
dirs: this._subdirectories,
|
|
@@ -1876,7 +1897,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1876
1897
|
const subdir = this._subdirectories.get(subdirName);
|
|
1877
1898
|
if (subdir === undefined) {
|
|
1878
1899
|
const absolutePath = posix.join(this.absolutePath, subdirName);
|
|
1879
|
-
const subDir = new SubDirectory({ ...seqData }, new Set([clientId]), this.directory, this.runtime, this.serializer, absolutePath);
|
|
1900
|
+
const subDir = new SubDirectory({ ...seqData }, new Set([clientId]), this.directory, this.runtime, this.serializer, absolutePath, this.logger);
|
|
1880
1901
|
/**
|
|
1881
1902
|
* Store the sequnce numbers of newly created subdirectory to the proper creation tracker, based
|
|
1882
1903
|
* on whether the creation behavior has been ack'd or not
|