@fluid-experimental/tree 0.59.2002 → 0.59.2004

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/tree",
3
- "version": "0.59.2002",
3
+ "version": "0.59.2004",
4
4
  "description": "Distributed tree",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -38,11 +38,11 @@
38
38
  "@fluidframework/common-utils": "^0.32.1",
39
39
  "@fluidframework/container-definitions": "^0.48.1000",
40
40
  "@fluidframework/core-interfaces": "^0.43.1000",
41
- "@fluidframework/datastore-definitions": "^0.59.2002",
41
+ "@fluidframework/datastore-definitions": "^0.59.2004",
42
42
  "@fluidframework/protocol-definitions": "^0.1028.1000",
43
- "@fluidframework/runtime-definitions": "^0.59.2002",
44
- "@fluidframework/shared-object-base": "^0.59.2002",
45
- "@fluidframework/telemetry-utils": "^0.59.2002",
43
+ "@fluidframework/runtime-definitions": "^0.59.2004",
44
+ "@fluidframework/shared-object-base": "^0.59.2004",
45
+ "@fluidframework/telemetry-utils": "^0.59.2004",
46
46
  "buffer": "^6.0.3",
47
47
  "denque": "^1.5.1",
48
48
  "lru-cache": "^6.0.0",
@@ -52,16 +52,16 @@
52
52
  "devDependencies": {
53
53
  "@fluid-tools/benchmark": "^0.40.0",
54
54
  "@fluidframework/build-common": "^0.23.0",
55
- "@fluidframework/container-loader": "^0.59.2002",
56
- "@fluidframework/container-runtime": "^0.59.2002",
55
+ "@fluidframework/container-loader": "^0.59.2004",
56
+ "@fluidframework/container-runtime": "^0.59.2004",
57
57
  "@fluidframework/eslint-config-fluid": "^0.28.1000",
58
- "@fluidframework/mocha-test-setup": "^0.59.2002",
59
- "@fluidframework/runtime-utils": "^0.59.2002",
60
- "@fluidframework/test-driver-definitions": "^0.59.2002",
61
- "@fluidframework/test-drivers": "^0.59.2002",
62
- "@fluidframework/test-runtime-utils": "^0.59.2002",
63
- "@fluidframework/test-utils": "^0.59.2002",
64
- "@fluidframework/undo-redo": "^0.59.2002",
58
+ "@fluidframework/mocha-test-setup": "^0.59.2004",
59
+ "@fluidframework/runtime-utils": "^0.59.2004",
60
+ "@fluidframework/test-driver-definitions": "^0.59.2004",
61
+ "@fluidframework/test-drivers": "^0.59.2004",
62
+ "@fluidframework/test-runtime-utils": "^0.59.2004",
63
+ "@fluidframework/test-utils": "^0.59.2004",
64
+ "@fluidframework/undo-redo": "^0.59.2004",
65
65
  "@microsoft/api-extractor": "^7.22.2",
66
66
  "@rushstack/eslint-config": "^2.5.1",
67
67
  "@types/lru-cache": "^5.1.0",
package/src/SharedTree.ts CHANGED
@@ -939,9 +939,12 @@ export class SharedTree extends SharedObject<ISharedTreeEvents> implements NodeI
939
939
  };
940
940
  this.cachingLogViewer.setMinimumSequenceNumber(typedMessage.minimumSequenceNumber);
941
941
  const op = typedMessage.contents;
942
+ if (op.version === undefined) {
943
+ // Back-compat: some legacy documents may contain trailing ops with an unstamped version; normalize them.
944
+ (op as { version: WriteFormat | undefined }).version = WriteFormat.v0_0_2;
945
+ }
942
946
  const { type, version } = op;
943
- const resolvedVersion = version ?? WriteFormat.v0_0_2;
944
- const sameVersion = resolvedVersion === this.writeFormat;
947
+ const sameVersion = version === this.writeFormat;
945
948
 
946
949
  // Edit and handle ops should only be processed if they're the same version as the tree write version.
947
950
  // Update ops should only be processed if they're not the same version.
@@ -976,7 +979,7 @@ export class SharedTree extends SharedObject<ISharedTreeEvents> implements NodeI
976
979
  }
977
980
  } else if (type === SharedTreeOpType.Update) {
978
981
  this.processVersionUpdate(op.version);
979
- } else if (compareSummaryFormatVersions(resolvedVersion, this.writeFormat) === 1) {
982
+ } else if (compareSummaryFormatVersions(version, this.writeFormat) === 1) {
980
983
  // An op version newer than our current version should not be received. If this happens, either an
981
984
  // incorrect op version has been written or an update op was skipped.
982
985
  const error = 'Newer op version received by a client that has yet to be updated.';