@fluidframework/map 2.0.0-dev.4.1.0.148229 → 2.0.0-dev.4.2.0.153917

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 const pkgName = "@fluidframework/map";
8
- export const pkgVersion = "2.0.0-dev.4.1.0.148229";
8
+ export const pkgVersion = "2.0.0-dev.4.2.0.153917";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,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-dev.4.1.0.148229\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,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-dev.4.2.0.153917\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/map",
3
- "version": "2.0.0-dev.4.1.0.148229",
3
+ "version": "2.0.0-dev.4.2.0.153917",
4
4
  "description": "Distributed map",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -37,27 +37,27 @@
37
37
  "dependencies": {
38
38
  "@fluidframework/common-definitions": "^0.20.1",
39
39
  "@fluidframework/common-utils": "^1.1.1",
40
- "@fluidframework/container-utils": "2.0.0-dev.4.1.0.148229",
41
- "@fluidframework/core-interfaces": "2.0.0-dev.4.1.0.148229",
42
- "@fluidframework/datastore-definitions": "2.0.0-dev.4.1.0.148229",
43
- "@fluidframework/driver-utils": "2.0.0-dev.4.1.0.148229",
40
+ "@fluidframework/container-utils": "2.0.0-dev.4.2.0.153917",
41
+ "@fluidframework/core-interfaces": "2.0.0-dev.4.2.0.153917",
42
+ "@fluidframework/datastore-definitions": "2.0.0-dev.4.2.0.153917",
43
+ "@fluidframework/driver-utils": "2.0.0-dev.4.2.0.153917",
44
44
  "@fluidframework/protocol-definitions": "^1.1.0",
45
- "@fluidframework/runtime-definitions": "2.0.0-dev.4.1.0.148229",
46
- "@fluidframework/runtime-utils": "2.0.0-dev.4.1.0.148229",
47
- "@fluidframework/shared-object-base": "2.0.0-dev.4.1.0.148229",
45
+ "@fluidframework/runtime-definitions": "2.0.0-dev.4.2.0.153917",
46
+ "@fluidframework/runtime-utils": "2.0.0-dev.4.2.0.153917",
47
+ "@fluidframework/shared-object-base": "2.0.0-dev.4.2.0.153917",
48
48
  "path-browserify": "^1.0.1"
49
49
  },
50
50
  "devDependencies": {
51
- "@fluid-internal/stochastic-test-utils": "2.0.0-dev.4.1.0.148229",
52
- "@fluid-internal/test-dds-utils": "2.0.0-dev.4.1.0.148229",
53
- "@fluid-tools/benchmark": "0.47.0-140906",
54
- "@fluid-tools/build-cli": "^0.13.1",
51
+ "@fluid-internal/stochastic-test-utils": "2.0.0-dev.4.2.0.153917",
52
+ "@fluid-internal/test-dds-utils": "2.0.0-dev.4.2.0.153917",
53
+ "@fluid-tools/benchmark": "^0.47.0",
54
+ "@fluid-tools/build-cli": "^0.15.0",
55
55
  "@fluidframework/build-common": "^1.1.0",
56
- "@fluidframework/build-tools": "^0.13.1",
56
+ "@fluidframework/build-tools": "^0.15.0",
57
57
  "@fluidframework/eslint-config-fluid": "^2.0.0",
58
58
  "@fluidframework/map-previous": "npm:@fluidframework/map@2.0.0-internal.4.0.0",
59
- "@fluidframework/mocha-test-setup": "2.0.0-dev.4.1.0.148229",
60
- "@fluidframework/test-runtime-utils": "2.0.0-dev.4.1.0.148229",
59
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.4.2.0.153917",
60
+ "@fluidframework/test-runtime-utils": "2.0.0-dev.4.2.0.153917",
61
61
  "@microsoft/api-extractor": "^7.34.4",
62
62
  "@types/mocha": "^9.1.1",
63
63
  "@types/node": "^14.18.38",
package/src/directory.ts CHANGED
@@ -743,29 +743,30 @@ export class SharedDirectory
743
743
  }
744
744
 
745
745
  /**
746
- * This checks if there is pending delete op for local delete for a subdirectory.
746
+ * This checks if there is pending delete op for local delete for a any subdir in the relative path.
747
747
  * @param relativePath - path of sub directory.
748
748
  * @returns - true if there is pending delete.
749
749
  */
750
750
  private isSubDirectoryDeletePending(relativePath: string): boolean {
751
- const parentSubDir = this.getParentDirectory(relativePath);
752
- const index = relativePath.lastIndexOf(posix.sep);
753
- const dirName = relativePath.substring(index + 1);
754
- return !!parentSubDir?.isSubDirectoryDeletePending(dirName);
755
- }
756
-
757
- /**
758
- * Gets the parent directory of a sub directory.
759
- * @param relativePath - path of sub directory of which parent needs to be find out.
760
- */
761
- private getParentDirectory(relativePath: string): SubDirectory | undefined {
762
751
  const absolutePath = this.makeAbsolute(relativePath);
763
752
  if (absolutePath === posix.sep) {
764
- return undefined;
753
+ return false;
765
754
  }
766
- const index = absolutePath.lastIndexOf(posix.sep);
767
- const parentAbsPath = absolutePath.substring(0, index);
768
- return this.getWorkingDirectory(parentAbsPath) as SubDirectory;
755
+ let currentParent = this.root;
756
+ const nodeList = absolutePath.split(posix.sep);
757
+ let start = 1;
758
+ while (start < nodeList.length) {
759
+ const subDirName = nodeList[start];
760
+ if (currentParent.isSubDirectoryDeletePending(subDirName)) {
761
+ return true;
762
+ }
763
+ currentParent = currentParent.getSubDirectory(subDirName) as SubDirectory;
764
+ if (currentParent === undefined) {
765
+ return true;
766
+ }
767
+ start += 1;
768
+ }
769
+ return false;
769
770
  }
770
771
 
771
772
  /**
@@ -780,8 +781,8 @@ export class SharedDirectory
780
781
  localOpMetadata,
781
782
  ) => {
782
783
  const subdir = this.getWorkingDirectory(op.path) as SubDirectory | undefined;
783
- // If there is pending delete op for this subDirectory, then don't apply the this op as we are going
784
- // to delete this subDirectory.
784
+ // If there is pending delete op for any subDirectory in the op.path, then don't apply the this op
785
+ // as we are going to delete this subDirectory.
785
786
  if (subdir && !this.isSubDirectoryDeletePending(op.path)) {
786
787
  subdir.processClearMessage(msg, op, local, localOpMetadata);
787
788
  }
@@ -807,8 +808,8 @@ export class SharedDirectory
807
808
  localOpMetadata,
808
809
  ) => {
809
810
  const subdir = this.getWorkingDirectory(op.path) as SubDirectory | undefined;
810
- // If there is pending delete op for this subDirectory, then don't apply the this op as we are going
811
- // to delete this subDirectory.
811
+ // If there is pending delete op for any subDirectory in the op.path, then don't apply the this op
812
+ // as we are going to delete this subDirectory.
812
813
  if (subdir && !this.isSubDirectoryDeletePending(op.path)) {
813
814
  subdir.processDeleteMessage(msg, op, local, localOpMetadata);
814
815
  }
@@ -836,8 +837,8 @@ export class SharedDirectory
836
837
  localOpMetadata,
837
838
  ) => {
838
839
  const subdir = this.getWorkingDirectory(op.path) as SubDirectory | undefined;
839
- // If there is pending delete op for this subDirectory, then don't apply the this op as we are going
840
- // to delete this subDirectory.
840
+ // If there is pending delete op for any subDirectory in the op.path, then don't apply the this op
841
+ // as we are going to delete this subDirectory.
841
842
  if (subdir && !this.isSubDirectoryDeletePending(op.path)) {
842
843
  const context = local ? undefined : this.makeLocal(op.key, op.path, op.value);
843
844
  subdir.processSetMessage(msg, op, context, local, localOpMetadata);
@@ -866,7 +867,9 @@ export class SharedDirectory
866
867
  localOpMetadata,
867
868
  ) => {
868
869
  const parentSubdir = this.getWorkingDirectory(op.path) as SubDirectory | undefined;
869
- if (parentSubdir) {
870
+ // If there is pending delete op for any subDirectory in the op.path, then don't apply the this op
871
+ // as we are going to delete this subDirectory.
872
+ if (parentSubdir && !this.isSubDirectoryDeletePending(op.path)) {
870
873
  parentSubdir.processCreateSubDirectoryMessage(msg, op, local, localOpMetadata);
871
874
  }
872
875
  },
@@ -895,7 +898,9 @@ export class SharedDirectory
895
898
  localOpMetadata,
896
899
  ) => {
897
900
  const parentSubdir = this.getWorkingDirectory(op.path) as SubDirectory | undefined;
898
- if (parentSubdir) {
901
+ // If there is pending delete op for any subDirectory in the op.path, then don't apply the this op
902
+ // as we are going to delete this subDirectory.
903
+ if (parentSubdir && !this.isSubDirectoryDeletePending(op.path)) {
899
904
  parentSubdir.processDeleteSubDirectoryMessage(msg, op, local, localOpMetadata);
900
905
  }
901
906
  },
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/map";
9
- export const pkgVersion = "2.0.0-dev.4.1.0.148229";
9
+ export const pkgVersion = "2.0.0-dev.4.2.0.153917";