@fluidframework/tool-utils 0.55.2 → 0.56.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.
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/snapshotNormalizer.d.ts +1 -1
- package/dist/snapshotNormalizer.d.ts.map +1 -1
- package/dist/snapshotNormalizer.js +14 -14
- package/dist/snapshotNormalizer.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/snapshotNormalizer.d.ts +1 -1
- package/lib/snapshotNormalizer.d.ts.map +1 -1
- package/lib/snapshotNormalizer.js +13 -13
- package/lib/snapshotNormalizer.js.map +1 -1
- package/package.json +3 -3
- package/src/packageVersion.ts +1 -1
- package/src/snapshotNormalizer.ts +13 -13
package/dist/packageVersion.d.ts
CHANGED
|
@@ -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/tool-utils";
|
|
8
|
-
export declare const pkgVersion = "0.
|
|
8
|
+
export declare const pkgVersion = "0.56.2";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -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/tool-utils";
|
|
11
|
-
exports.pkgVersion = "0.
|
|
11
|
+
exports.pkgVersion = "0.56.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,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,QAAQ,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/tool-utils\";\nexport const pkgVersion = \"0.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,QAAQ,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/tool-utils\";\nexport const pkgVersion = \"0.56.2\";\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { ITree } from "@fluidframework/protocol-definitions";
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const gcBlobPrefix = "__gc";
|
|
7
7
|
export interface ISnapshotNormalizerConfig {
|
|
8
8
|
blobsToNormalize?: string[];
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotNormalizer.d.ts","sourceRoot":"","sources":["../src/snapshotNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,KAAK,EAGR,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"snapshotNormalizer.d.ts","sourceRoot":"","sources":["../src/snapshotNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,KAAK,EAGR,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC,MAAM,WAAW,yBAAyB;IAEtC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAmFD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,yBAAyB,GAAG,KAAK,CAsChG"}
|
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getNormalizedSnapshot = exports.
|
|
7
|
+
exports.getNormalizedSnapshot = exports.gcBlobPrefix = void 0;
|
|
8
8
|
const protocol_base_1 = require("@fluidframework/protocol-base");
|
|
9
9
|
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
10
|
-
exports.
|
|
11
|
-
// A list of runtime blob paths whose contents should be normalized.
|
|
12
|
-
const runtimeBlobsToNormalize = [exports.gcBlobKey];
|
|
10
|
+
exports.gcBlobPrefix = "__gc";
|
|
13
11
|
/**
|
|
14
12
|
* Function that deep sorts an array. It handles cases where array elements are objects or arrays.
|
|
15
13
|
* @returns the sorted array.
|
|
@@ -68,13 +66,15 @@ function getDeepSortedObject(obj) {
|
|
|
68
66
|
*/
|
|
69
67
|
function getNormalizedBlobContent(blobContent, blobName) {
|
|
70
68
|
let content = blobContent;
|
|
71
|
-
if (blobName
|
|
72
|
-
// GC blobs may contain
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
if (blobName.startsWith(exports.gcBlobPrefix)) {
|
|
70
|
+
// GC blobs may contain `unreferencedTimestampMs` for node that became unreferenced. This is the timestamp
|
|
71
|
+
// of the last op processed or current timestamp and can differ between clients depending on when GC was run.
|
|
72
|
+
// So, remove it for the purposes of comparing snapshots.
|
|
73
|
+
const gcState = JSON.parse(content);
|
|
74
|
+
for (const [, data] of Object.entries(gcState.gcNodes)) {
|
|
75
|
+
delete data.unreferencedTimestampMs;
|
|
76
|
+
}
|
|
77
|
+
content = JSON.stringify(gcState);
|
|
78
78
|
}
|
|
79
79
|
// Deep sort the content if it's parseable.
|
|
80
80
|
try {
|
|
@@ -103,14 +103,14 @@ function getNormalizedSnapshot(snapshot, config) {
|
|
|
103
103
|
var _a;
|
|
104
104
|
// Merge blobs to normalize in the config with runtime blobs to normalize. The contents of these blobs will be
|
|
105
105
|
// parsed and deep sorted.
|
|
106
|
-
const blobsToNormalize = [...
|
|
106
|
+
const blobsToNormalize = [...(_a = config === null || config === void 0 ? void 0 : config.blobsToNormalize) !== null && _a !== void 0 ? _a : []];
|
|
107
107
|
const normalizedEntries = [];
|
|
108
108
|
for (const entry of snapshot.entries) {
|
|
109
109
|
switch (entry.type) {
|
|
110
110
|
case protocol_definitions_1.TreeEntry.Blob: {
|
|
111
111
|
let contents = entry.value.contents;
|
|
112
|
-
// If this blob has to be normalized, parse and sort the blob contents first.
|
|
113
|
-
if (blobsToNormalize.includes(entry.path)) {
|
|
112
|
+
// If this blob has to be normalized or it's a GC blob, parse and sort the blob contents first.
|
|
113
|
+
if (blobsToNormalize.includes(entry.path) || entry.path.startsWith(exports.gcBlobPrefix)) {
|
|
114
114
|
contents = getNormalizedBlobContent(contents, entry.path);
|
|
115
115
|
}
|
|
116
116
|
normalizedEntries.push(new protocol_base_1.BlobTreeEntry(entry.path, contents));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotNormalizer.js","sourceRoot":"","sources":["../src/snapshotNormalizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iEAAkG;AAClG,+EAI8C;AAEjC,QAAA,
|
|
1
|
+
{"version":3,"file":"snapshotNormalizer.js","sourceRoot":"","sources":["../src/snapshotNormalizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iEAAkG;AAClG,+EAI8C;AAEjC,QAAA,YAAY,GAAG,MA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,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAE/D,OAAO;QACH,OAAO,EAAE,iBAAiB;QAC1B,EAAE,EAAE,QAAQ,CAAC,EAAE;KAClB,CAAC;AACN,CAAC;AAtCD,sDAsCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from \"@fluidframework/protocol-base\";\nimport {\n ITree,\n TreeEntry,\n ITreeEntry,\n} from \"@fluidframework/protocol-definitions\";\n\nexport const gcBlobPrefix = \"__gc\";\n\nexport interface ISnapshotNormalizerConfig {\n // The paths of blobs whose contents should be normalized.\n blobsToNormalize?: string[];\n}\n\n/**\n * Function that deep sorts an array. It handles cases where array elements are objects or arrays.\n * @returns the sorted array.\n */\nfunction getDeepSortedArray(array: any[]): any[] {\n const sortedArray: any[] = [];\n // Sort arrays and objects, if any, in the array.\n for (const element of array) {\n if (Array.isArray(element)) {\n sortedArray.push(getDeepSortedArray(element));\n } else if (element instanceof Object) {\n sortedArray.push(getDeepSortedObject(element));\n } else {\n sortedArray.push(element);\n }\n }\n\n // Now that all the arrays and objects in this array's elements have been sorted, sort it by comparing each\n // element's stringified version.\n const sortFn = (elem1: any, elem2: any) => {\n const serializedElem1 = JSON.stringify(elem1);\n const serializedElem2 = JSON.stringify(elem2);\n return serializedElem1.localeCompare(serializedElem2);\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return sortedArray.sort(sortFn);\n}\n\n/**\n * Function that deep sorts an object. It handles cases where object properties are arrays or objects.\n * @returns the sorted object.\n */\nfunction getDeepSortedObject(obj: any): any {\n const sortedObj: any = {};\n // Sort the object keys first. Then sort arrays and objects, if any, in the object.\n const keys = Object.keys(obj).sort();\n for (const key of keys) {\n const value = obj[key];\n if (Array.isArray(value)) {\n sortedObj[key] = getDeepSortedArray(value);\n } else if (value instanceof Object) {\n sortedObj[key] = getDeepSortedObject(value);\n } else {\n sortedObj[key] = value;\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return sortedObj;\n}\n\n/**\n * Function that normalizes a blob's content. If the content is an object or an array, deep sorts them.\n * Special handling for certain runtime blobs, such as the \"gc\" blob.\n * @returns the normalized blob content.\n */\nfunction getNormalizedBlobContent(blobContent: string, blobName: string): string {\n let content = blobContent;\n if (blobName.startsWith(gcBlobPrefix)) {\n // GC blobs may contain `unreferencedTimestampMs` for node that became unreferenced. This is the timestamp\n // of the last op processed or current timestamp and can differ between clients depending on when GC was run.\n // So, remove it for the purposes of comparing snapshots.\n const gcState = JSON.parse(content);\n for (const [, data] of Object.entries(gcState.gcNodes)) {\n delete (data as any).unreferencedTimestampMs;\n }\n content = JSON.stringify(gcState);\n }\n\n // Deep sort the content if it's parseable.\n try {\n let contentObj = JSON.parse(content);\n if (Array.isArray(contentObj)) {\n contentObj = getDeepSortedArray(contentObj);\n } else if (contentObj instanceof Object) {\n contentObj = getDeepSortedObject(contentObj);\n }\n content = JSON.stringify(contentObj);\n } catch {}\n return content;\n}\n\n/**\n * Helper function that normalizes the given snapshot tree. It sorts objects and arrays in the snapshot. It also\n * normalizes certain blob contents for which the order of content does not matter. For example, garbage collection\n * blobs contains objects / arrays whose element order do not matter.\n * @param snapshot - The snapshot tree to normalize.\n * @param config - Configs to use when normalizing snapshot. For example, it can contain paths of blobs whose contents\n * should be normalized as well.\n * @returns a copy of the normalized snapshot tree.\n */\nexport function getNormalizedSnapshot(snapshot: ITree, config?: ISnapshotNormalizerConfig): ITree {\n // Merge blobs to normalize in the config with runtime blobs to normalize. The contents of these blobs will be\n // parsed and deep sorted.\n const blobsToNormalize = [ ...config?.blobsToNormalize ?? [] ];\n const normalizedEntries: ITreeEntry[] = [];\n\n for (const entry of snapshot.entries) {\n switch (entry.type) {\n case TreeEntry.Blob: {\n let contents = entry.value.contents;\n // If this blob has to be normalized or it's a GC blob, parse and sort the blob contents first.\n if (blobsToNormalize.includes(entry.path) || entry.path.startsWith(gcBlobPrefix)) {\n contents = getNormalizedBlobContent(contents, entry.path);\n }\n normalizedEntries.push(new BlobTreeEntry(entry.path, contents));\n break;\n }\n case TreeEntry.Tree: {\n normalizedEntries.push(new TreeTreeEntry(entry.path, getNormalizedSnapshot(entry.value, config)));\n break;\n }\n case TreeEntry.Attachment: {\n normalizedEntries.push(new AttachmentTreeEntry(entry.path, (entry.value).id));\n break;\n }\n\n default:\n throw new Error(\"Unknown entry type\");\n }\n }\n\n // Sory the tree entries based on their path.\n normalizedEntries.sort((a, b) => a.path.localeCompare(b.path));\n\n return {\n entries: normalizedEntries,\n id: snapshot.id,\n };\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -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/tool-utils";
|
|
8
|
-
export declare const pkgVersion = "0.
|
|
8
|
+
export declare const pkgVersion = "0.56.2";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,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/tool-utils\";\nexport const pkgVersion = \"0.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,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/tool-utils\";\nexport const pkgVersion = \"0.56.2\";\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { ITree } from "@fluidframework/protocol-definitions";
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const gcBlobPrefix = "__gc";
|
|
7
7
|
export interface ISnapshotNormalizerConfig {
|
|
8
8
|
blobsToNormalize?: string[];
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotNormalizer.d.ts","sourceRoot":"","sources":["../src/snapshotNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,KAAK,EAGR,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"snapshotNormalizer.d.ts","sourceRoot":"","sources":["../src/snapshotNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,KAAK,EAGR,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC,MAAM,WAAW,yBAAyB;IAEtC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAmFD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,yBAAyB,GAAG,KAAK,CAsChG"}
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "@fluidframework/protocol-base";
|
|
6
6
|
import { TreeEntry, } from "@fluidframework/protocol-definitions";
|
|
7
|
-
export const
|
|
8
|
-
// A list of runtime blob paths whose contents should be normalized.
|
|
9
|
-
const runtimeBlobsToNormalize = [gcBlobKey];
|
|
7
|
+
export const gcBlobPrefix = "__gc";
|
|
10
8
|
/**
|
|
11
9
|
* Function that deep sorts an array. It handles cases where array elements are objects or arrays.
|
|
12
10
|
* @returns the sorted array.
|
|
@@ -65,13 +63,15 @@ function getDeepSortedObject(obj) {
|
|
|
65
63
|
*/
|
|
66
64
|
function getNormalizedBlobContent(blobContent, blobName) {
|
|
67
65
|
let content = blobContent;
|
|
68
|
-
if (blobName
|
|
69
|
-
// GC blobs may contain
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
if (blobName.startsWith(gcBlobPrefix)) {
|
|
67
|
+
// GC blobs may contain `unreferencedTimestampMs` for node that became unreferenced. This is the timestamp
|
|
68
|
+
// of the last op processed or current timestamp and can differ between clients depending on when GC was run.
|
|
69
|
+
// So, remove it for the purposes of comparing snapshots.
|
|
70
|
+
const gcState = JSON.parse(content);
|
|
71
|
+
for (const [, data] of Object.entries(gcState.gcNodes)) {
|
|
72
|
+
delete data.unreferencedTimestampMs;
|
|
73
|
+
}
|
|
74
|
+
content = JSON.stringify(gcState);
|
|
75
75
|
}
|
|
76
76
|
// Deep sort the content if it's parseable.
|
|
77
77
|
try {
|
|
@@ -100,14 +100,14 @@ export function getNormalizedSnapshot(snapshot, config) {
|
|
|
100
100
|
var _a;
|
|
101
101
|
// Merge blobs to normalize in the config with runtime blobs to normalize. The contents of these blobs will be
|
|
102
102
|
// parsed and deep sorted.
|
|
103
|
-
const blobsToNormalize = [...
|
|
103
|
+
const blobsToNormalize = [...(_a = config === null || config === void 0 ? void 0 : config.blobsToNormalize) !== null && _a !== void 0 ? _a : []];
|
|
104
104
|
const normalizedEntries = [];
|
|
105
105
|
for (const entry of snapshot.entries) {
|
|
106
106
|
switch (entry.type) {
|
|
107
107
|
case TreeEntry.Blob: {
|
|
108
108
|
let contents = entry.value.contents;
|
|
109
|
-
// If this blob has to be normalized, parse and sort the blob contents first.
|
|
110
|
-
if (blobsToNormalize.includes(entry.path)) {
|
|
109
|
+
// If this blob has to be normalized or it's a GC blob, parse and sort the blob contents first.
|
|
110
|
+
if (blobsToNormalize.includes(entry.path) || entry.path.startsWith(gcBlobPrefix)) {
|
|
111
111
|
contents = getNormalizedBlobContent(contents, entry.path);
|
|
112
112
|
}
|
|
113
113
|
normalizedEntries.push(new BlobTreeEntry(entry.path, contents));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotNormalizer.js","sourceRoot":"","sources":["../src/snapshotNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAEH,SAAS,GAEZ,MAAM,sCAAsC,CAAC;AAE9C,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"snapshotNormalizer.js","sourceRoot":"","sources":["../src/snapshotNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAEH,SAAS,GAEZ,MAAM,sCAAsC,CAAC;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AAOnC;;;GAGG;AACH,SAAS,kBAAkB,CAAC,KAAY;IACpC,MAAM,WAAW,GAAU,EAAE,CAAC;IAC9B,iDAAiD;IACjD,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE;QACzB,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACxB,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC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ved.\n * Licensed under the MIT License.\n */\n\nimport { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from \"@fluidframework/protocol-base\";\nimport {\n ITree,\n TreeEntry,\n ITreeEntry,\n} from \"@fluidframework/protocol-definitions\";\n\nexport const gcBlobPrefix = \"__gc\";\n\nexport interface ISnapshotNormalizerConfig {\n // The paths of blobs whose contents should be normalized.\n blobsToNormalize?: string[];\n}\n\n/**\n * Function that deep sorts an array. It handles cases where array elements are objects or arrays.\n * @returns the sorted array.\n */\nfunction getDeepSortedArray(array: any[]): any[] {\n const sortedArray: any[] = [];\n // Sort arrays and objects, if any, in the array.\n for (const element of array) {\n if (Array.isArray(element)) {\n sortedArray.push(getDeepSortedArray(element));\n } else if (element instanceof Object) {\n sortedArray.push(getDeepSortedObject(element));\n } else {\n sortedArray.push(element);\n }\n }\n\n // Now that all the arrays and objects in this array's elements have been sorted, sort it by comparing each\n // element's stringified version.\n const sortFn = (elem1: any, elem2: any) => {\n const serializedElem1 = JSON.stringify(elem1);\n const serializedElem2 = JSON.stringify(elem2);\n return serializedElem1.localeCompare(serializedElem2);\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return sortedArray.sort(sortFn);\n}\n\n/**\n * Function that deep sorts an object. It handles cases where object properties are arrays or objects.\n * @returns the sorted object.\n */\nfunction getDeepSortedObject(obj: any): any {\n const sortedObj: any = {};\n // Sort the object keys first. Then sort arrays and objects, if any, in the object.\n const keys = Object.keys(obj).sort();\n for (const key of keys) {\n const value = obj[key];\n if (Array.isArray(value)) {\n sortedObj[key] = getDeepSortedArray(value);\n } else if (value instanceof Object) {\n sortedObj[key] = getDeepSortedObject(value);\n } else {\n sortedObj[key] = value;\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return sortedObj;\n}\n\n/**\n * Function that normalizes a blob's content. If the content is an object or an array, deep sorts them.\n * Special handling for certain runtime blobs, such as the \"gc\" blob.\n * @returns the normalized blob content.\n */\nfunction getNormalizedBlobContent(blobContent: string, blobName: string): string {\n let content = blobContent;\n if (blobName.startsWith(gcBlobPrefix)) {\n // GC blobs may contain `unreferencedTimestampMs` for node that became unreferenced. This is the timestamp\n // of the last op processed or current timestamp and can differ between clients depending on when GC was run.\n // So, remove it for the purposes of comparing snapshots.\n const gcState = JSON.parse(content);\n for (const [, data] of Object.entries(gcState.gcNodes)) {\n delete (data as any).unreferencedTimestampMs;\n }\n content = JSON.stringify(gcState);\n }\n\n // Deep sort the content if it's parseable.\n try {\n let contentObj = JSON.parse(content);\n if (Array.isArray(contentObj)) {\n contentObj = getDeepSortedArray(contentObj);\n } else if (contentObj instanceof Object) {\n contentObj = getDeepSortedObject(contentObj);\n }\n content = JSON.stringify(contentObj);\n } catch {}\n return content;\n}\n\n/**\n * Helper function that normalizes the given snapshot tree. It sorts objects and arrays in the snapshot. It also\n * normalizes certain blob contents for which the order of content does not matter. For example, garbage collection\n * blobs contains objects / arrays whose element order do not matter.\n * @param snapshot - The snapshot tree to normalize.\n * @param config - Configs to use when normalizing snapshot. For example, it can contain paths of blobs whose contents\n * should be normalized as well.\n * @returns a copy of the normalized snapshot tree.\n */\nexport function getNormalizedSnapshot(snapshot: ITree, config?: ISnapshotNormalizerConfig): ITree {\n // Merge blobs to normalize in the config with runtime blobs to normalize. The contents of these blobs will be\n // parsed and deep sorted.\n const blobsToNormalize = [ ...config?.blobsToNormalize ?? [] ];\n const normalizedEntries: ITreeEntry[] = [];\n\n for (const entry of snapshot.entries) {\n switch (entry.type) {\n case TreeEntry.Blob: {\n let contents = entry.value.contents;\n // If this blob has to be normalized or it's a GC blob, parse and sort the blob contents first.\n if (blobsToNormalize.includes(entry.path) || entry.path.startsWith(gcBlobPrefix)) {\n contents = getNormalizedBlobContent(contents, entry.path);\n }\n normalizedEntries.push(new BlobTreeEntry(entry.path, contents));\n break;\n }\n case TreeEntry.Tree: {\n normalizedEntries.push(new TreeTreeEntry(entry.path, getNormalizedSnapshot(entry.value, config)));\n break;\n }\n case TreeEntry.Attachment: {\n normalizedEntries.push(new AttachmentTreeEntry(entry.path, (entry.value).id));\n break;\n }\n\n default:\n throw new Error(\"Unknown entry type\");\n }\n }\n\n // Sory the tree entries based on their path.\n normalizedEntries.sort((a, b) => a.path.localeCompare(b.path));\n\n return {\n entries: normalizedEntries,\n id: snapshot.id,\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/tool-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.2",
|
|
4
4
|
"description": "Common utilities for Fluid tools",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": "https://github.com/microsoft/FluidFramework",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@fluidframework/common-utils": "^0.32.1",
|
|
60
|
-
"@fluidframework/odsp-doclib-utils": "^0.
|
|
60
|
+
"@fluidframework/odsp-doclib-utils": "^0.56.2",
|
|
61
61
|
"@fluidframework/protocol-base": "^0.1034.0",
|
|
62
62
|
"@fluidframework/protocol-definitions": "^0.1026.0",
|
|
63
63
|
"async-mutex": "^0.3.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@fluidframework/build-common": "^0.23.0",
|
|
70
70
|
"@fluidframework/eslint-config-fluid": "^0.25.0",
|
|
71
|
-
"@fluidframework/mocha-test-setup": "^0.
|
|
71
|
+
"@fluidframework/mocha-test-setup": "^0.56.2",
|
|
72
72
|
"@microsoft/api-extractor": "^7.16.1",
|
|
73
73
|
"@rushstack/eslint-config": "^2.5.1",
|
|
74
74
|
"@types/debug": "^4.1.5",
|
package/src/packageVersion.ts
CHANGED
|
@@ -10,9 +10,7 @@ import {
|
|
|
10
10
|
ITreeEntry,
|
|
11
11
|
} from "@fluidframework/protocol-definitions";
|
|
12
12
|
|
|
13
|
-
export const
|
|
14
|
-
// A list of runtime blob paths whose contents should be normalized.
|
|
15
|
-
const runtimeBlobsToNormalize = [ gcBlobKey ];
|
|
13
|
+
export const gcBlobPrefix = "__gc";
|
|
16
14
|
|
|
17
15
|
export interface ISnapshotNormalizerConfig {
|
|
18
16
|
// The paths of blobs whose contents should be normalized.
|
|
@@ -76,13 +74,15 @@ function getDeepSortedObject(obj: any): any {
|
|
|
76
74
|
*/
|
|
77
75
|
function getNormalizedBlobContent(blobContent: string, blobName: string): string {
|
|
78
76
|
let content = blobContent;
|
|
79
|
-
if (blobName
|
|
80
|
-
// GC blobs may contain
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
if (blobName.startsWith(gcBlobPrefix)) {
|
|
78
|
+
// GC blobs may contain `unreferencedTimestampMs` for node that became unreferenced. This is the timestamp
|
|
79
|
+
// of the last op processed or current timestamp and can differ between clients depending on when GC was run.
|
|
80
|
+
// So, remove it for the purposes of comparing snapshots.
|
|
81
|
+
const gcState = JSON.parse(content);
|
|
82
|
+
for (const [, data] of Object.entries(gcState.gcNodes)) {
|
|
83
|
+
delete (data as any).unreferencedTimestampMs;
|
|
84
|
+
}
|
|
85
|
+
content = JSON.stringify(gcState);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
// Deep sort the content if it's parseable.
|
|
@@ -110,15 +110,15 @@ function getNormalizedBlobContent(blobContent: string, blobName: string): string
|
|
|
110
110
|
export function getNormalizedSnapshot(snapshot: ITree, config?: ISnapshotNormalizerConfig): ITree {
|
|
111
111
|
// Merge blobs to normalize in the config with runtime blobs to normalize. The contents of these blobs will be
|
|
112
112
|
// parsed and deep sorted.
|
|
113
|
-
const blobsToNormalize = [ ...
|
|
113
|
+
const blobsToNormalize = [ ...config?.blobsToNormalize ?? [] ];
|
|
114
114
|
const normalizedEntries: ITreeEntry[] = [];
|
|
115
115
|
|
|
116
116
|
for (const entry of snapshot.entries) {
|
|
117
117
|
switch (entry.type) {
|
|
118
118
|
case TreeEntry.Blob: {
|
|
119
119
|
let contents = entry.value.contents;
|
|
120
|
-
// If this blob has to be normalized, parse and sort the blob contents first.
|
|
121
|
-
if (blobsToNormalize.includes(entry.path)) {
|
|
120
|
+
// If this blob has to be normalized or it's a GC blob, parse and sort the blob contents first.
|
|
121
|
+
if (blobsToNormalize.includes(entry.path) || entry.path.startsWith(gcBlobPrefix)) {
|
|
122
122
|
contents = getNormalizedBlobContent(contents, entry.path);
|
|
123
123
|
}
|
|
124
124
|
normalizedEntries.push(new BlobTreeEntry(entry.path, contents));
|