@fluidframework/map 2.0.0-internal.5.3.0 → 2.0.0-internal.5.3.2

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.
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/map";
8
- export declare const pkgVersion = "2.0.0-internal.5.3.0";
8
+ export declare const pkgVersion = "2.0.0-internal.5.3.2";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/map";
11
- exports.pkgVersion = "2.0.0-internal.5.3.0";
11
+ exports.pkgVersion = "2.0.0-internal.5.3.2";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,qBAAqB,CAAC;AAChC,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/map\";\nexport const pkgVersion = \"2.0.0-internal.5.3.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,qBAAqB,CAAC;AAChC,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/map\";\nexport const pkgVersion = \"2.0.0-internal.5.3.2\";\n"]}
package/lib/directory.js CHANGED
@@ -801,7 +801,7 @@ class SubDirectory extends TypedEventEmitter {
801
801
  throw new Error(`SubDirectory name may not contain ${posix.sep}`);
802
802
  }
803
803
  // Create the sub directory locally first.
804
- const isNew = this.createSubDirectoryCore(subdirName, true, -1, (_c = this.runtime.clientId) !== null && _c !== void 0 ? _c : "detached");
804
+ const isNew = this.createSubDirectoryCore(subdirName, true, this.getLocalSeq(), (_c = this.runtime.clientId) !== null && _c !== void 0 ? _c : "detached");
805
805
  const subDir = this._subdirectories.get(subdirName);
806
806
  assert(subDir !== undefined, 0x5aa /* subdirectory should exist after creation */);
807
807
  // If we are not attached, don't submit the op.
@@ -819,6 +819,16 @@ class SubDirectory extends TypedEventEmitter {
819
819
  }
820
820
  return subDir;
821
821
  }
822
+ /**
823
+ * @returns A sequenceNumber which should be used for local changes.
824
+ * @remarks - While detached, 0 is used rather than -1 to represent a change which should be universally known (as opposed to known
825
+ * only by the local client). This ensures that if the directory is later attached, none of its data needs to be updated (the values
826
+ * last set while detached will now be known to any new client, until they are changed).
827
+ * TODO: Convert these conventions to named constants. The semantics used here match those for merge-tree.
828
+ */
829
+ getLocalSeq() {
830
+ return this.directory.isAttached() ? -1 : 0;
831
+ }
822
832
  /**
823
833
  * {@inheritDoc IDirectory.getSubDirectory}
824
834
  */
@@ -1131,7 +1141,7 @@ class SubDirectory extends TypedEventEmitter {
1131
1141
  var _c;
1132
1142
  this.throwIfDisposed();
1133
1143
  // Create the sub directory locally first.
1134
- this.createSubDirectoryCore(op.subdirName, true, -1, (_c = this.runtime.clientId) !== null && _c !== void 0 ? _c : "detached");
1144
+ this.createSubDirectoryCore(op.subdirName, true, this.getLocalSeq(), (_c = this.runtime.clientId) !== null && _c !== void 0 ? _c : "detached");
1135
1145
  this.updatePendingSubDirMessageCount(op);
1136
1146
  const localOpMetadata = {
1137
1147
  type: "createSubDir",