diff --git a/.changeset/spotty-bottles-rest.md b/.changeset/spotty-bottles-rest.md new file mode 100644 index 000000000000..a6fdf36ab9e0 --- /dev/null +++ b/.changeset/spotty-bottles-rest.md @@ -0,0 +1,109 @@ +--- +"fluid-framework": minor +"@fluidframework/tree": minor +"__section": feature +--- +Persisted metadata for Shared Tree schemas (Alpha) + +The persisted metadata feature for Shared Tree allows an application author to write document-persisted metadata along with the schema. This feature is supported for both node and field schemas. + +#### Using the persisted metadata feature + +As of now, persisted metadata support is available via the SchemaFactoryAlpha API: + +```ts +// Construct a schema factory with alpha APIs +const schemaFactory = new SchemaFactoryAlpha("com.example"); +``` + +Persisted metadata can take the shape of any JSON-serializable object, e.g.: + +```ts +const persistedMetadata = { a: 2 }; +``` + +#### Feature flag + +To enable persisted metadata, use `configuredSharedTree` to specify the format version. The tree that is returned can be substituted in place of the default `SharedTree` object exported by the Fluid Framework. For example: + +```ts +const tree = configuredSharedTree({ + formatVersion: SharedTreeFormatVersion.v5, +}).create(runtime); + +export const MyContainerSchema = { + initialObjects: { + appData: tree, + }, +} satisfies ContainerSchema; +``` + +#### Examples + +##### Field schemas with persisted metadata + +```ts +// Construct a schema factory with alpha APIs +const schemaFactory = new SchemaFactoryAlpha("com.example"); + +// Define metadata. This can take the shape of any JSON-serializable object. +const persistedMetadata = { "a": 2 }; + +// Foo is an object type with metadata +class Foo extends schemaFactory.objectAlpha("Foo", { + // Metadata for a required number field + bar: schemaFactory.required(schemaFactory.number, { persistedMetadata }), + + // Metadata for an optional string field    + baz: schemaFactory.optional(schemaFactory.string, { persistedMetadata }), +// Metadata for the object type Foo        +}, { persistedMetadata }) {} +``` + +##### Recursive field schemas + +```ts +// Construct a schema factory with alpha APIs +const schemaFactory = new SchemaFactoryAlpha("com.example"); + +// Define metadata. This can take the shape of any JSON-serializable object. +const persistedMetadata = { "a": 2 }; + +// Recursive object schema with persisted metadata +class RecursiveObject extends schemaFactory.objectRecursive("RecursiveObject", { + x: [() => RecursiveObject, schemaFactory.number], +}, { persistedMetadata }) {} + +// Recursive field schema with metadata +const recursiveField = schemaFactory.optionalRecursive( + [() => RecursiveObject, schemaFactory.number], + { persistedMetadata }); +``` + +##### Recursive object schemas + +```ts +// Construct a schema factory with alpha APIs +const schemaFactory = new SchemaFactoryAlpha("com.example"); + +// Define metadata. This can take the shape of any JSON-serializable object. +const persistedMetadata = { "a": 2 }; + +// Recursive array schema +class Foos extends schemaFactory.arrayRecursive( + "FooList", + [() => Foo], + { persistedMetadata }) {} + +// Recursive object schema +class Foo extends schemaFactory.objectRecursive( + "Foo", + { fooList: Foos }, + { persistedMetadata }) {} + +// Recursive map schema +class FooMap extends schemaFactory.mapRecursive( + "FooMap", + [() => Foo], + { persistedMetadata }) {} +``` diff --git a/.changeset/whole-days-argue.md b/.changeset/whole-days-argue.md deleted file mode 100644 index d09931fee214..000000000000 --- a/.changeset/whole-days-argue.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"fluid-framework": minor -"@fluidframework/tree": minor -"__section": tree ---- -Add overrides for more instance properties in SchemaFactoryAlpha - -[SchemaFactoryAlpha](https://fluidframework.com/docs/api/fluid-framework/schemafactoryalpha-class) provides proposed updates to several SchemaFactory APIs. -It now exposes these not only for the static members but also the redundant instance properties for `leaves`, `optional`, `required` and `optionalRecursive`. - -Additionally an alpha override for `requiredRecursive` was added to both the statics and instance properties. diff --git a/packages/dds/tree/api-report/tree.alpha.api.md b/packages/dds/tree/api-report/tree.alpha.api.md index b6256681214f..54bf061355b7 100644 --- a/packages/dds/tree/api-report/tree.alpha.api.md +++ b/packages/dds/tree/api-report/tree.alpha.api.md @@ -858,6 +858,7 @@ export const SharedTreeFormatVersion: { readonly v1: 1; readonly v2: 2; readonly v3: 3; + readonly v5: 5; }; // @alpha diff --git a/packages/dds/tree/src/core/index.ts b/packages/dds/tree/src/core/index.ts index 2135129ec435..015901277e3a 100644 --- a/packages/dds/tree/src/core/index.ts +++ b/packages/dds/tree/src/core/index.ts @@ -138,11 +138,13 @@ export { storedEmptyFieldSchema, type StoredSchemaCollection, schemaFormatV1, + schemaFormatV2, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, - encodeFieldSchema, + encodeFieldSchemaV1, + encodeFieldSchemaV2, storedSchemaDecodeDispatcher, type SchemaAndPolicy, Multiplicity, diff --git a/packages/dds/tree/src/core/schema-stored/formatV2.ts b/packages/dds/tree/src/core/schema-stored/formatV2.ts new file mode 100644 index 000000000000..fbbf5ec635d2 --- /dev/null +++ b/packages/dds/tree/src/core/schema-stored/formatV2.ts @@ -0,0 +1,78 @@ +/*! + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * Licensed under the MIT License. + */ + +import { type ObjectOptions, type Static, Type } from "@sinclair/typebox"; + +import { JsonCompatibleReadOnlySchema } from "../../util/index.js"; +import { + FieldKindIdentifierSchema, + PersistedValueSchema, + TreeNodeSchemaIdentifierSchema, +} from "./formatV1.js"; +import { unionOptions } from "../../codec/index.js"; + +export const PersistedMetadataFormat = Type.Optional(JsonCompatibleReadOnlySchema); + +const FieldSchemaFormatBase = Type.Object({ + kind: FieldKindIdentifierSchema, + types: Type.Array(TreeNodeSchemaIdentifierSchema), + metadata: PersistedMetadataFormat, +}); + +const noAdditionalProps: ObjectOptions = { additionalProperties: false }; + +export const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps); + +/** + * Format for the content of a {@link TreeNodeStoredSchema}. + * + * See {@link DiscriminatedUnionDispatcher} for more information on this pattern. + */ +export const TreeNodeSchemaUnionFormat = Type.Object( + { + /** + * Object node union member. + */ + object: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)), + /** + * Map node union member. + */ + map: Type.Optional(FieldSchemaFormat), + /** + * Leaf node union member. + */ + leaf: Type.Optional(Type.Enum(PersistedValueSchema)), + }, + unionOptions, +); + +export type TreeNodeSchemaUnionFormat = Static; + +/** + * Format for {@link TreeNodeStoredSchema}. + * + * See {@link DiscriminatedUnionDispatcher} for more information on this pattern. + */ +export const TreeNodeSchemaDataFormat = Type.Object( + { + /** + * Node kind specific data. + */ + kind: TreeNodeSchemaUnionFormat, + + // Data in common for all TreeNode schemas: + /** + * Leaf node union member. + */ + metadata: PersistedMetadataFormat, + }, + noAdditionalProps, +); + +export type TreeNodeSchemaDataFormat = Static; + +export type FieldSchemaFormat = Static; + +export type PersistedMetadataFormat = Static; diff --git a/packages/dds/tree/src/core/schema-stored/index.ts b/packages/dds/tree/src/core/schema-stored/index.ts index a972028f76d9..fa2c5575ad44 100644 --- a/packages/dds/tree/src/core/schema-stored/index.ts +++ b/packages/dds/tree/src/core/schema-stored/index.ts @@ -18,7 +18,8 @@ export { ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, - encodeFieldSchema, + encodeFieldSchemaV1, + encodeFieldSchemaV2, storedSchemaDecodeDispatcher, type SchemaAndPolicy, type SchemaPolicy, @@ -37,3 +38,5 @@ export type { TreeNodeSchemaIdentifier, FieldKey, FieldKindIdentifier } from "./ import * as schemaFormatV1 from "./formatV1.js"; export { schemaFormatV1 }; +import * as schemaFormatV2 from "./formatV2.js"; +export { schemaFormatV2 }; diff --git a/packages/dds/tree/src/core/schema-stored/schema.ts b/packages/dds/tree/src/core/schema-stored/schema.ts index acfbf47dceb5..66f1c6d84794 100644 --- a/packages/dds/tree/src/core/schema-stored/schema.ts +++ b/packages/dds/tree/src/core/schema-stored/schema.ts @@ -16,11 +16,17 @@ import { import { type FieldKey, type FieldKindIdentifier, - type FieldSchemaFormat, + type FieldSchemaFormat as FieldSchemaFormatV1, PersistedValueSchema, - type TreeNodeSchemaDataFormat, + type TreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV1, type TreeNodeSchemaIdentifier, } from "./formatV1.js"; +import type { + FieldSchemaFormat as FieldSchemaFormatV2, + PersistedMetadataFormat, + TreeNodeSchemaUnionFormat, + TreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV2, +} from "./formatV2.js"; import type { Multiplicity } from "./multiplicity.js"; /** @@ -28,8 +34,14 @@ import type { Multiplicity } from "./multiplicity.js"; */ export enum SchemaVersion { v1 = 1, + /** + * Adds persisted metadata to the node schema and field schema. + */ + v2 = 2, } +type FieldSchemaFormat = FieldSchemaFormatV1 | FieldSchemaFormatV2; + /** * Schema for what {@link TreeLeafValue} is allowed on a Leaf node. * @privateRemarks @@ -138,6 +150,8 @@ export interface TreeFieldStoredSchema { * Portion of the metadata which can be persisted. * @remarks * Discarded when encoding to {@link SchemaFormatVersion.V1}. + * @privateRemarks + * This field corresponds to the `metadata` field in the persisted schema format. */ readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined; } @@ -177,12 +191,21 @@ export abstract class TreeNodeStoredSchema { protected _typeCheck!: MakeNominal; /** - * @privateRemarks - * Returns TreeNodeSchemaDataFormat. - * This is uses an opaque type to avoid leaking these types out of the package, - * and is runtime validated by the codec. + * Constructor for a TreeNodeStoredSchema. + * @param metadata - Persisted metadata for this node schema. + */ + public constructor(public readonly metadata: PersistedMetadataFormat | undefined) {} + + /** + * Encode in the v1 schema format. + */ + public abstract encodeV1(): TreeNodeSchemaDataFormatV1; + + /** + * Encode in the v2 schema format. + * @remarks Post-condition: if metadata was specified on the input schema, it will be present in the output. */ - public abstract encode(): TreeNodeSchemaDataFormat; + public abstract encodeV2(): TreeNodeSchemaDataFormatV2; /** * Returns the schema for the provided field. @@ -203,11 +226,35 @@ export class ObjectNodeStoredSchema extends TreeNodeStoredSchema { */ public constructor( public readonly objectNodeFields: ReadonlyMap, + metadata?: PersistedMetadataFormat | undefined, ) { - super(); + super(metadata); } - public override encode(): TreeNodeSchemaDataFormat { + public override encodeV1(): TreeNodeSchemaDataFormatV1 { + const fieldsObject: Record = + this.encodeFieldsObject(encodeFieldSchemaV1); + + return { + object: fieldsObject, + }; + } + + public override encodeV2(): TreeNodeSchemaDataFormatV2 { + const fieldsObject: Record = + this.encodeFieldsObject(encodeFieldSchemaV2); + const kind = { object: fieldsObject }; + + return { kind, metadata: this.metadata }; + } + + public override getFieldSchema(field: FieldKey): TreeFieldStoredSchema { + return this.objectNodeFields.get(field) ?? storedEmptyFieldSchema; + } + + private encodeFieldsObject( + encodeFieldSchema: (storedFieldSchema: TreeFieldStoredSchema) => FieldSchemaFormat, + ): Record { const fieldsObject: Record = Object.create(null); // Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant). // This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken. @@ -221,13 +268,7 @@ export class ObjectNodeStoredSchema extends TreeNodeStoredSchema { ), }); } - return { - object: fieldsObject, - }; - } - - public override getFieldSchema(field: FieldKey): TreeFieldStoredSchema { - return this.objectNodeFields.get(field) ?? storedEmptyFieldSchema; + return fieldsObject; } } @@ -242,16 +283,24 @@ export class MapNodeStoredSchema extends TreeNodeStoredSchema { * since no nodes can ever be in schema if you use `FieldKind.Value` here * (that would require infinite children). */ - public constructor(public readonly mapFields: TreeFieldStoredSchema) { - super(); + public constructor( + public readonly mapFields: TreeFieldStoredSchema, + metadata?: PersistedMetadataFormat | undefined, + ) { + super(metadata); } - public override encode(): TreeNodeSchemaDataFormat { + public override encodeV1(): TreeNodeSchemaDataFormatV1 { return { - map: encodeFieldSchema(this.mapFields), + map: encodeFieldSchemaV1(this.mapFields), }; } + public override encodeV2(): TreeNodeSchemaDataFormatV2 { + const kind = { map: encodeFieldSchemaV2(this.mapFields) }; + return { kind, metadata: this.metadata }; + } + public override getFieldSchema(field: FieldKey): TreeFieldStoredSchema { return this.mapFields; } @@ -273,36 +322,54 @@ export class LeafNodeStoredSchema extends TreeNodeStoredSchema { * This is simply one approach that can work for modeling them in the internal schema representation. */ public constructor(public readonly leafValue: ValueSchema) { - super(); + // No metadata for leaf nodes. + super(undefined); } - public override encode(): TreeNodeSchemaDataFormat { + public override encodeV1(): TreeNodeSchemaDataFormatV1 { return { leaf: encodeValueSchema(this.leafValue), }; } + public override encodeV2(): TreeNodeSchemaDataFormatV2 { + return { + // No metadata for leaf nodes, so don't emit a metadata field. + kind: { + leaf: encodeValueSchema(this.leafValue), + }, + }; + } + public override getFieldSchema(field: FieldKey): TreeFieldStoredSchema { return storedEmptyFieldSchema; } } +/** + * Decoder wrapper function for {@link TreeNodeStoredSchema} implementations. + * Curries the constructor so that the caller can inject metadata. + */ +type StoredSchemaDecoder = ( + metadata: PersistedMetadataFormat | undefined, +) => TreeNodeStoredSchema; + export const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher< - TreeNodeSchemaDataFormat, + TreeNodeSchemaUnionFormat, [], - TreeNodeStoredSchema + StoredSchemaDecoder > = new DiscriminatedUnionDispatcher({ - leaf: (data: PersistedValueSchema) => new LeafNodeStoredSchema(decodeValueSchema(data)), - object: ( - data: Record, - ): TreeNodeStoredSchema => { + leaf: (data: PersistedValueSchema) => (metadata) => + new LeafNodeStoredSchema(decodeValueSchema(data)), + object: (data: Record) => (metadata) => { const map = new Map(); for (const [key, value] of Object.entries(data)) { map.set(key, decodeFieldSchema(value)); } - return new ObjectNodeStoredSchema(map); + return new ObjectNodeStoredSchema(map, metadata); }, - map: (data: FieldSchemaFormat) => new MapNodeStoredSchema(decodeFieldSchema(data)), + map: (data: FieldSchemaFormat) => (metadata) => + new MapNodeStoredSchema(decodeFieldSchema(data), metadata), }); const valueSchemaEncode = new Map([ @@ -323,7 +390,7 @@ function decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema { return valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */); } -export function encodeFieldSchema(schema: TreeFieldStoredSchema): FieldSchemaFormat { +export function encodeFieldSchemaV1(schema: TreeFieldStoredSchema): FieldSchemaFormatV1 { return { kind: schema.kind, // Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse. @@ -331,13 +398,21 @@ export function encodeFieldSchema(schema: TreeFieldStoredSchema): FieldSchemaFor }; } -export function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSchema { +export function encodeFieldSchemaV2(schema: TreeFieldStoredSchema): FieldSchemaFormatV2 { + const fieldSchema: FieldSchemaFormatV1 = encodeFieldSchemaV1(schema); + + // Omit metadata from the output if it is undefined + return schema.persistedMetadata !== undefined + ? { ...fieldSchema, metadata: schema.persistedMetadata } + : { ...fieldSchema }; +} + +export function decodeFieldSchema(schema: FieldSchemaFormatV2): TreeFieldStoredSchema { const out: TreeFieldStoredSchema = { // TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds. kind: schema.kind, types: new Set(schema.types), - // TODO: Persist metadata once schema FormatV2 has been added. - persistedMetadata: undefined, + persistedMetadata: schema.metadata, }; return out; } diff --git a/packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeCodecs.ts b/packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeCodecs.ts index a4afe65d722d..34ce95493c34 100644 --- a/packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +++ b/packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeCodecs.ts @@ -13,7 +13,7 @@ import { makeVersionDispatchingCodec, withSchemaValidation, } from "../../codec/index.js"; -import { makeSchemaCodec, type Format as FormatV1 } from "../schema-index/index.js"; +import { makeSchemaCodec } from "../schema-index/index.js"; import { EncodedSchemaChange } from "./schemaChangeFormat.js"; import type { SchemaChange } from "./schemaChangeTypes.js"; @@ -25,7 +25,10 @@ import { SchemaVersion } from "../../core/index.js"; * @returns The composed codec family. */ export function makeSchemaChangeCodecs(options: ICodecOptions): ICodecFamily { - return makeCodecFamily([[SchemaVersion.v1, makeSchemaChangeCodecV1(options)]]); + return makeCodecFamily([ + [SchemaVersion.v1, makeSchemaChangeCodecV1(options, SchemaVersion.v1)], + [SchemaVersion.v2, makeSchemaChangeCodecV1(options, SchemaVersion.v2)], + ]); } /** @@ -43,14 +46,16 @@ export function makeSchemaChangeCodec( } /** - * Compose the v1 schema change codec. + * Compose the change codec using mostly v1 logic. * @param options - The codec options. + * @param schemaWriteVersion - The schema write version. * @returns The composed schema change codec. */ function makeSchemaChangeCodecV1( options: ICodecOptions, + schemaWriteVersion: SchemaVersion, ): IJsonCodec { - const schemaCodec = makeSchemaCodec(options, SchemaVersion.v1); + const schemaCodec = makeSchemaCodec(options, schemaWriteVersion); const schemaChangeCodec: IJsonCodec = { encode: (schemaChange) => { assert( @@ -58,8 +63,8 @@ function makeSchemaChangeCodecV1( 0x933 /* Inverse schema changes should never be transmitted */, ); return { - new: schemaCodec.encode(schemaChange.schema.new) as FormatV1, - old: schemaCodec.encode(schemaChange.schema.old) as FormatV1, + new: schemaCodec.encode(schemaChange.schema.new), + old: schemaCodec.encode(schemaChange.schema.old), }; }, decode: (encoded) => { diff --git a/packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeFormat.ts b/packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeFormat.ts index 046aadcfe221..2b6e6c299c41 100644 --- a/packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeFormat.ts +++ b/packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeFormat.ts @@ -4,11 +4,11 @@ */ import { type Static, Type } from "@sinclair/typebox"; -import { Format as FormatV1 } from "../schema-index/index.js"; +import { JsonCompatibleReadOnlySchema } from "../../util/index.js"; export const EncodedSchemaChange = Type.Object({ - new: FormatV1, - old: FormatV1, + new: JsonCompatibleReadOnlySchema, + old: JsonCompatibleReadOnlySchema, }); export type EncodedSchemaChange = Static; diff --git a/packages/dds/tree/src/feature-libraries/schema-index/codec.ts b/packages/dds/tree/src/feature-libraries/schema-index/codec.ts index 61391201d296..c0e89c7b9488 100644 --- a/packages/dds/tree/src/feature-libraries/schema-index/codec.ts +++ b/packages/dds/tree/src/feature-libraries/schema-index/codec.ts @@ -20,13 +20,14 @@ import { type TreeNodeStoredSchema, type TreeStoredSchema, decodeFieldSchema, - encodeFieldSchema, - type schemaFormatV1, + encodeFieldSchemaV1, + encodeFieldSchemaV2, storedSchemaDecodeDispatcher, } from "../../core/index.js"; import { brand, type JsonCompatible } from "../../util/index.js"; import { Format as FormatV1 } from "./formatV1.js"; +import { Format as FormatV2 } from "./formatV2.js"; /** * Convert a FluidClientVersion to a SchemaVersion. @@ -62,7 +63,10 @@ export function makeSchemaCodec( * @returns The composed codec family. */ export function makeSchemaCodecs(options: ICodecOptions): ICodecFamily { - return makeCodecFamily([[SchemaVersion.v1, makeSchemaCodecV1(options)]]); + return makeCodecFamily([ + [SchemaVersion.v1, makeSchemaCodecV1(options)], + [SchemaVersion.v2, makeSchemaCodecV2(options)], + ]); } /** @@ -74,36 +78,79 @@ export function makeSchemaCodecs(options: ICodecOptions): ICodecFamily = - Object.create(null); - const rootFieldSchema = encodeFieldSchema(repo.rootFieldSchema); + const nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV1()); + const rootFieldSchema = encodeFieldSchemaV1(repo.rootFieldSchema); + return { + version: SchemaVersion.v1, + nodes: nodeSchema, + root: rootFieldSchema, + }; +} + +function encodeRepoV2(repo: TreeStoredSchema): FormatV2 { + const nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV2()); + const rootFieldSchema = encodeFieldSchemaV2(repo.rootFieldSchema); + return { + version: SchemaVersion.v2, + nodes: nodeSchema, + root: rootFieldSchema, + }; +} + +/** + * Shared logic for encoding node schemas. + * @param repo - The stored schema to encode. + * @param encodeValue - A function which encodes a single node schema. + * @returns The encoded node schema. + */ +function encodeNodeSchema( + repo: TreeStoredSchema, + encodeValue: (schema: TreeNodeStoredSchema) => TFormat, +): Record { + const nodeSchema: Record = Object.create(null); for (const name of [...repo.nodeSchema.keys()].sort()) { const schema = repo.nodeSchema.get(name) ?? fail(0xb28 /* missing schema */); Object.defineProperty(nodeSchema, name, { enumerable: true, configurable: true, writable: true, - value: schema.encode(), + value: encodeValue(schema), }); } + + return nodeSchema; +} + +function decodeV1(f: FormatV1): TreeStoredSchema { + const nodeSchema: Map = new Map(); + for (const [key, schema] of Object.entries(f.nodes)) { + const storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema); + + // No metadata in v1, so pass undefined + nodeSchema.set(brand(key), storedSchemaDecoder(undefined)); + } return { - version: SchemaVersion.v1, - nodes: nodeSchema, - root: rootFieldSchema, + rootFieldSchema: decodeFieldSchema(f.root), + nodeSchema, }; } -function decode(f: FormatV1): TreeStoredSchema { +function decodeV2(f: FormatV2): TreeStoredSchema { const nodeSchema: Map = new Map(); for (const [key, schema] of Object.entries(f.nodes)) { - nodeSchema.set(brand(key), storedSchemaDecodeDispatcher.dispatch(schema)); + const storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema.kind); + + // Pass in the node metadata + nodeSchema.set(brand(key), storedSchemaDecoder(schema.metadata)); } return { rootFieldSchema: decodeFieldSchema(f.root), @@ -119,6 +166,18 @@ function decode(f: FormatV1): TreeStoredSchema { function makeSchemaCodecV1(options: ICodecOptions): IJsonCodec { return makeVersionedValidatedCodec(options, new Set([SchemaVersion.v1]), FormatV1, { encode: (data: TreeStoredSchema) => encodeRepoV1(data), - decode: (data: FormatV1) => decode(data), + decode: (data: FormatV1) => decodeV1(data), + }); +} + +/** + * Creates a codec which performs synchronous monolithic encoding of schema content. + * @param options - Specifies common codec options, including which `validator` to use. + * @returns The codec. + */ +function makeSchemaCodecV2(options: ICodecOptions): IJsonCodec { + return makeVersionedValidatedCodec(options, new Set([SchemaVersion.v2]), FormatV2, { + encode: (data: TreeStoredSchema) => encodeRepoV2(data), + decode: (data: FormatV2) => decodeV2(data), }); } diff --git a/packages/dds/tree/src/feature-libraries/schema-index/formatV2.ts b/packages/dds/tree/src/feature-libraries/schema-index/formatV2.ts new file mode 100644 index 000000000000..f37c804ee063 --- /dev/null +++ b/packages/dds/tree/src/feature-libraries/schema-index/formatV2.ts @@ -0,0 +1,30 @@ +/*! + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * Licensed under the MIT License. + */ + +import { type ObjectOptions, type Static, Type } from "@sinclair/typebox"; + +import { SchemaVersion, schemaFormatV2 } from "../../core/index.js"; + +const noAdditionalProps: ObjectOptions = { additionalProperties: false }; + +/** + * Format for encoding as json. + * + * For consistency all lists are sorted and undefined values are omitted. + * + * This chooses to use lists of named objects instead of maps: + * this choice is somewhat arbitrary, but avoids user data being used as object keys, + * which can sometimes be an issue (for example handling that for "__proto__" can require care). + * It also makes it simpler to determinately sort by keys. + */ +export const Format = Type.Object( + { + version: Type.Literal(SchemaVersion.v2), + nodes: Type.Record(Type.String(), schemaFormatV2.TreeNodeSchemaDataFormat), + root: schemaFormatV2.FieldSchemaFormat, + }, + noAdditionalProps, +); +export type Format = Static; diff --git a/packages/dds/tree/src/feature-libraries/schema-index/index.ts b/packages/dds/tree/src/feature-libraries/schema-index/index.ts index d79072edfb34..aae9846c76fe 100644 --- a/packages/dds/tree/src/feature-libraries/schema-index/index.ts +++ b/packages/dds/tree/src/feature-libraries/schema-index/index.ts @@ -9,4 +9,5 @@ export { makeSchemaCodecs, clientVersionToSchemaVersion, } from "./codec.js"; -export { Format } from "./formatV1.js"; +export { Format as FormatV1 } from "./formatV1.js"; +export { Format as FormatV2 } from "./formatV2.js"; diff --git a/packages/dds/tree/src/shared-tree/sharedTree.ts b/packages/dds/tree/src/shared-tree/sharedTree.ts index a124b086f25c..99f55184fdea 100644 --- a/packages/dds/tree/src/shared-tree/sharedTree.ts +++ b/packages/dds/tree/src/shared-tree/sharedTree.ts @@ -64,7 +64,7 @@ import { makeTreeChunker, } from "../feature-libraries/index.js"; // eslint-disable-next-line import/no-internal-modules -import type { Format } from "../feature-libraries/schema-index/index.js"; +import type { FormatV1 } from "../feature-libraries/schema-index/index.js"; import { type ClonableSchemaAndPolicy, DefaultResubmitMachine, @@ -92,12 +92,6 @@ import { type ITreeAlpha, type SimpleObjectFieldSchema, } from "../simple-tree/index.js"; -import { - type Breakable, - breakingClass, - type JsonCompatible, - throwIfBroken, -} from "../util/index.js"; import { SchematizingSimpleTreeView } from "./schematizingTreeView.js"; import { SharedTreeReadonlyChangeEnricher } from "./sharedTreeChangeEnricher.js"; @@ -105,6 +99,12 @@ import { SharedTreeChangeFamily } from "./sharedTreeChangeFamily.js"; import type { SharedTreeChange } from "./sharedTreeChangeTypes.js"; import type { SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js"; import { type TreeCheckout, type BranchableTree, createTreeCheckout } from "./treeCheckout.js"; +import { + type Breakable, + breakingClass, + type JsonCompatible, + throwIfBroken, +} from "../util/index.js"; /** * Copy of data from an {@link ITreePrivate} at some point in time. @@ -192,6 +192,10 @@ const formatVersionToTopLevelCodecVersions = new Map= 2.0.0. */ v3: 3, + + /** + * Requires \@fluidframework/tree \>= 2.0.0. + */ + v5: 5, } as const; /** @@ -770,7 +779,7 @@ function exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeS kind: NodeKind.Array, allowedTypesIdentifiers: arrayTypes, metadata: {}, - persistedMetadata: undefined, + persistedMetadata: schema.metadata, }; } if (schema instanceof ObjectNodeStoredSchema) { @@ -778,7 +787,7 @@ function exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeS for (const [storedKey, field] of schema.objectNodeFields) { fields.set(storedKey, { ...exportSimpleFieldSchemaStored(field), storedKey }); } - return { kind: NodeKind.Object, fields, metadata: {}, persistedMetadata: undefined }; + return { kind: NodeKind.Object, fields, metadata: {}, persistedMetadata: schema.metadata }; } if (schema instanceof MapNodeStoredSchema) { assert( @@ -789,7 +798,7 @@ function exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeS kind: NodeKind.Map, allowedTypesIdentifiers: schema.mapFields.types, metadata: {}, - persistedMetadata: undefined, + persistedMetadata: schema.metadata, }; } if (schema instanceof LeafNodeStoredSchema) { @@ -797,7 +806,7 @@ function exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeS kind: NodeKind.Leaf, leafKind: schema.leafValue, metadata: {}, - persistedMetadata: undefined, + persistedMetadata: schema.metadata, }; } fail(0xacb /* invalid schema kind */); diff --git a/packages/dds/tree/src/shared-tree/treeAlpha.ts b/packages/dds/tree/src/shared-tree/treeAlpha.ts index 4a64891b268c..de82bb1d0d0f 100644 --- a/packages/dds/tree/src/shared-tree/treeAlpha.ts +++ b/packages/dds/tree/src/shared-tree/treeAlpha.ts @@ -42,7 +42,12 @@ import { getOrCreateNodeFromInnerNode, } from "../simple-tree/index.js"; import { extractFromOpaque, type JsonCompatible } from "../util/index.js"; -import type { CodecWriteOptions, ICodecOptions } from "../codec/index.js"; +import { + FluidClientVersion, + noopValidator, + type ICodecOptions, + type CodecWriteOptions, +} from "../codec/index.js"; import type { ITreeCursorSynchronous } from "../core/index.js"; import { cursorForMapTreeField, @@ -58,7 +63,6 @@ import { } from "../feature-libraries/index.js"; import { independentInitializedView, type ViewContent } from "./independentView.js"; import { SchematizingSimpleTreeView, ViewSlot } from "./schematizingTreeView.js"; -import { currentVersion, noopValidator } from "../codec/index.js"; const identifier: TreeIdentifierUtils = (node: TreeNode): string | undefined => { const nodeIdentifier = getIdentifierFromNode(node, "uncompressed"); @@ -463,7 +467,8 @@ export const TreeAlpha: TreeAlpha = { ): Unhydrated> { const config = new TreeViewConfigurationAlpha({ schema }); const content: ViewContent = { - schema: extractPersistedSchema(config, currentVersion), + // Always use a v1 schema codec for consistency. + schema: extractPersistedSchema(config, FluidClientVersion.v2_0), tree: compressedData, idCompressor: options.idCompressor ?? createIdCompressor(), }; diff --git a/packages/dds/tree/src/simple-tree/api/storedSchema.ts b/packages/dds/tree/src/simple-tree/api/storedSchema.ts index 9da9a74f636b..f5db3c91af97 100644 --- a/packages/dds/tree/src/simple-tree/api/storedSchema.ts +++ b/packages/dds/tree/src/simple-tree/api/storedSchema.ts @@ -12,7 +12,7 @@ import { } from "../../feature-libraries/index.js"; import { clientVersionToSchemaVersion, - type Format, + type FormatV1, // eslint-disable-next-line import/no-internal-modules } from "../../feature-libraries/schema-index/index.js"; import type { JsonCompatible } from "../../util/index.js"; @@ -58,8 +58,8 @@ export function extractPersistedSchema( oldestCompatibleClient: FluidClientVersion, ): JsonCompatible { const stored = simpleToStoredSchema(schema); - const writeVersion = clientVersionToSchemaVersion(oldestCompatibleClient); - return encodeTreeSchema(stored, writeVersion); + const schemaWriteVersion = clientVersionToSchemaVersion(oldestCompatibleClient); + return encodeTreeSchema(stored, schemaWriteVersion); } /** @@ -100,7 +100,7 @@ export function comparePersistedSchema( // Any version can be passed down to makeSchemaCodec here. // We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`. const schemaCodec = makeSchemaCodec(options, SchemaVersion.v1); - const stored = schemaCodec.decode(persisted as Format); + const stored = schemaCodec.decode(persisted as FormatV1); const viewSchema = new SchemaCompatibilityTester( defaultSchemaPolicy, {}, diff --git a/packages/dds/tree/src/simple-tree/toStoredSchema.ts b/packages/dds/tree/src/simple-tree/toStoredSchema.ts index 73ab70ff3c8b..6d80f9ff3af5 100644 --- a/packages/dds/tree/src/simple-tree/toStoredSchema.ts +++ b/packages/dds/tree/src/simple-tree/toStoredSchema.ts @@ -119,11 +119,15 @@ export function getStoredSchema(schema: SimpleNodeSchema): TreeNodeStoredSchema } case NodeKind.Map: { const types = schema.allowedTypesIdentifiers as TreeTypeSet; - return new MapNodeStoredSchema({ - kind: FieldKinds.optional.identifier, - types, - persistedMetadata: schema.persistedMetadata, - }); + return new MapNodeStoredSchema( + { + kind: FieldKinds.optional.identifier, + types, + persistedMetadata: schema.persistedMetadata, + }, + // TODO: Find a way to avoid injecting persistedMetadata twice in these constructor calls. + schema.persistedMetadata, + ); } case NodeKind.Array: { const types = schema.allowedTypesIdentifiers as TreeTypeSet; @@ -133,14 +137,14 @@ export function getStoredSchema(schema: SimpleNodeSchema): TreeNodeStoredSchema persistedMetadata: schema.persistedMetadata, }; const fields = new Map([[EmptyKey, field]]); - return new ObjectNodeStoredSchema(fields); + return new ObjectNodeStoredSchema(fields, schema.persistedMetadata); } case NodeKind.Object: { const fields: Map = new Map(); for (const fieldSchema of schema.fields.values()) { fields.set(brand(fieldSchema.storedKey), convertField(fieldSchema)); } - return new ObjectNodeStoredSchema(fields); + return new ObjectNodeStoredSchema(fields, schema.persistedMetadata); } default: unreachableCase(kind); diff --git a/packages/dds/tree/src/test/feature-libraries/schema-index/codec.spec.ts b/packages/dds/tree/src/test/feature-libraries/schema-index/codec.spec.ts index 5f6b9e2e314e..176e95d041dc 100644 --- a/packages/dds/tree/src/test/feature-libraries/schema-index/codec.spec.ts +++ b/packages/dds/tree/src/test/feature-libraries/schema-index/codec.spec.ts @@ -20,6 +20,8 @@ import { } from "../../../feature-libraries/index.js"; /* eslint-disable-next-line import/no-internal-modules */ import { Format as FormatV1 } from "../../../feature-libraries/schema-index/formatV1.js"; +// eslint-disable-next-line import/no-internal-modules +import { Format as FormatV2 } from "../../../feature-libraries/schema-index/formatV2.js"; import { takeJsonSnapshot, useSnapshotDirectory } from "../../snapshots/index.js"; import { type EncodingTestData, makeEncodingTestSuite } from "../../utils.js"; // eslint-disable-next-line import/no-internal-modules @@ -31,6 +33,7 @@ import { makeSchemaCodecs } from "../../../feature-libraries/schema-index/index. const schemaCodecs = makeSchemaCodecs({ jsonValidator: typeboxValidator }); const codecV1 = makeSchemaCodec({ jsonValidator: typeboxValidator }, SchemaVersion.v1); +const codecV2 = makeSchemaCodec({ jsonValidator: typeboxValidator }, SchemaVersion.v2); const schema2 = toStoredSchema(SchemaFactory.optional(JsonAsTree.Primitive)); @@ -49,6 +52,11 @@ describe("SchemaIndex", () => { takeJsonSnapshot(FormatV1); }); + it("SchemaIndexFormat - schema v2", () => { + // Capture the json schema for the format as a snapshot, so any change to what schema is allowed shows up in this tests. + takeJsonSnapshot(FormatV2); + }); + it("accepts valid data - schema v1", () => { // TODO: should test way more cases, and check results are correct. const cases = [ @@ -63,26 +71,54 @@ describe("SchemaIndex", () => { } }); - it("rejects malformed data - schema v1", () => { - // TODO: should test way more cases - // TODO: maybe well formed but semantically invalid data should be rejected (ex: with duplicates keys)? - const badCases = [ - undefined, - null, - {}, - { version: "1.0.0" }, - { version: "1" }, - { version: "2.0.0" }, - { version: 1 }, - { version: 2 }, - { version: 1, nodeSchema: [], globalFieldSchema: [] }, - { version: 1, nodeSchema: [], extraField: 0 }, + it("accepts valid data - schema v2", () => { + // TODO: should test way more cases, and check results are correct. + const cases = [ + { + version: 2 as const, + nodes: {}, + root: { + kind: "x" as FieldKindIdentifier, + types: [], + metadata: { "ff-system": { "eDiscovery-exclude": "true" } }, + }, + } satisfies FormatV2, ]; - for (const data of badCases) { + for (const data of cases) { + codecV2.decode(data); + } + }); + + // TODO: should test way more cases + // TODO: maybe well formed but semantically invalid data should be rejected (ex: with duplicates keys)? + /** + * A set of cases that are expected to be rejected by both the v1 and v2 codecs. + */ + const badCasesV1AndV2 = [ + undefined, + null, + {}, + { version: "1.0.0" }, + { version: "1" }, + { version: "2.0.0" }, + { version: 1 }, + { version: 2 }, + { version: 1, nodeSchema: [], globalFieldSchema: [] }, + { version: 1, nodeSchema: [], extraField: 0 }, + ]; + + it(`rejects malformed data - schema v1`, () => { + for (const data of badCasesV1AndV2) { assert.throws(() => codecV1.decode(data as unknown as FormatV1)); } }); + it(`rejects malformed data - schema v2`, () => { + for (const data of badCasesV1AndV2) { + assert.throws(() => codecV2.decode(data as unknown as FormatV2)); + } + }); + describe("codec", () => { makeEncodingTestSuite(schemaCodecs, testCases, (a, b) => { assert(allowsRepoSuperset(defaultSchemaPolicy, a, b)); diff --git a/packages/dds/tree/src/test/shared-tree/sharedTree.spec.ts b/packages/dds/tree/src/test/shared-tree/sharedTree.spec.ts index 295b39749908..73b405ab7d8d 100644 --- a/packages/dds/tree/src/test/shared-tree/sharedTree.spec.ts +++ b/packages/dds/tree/src/test/shared-tree/sharedTree.spec.ts @@ -50,6 +50,7 @@ import { ForestTypeReference, getBranch, type ITreePrivate, + SharedTreeFormatVersion, Tree, type TreeCheckout, } from "../../shared-tree/index.js"; @@ -105,6 +106,7 @@ import { AttachState } from "@fluidframework/container-definitions"; import { JsonAsTree } from "../../jsonDomainSchema.js"; import { asTreeViewAlpha, + SchemaFactoryAlpha, toSimpleTreeSchema, type ITree, // eslint-disable-next-line import/no-internal-modules @@ -2239,6 +2241,41 @@ describe("SharedTree", () => { }); }); + describe("Shared Tree format v5 enablement via `configuredSharedTree`", () => { + it("can create a SharedTree with format v5 enabled", async () => { + // Create and initialize the runtime factory + const runtime = new MockSharedTreeRuntime(); + + // Enable Shared Tree format v5, which corresponds to schema format v2. Create a Shared Tree instance. + const tree = configuredSharedTree({ + formatVersion: SharedTreeFormatVersion.v5, + }).create(runtime); + const schemaFactory = new SchemaFactoryAlpha("com.example"); + + // A schema with node and field persisted metadata + class Foo extends schemaFactory.objectAlpha( + "Foo", + { + bar: schemaFactory.required(schemaFactory.number, { + persistedMetadata: { "fieldMetadata": 1 }, + }), + }, + { persistedMetadata: { "nodeMetadata": 2 } }, + ) {} + + const treeView = tree.viewWith( + new TreeViewConfiguration({ + schema: Foo, + }), + ); + + const schema = treeView.schema; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + assert.deepEqual(schema.fields.get("bar")!.persistedMetadata, { "fieldMetadata": 1 }); + assert.deepEqual(schema.persistedMetadata, { "nodeMetadata": 2 }); + }); + }); + describe("Identifiers", () => { it("Can use identifiers and the static Tree Apis", () => { const sf = new SchemaFactory("com.example"); diff --git a/packages/dds/tree/src/test/snapshots/encodeTreeSchema/empty - schema v2.json b/packages/dds/tree/src/test/snapshots/encodeTreeSchema/empty - schema v2.json new file mode 100644 index 000000000000..359cc020d13b --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/encodeTreeSchema/empty - schema v2.json @@ -0,0 +1,8 @@ +{ + "version": 2, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/encodeTreeSchema/simple encoded schema - schema v2.json b/packages/dds/tree/src/test/snapshots/encodeTreeSchema/simple encoded schema - schema v2.json new file mode 100644 index 000000000000..f783f848ff29 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/encodeTreeSchema/simple encoded schema - schema v2.json @@ -0,0 +1,68 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.json.array": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.json.array", + "com.fluidframework.json.object", + "com.fluidframework.leaf.boolean", + "com.fluidframework.leaf.null", + "com.fluidframework.leaf.number", + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "com.fluidframework.json.object": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "com.fluidframework.json.array", + "com.fluidframework.json.object", + "com.fluidframework.leaf.boolean", + "com.fluidframework.leaf.null", + "com.fluidframework.leaf.number", + "com.fluidframework.leaf.string" + ] + } + } + }, + "com.fluidframework.leaf.boolean": { + "kind": { + "leaf": 2 + } + }, + "com.fluidframework.leaf.null": { + "kind": { + "leaf": 4 + } + }, + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "com.fluidframework.json.array", + "com.fluidframework.json.object", + "com.fluidframework.leaf.boolean", + "com.fluidframework.leaf.null", + "com.fluidframework.leaf.number", + "com.fluidframework.leaf.string" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/files/SchemaIndexFormat - schema v2.json b/packages/dds/tree/src/test/snapshots/files/SchemaIndexFormat - schema v2.json new file mode 100644 index 000000000000..740b8c921385 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/files/SchemaIndexFormat - schema v2.json @@ -0,0 +1,127 @@ +{ + "additionalProperties": false, + "type": "object", + "properties": { + "version": { + "const": 2, + "type": "number" + }, + "nodes": { + "type": "object", + "patternProperties": { + "^(.*)$": { + "additionalProperties": false, + "type": "object", + "properties": { + "kind": { + "additionalProperties": false, + "minProperties": 1, + "maxProperties": 1, + "type": "object", + "properties": { + "object": { + "type": "object", + "patternProperties": { + "^(.*)$": { + "additionalProperties": false, + "type": "object", + "properties": { + "kind": { + "type": "string" + }, + "types": { + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": {} + }, + "required": [ + "kind", + "types" + ] + } + } + }, + "map": { + "additionalProperties": false, + "type": "object", + "properties": { + "kind": { + "type": "string" + }, + "types": { + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": {} + }, + "required": [ + "kind", + "types" + ] + }, + "leaf": { + "anyOf": [ + { + "const": 0, + "type": "number" + }, + { + "const": 1, + "type": "number" + }, + { + "const": 2, + "type": "number" + }, + { + "const": 3, + "type": "number" + }, + { + "const": 4, + "type": "number" + } + ] + } + } + }, + "metadata": {} + }, + "required": [ + "kind" + ] + } + } + }, + "root": { + "additionalProperties": false, + "type": "object", + "properties": { + "kind": { + "type": "string" + }, + "types": { + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": {} + }, + "required": [ + "kind", + "types" + ] + } + }, + "required": [ + "version", + "nodes", + "root" + ] +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/op-format/v5/field change.json b/packages/dds/tree/src/test/snapshots/op-format/v5/field change.json new file mode 100644 index 000000000000..db667c5d16ec --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/op-format/v5/field change.json @@ -0,0 +1,70 @@ +[ + { + "revision": -5, + "originatorId": "00000000-0000-4000-b000-000000000000", + "changeset": [ + { + "data": { + "maxId": 2, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "x", + "fieldKind": "Value", + "change": { + "r": { + "e": false, + "d": 1, + "s": 0 + } + } + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + } + ], + "data": [ + [ + 0, + 1 + ] + ] + } + } + } + } + ], + "version": 4 + } +] \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/op-format/v5/schema change.json b/packages/dds/tree/src/test/snapshots/op-format/v5/schema change.json new file mode 100644 index 000000000000..c3743dc4593f --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/op-format/v5/schema change.json @@ -0,0 +1,180 @@ +[ + { + "revision": -4, + "originatorId": "00000000-0000-4000-b000-000000000000", + "changeset": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.number": { + "leaf": 0 + }, + "snapshots.Point": { + "object": { + "x": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + }, + "y": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "snapshots.Point" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + }, + { + "c": { + "type": "snapshots.Point", + "value": false, + "fields": [ + [ + "x", + 0 + ], + [ + "y", + 0 + ] + ] + } + } + ], + "data": [ + [ + 1, + 0, + 0 + ] + ] + } + } + } + }, + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.number": { + "leaf": 0 + }, + "snapshots.Point": { + "object": { + "x": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + }, + "y": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "snapshots.Point" + ] + } + }, + "old": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.number": { + "leaf": 0 + }, + "snapshots.Point": { + "object": { + "x": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + }, + "y": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "snapshots.Point" + ] + } + } + } + } + ], + "version": 4 + } +] \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/allTheFields-full - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/allTheFields-full - schema v2.json new file mode 100644 index 000000000000..496671aadb98 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/allTheFields-full - schema v2.json @@ -0,0 +1,45 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "test.allTheFields": { + "kind": { + "object": { + "optional": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + }, + "sequence": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + }, + "valueField": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.allTheFields" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/allTheFields-minimal - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/allTheFields-minimal - schema v2.json new file mode 100644 index 000000000000..496671aadb98 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/allTheFields-minimal - schema v2.json @@ -0,0 +1,45 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "test.allTheFields": { + "kind": { + "object": { + "optional": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + }, + "sequence": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + }, + "valueField": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.allTheFields" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/empty - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/empty - schema v2.json new file mode 100644 index 000000000000..6ae447caba61 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/empty - schema v2.json @@ -0,0 +1,8 @@ +{ + "version": 2, + "nodes": {}, + "root": { + "kind": "Optional", + "types": [] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/false boolean - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/false boolean - schema v2.json new file mode 100644 index 000000000000..4f478d762a80 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/false boolean - schema v2.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.boolean": { + "kind": { + "leaf": 2 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.boolean" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/handle - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/handle - schema v2.json new file mode 100644 index 000000000000..670a2e2eb00d --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/handle - schema v2.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.handle": { + "kind": { + "leaf": 3 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.handle" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasAllMetadata - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasAllMetadata - schema v2.json new file mode 100644 index 000000000000..9a7cc02e9e5a --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasAllMetadata - schema v2.json @@ -0,0 +1,28 @@ +{ + "version": 2, + "nodes": { + "test.hasDescriptions": { + "kind": { + "object": { + "stored-name": { + "kind": "Value", + "types": [ + "test.minimal" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasDescriptions" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasAllMetadataRootField - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasAllMetadataRootField - schema v2.json new file mode 100644 index 000000000000..2f26b1f20162 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasAllMetadataRootField - schema v2.json @@ -0,0 +1,28 @@ +{ + "version": 2, + "nodes": { + "test.hasDescriptions": { + "kind": { + "object": { + "stored-name": { + "kind": "Value", + "types": [ + "test.minimal" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "test.hasDescriptions" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasAmbiguousField - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasAmbiguousField - schema v2.json new file mode 100644 index 000000000000..38a1bd182866 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasAmbiguousField - schema v2.json @@ -0,0 +1,34 @@ +{ + "version": 2, + "nodes": { + "test.hasAmbiguousField": { + "kind": { + "object": { + "field": { + "kind": "Value", + "types": [ + "test.minimal", + "test.minimal2" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + }, + "test.minimal2": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasAmbiguousField" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasDescriptions - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasDescriptions - schema v2.json new file mode 100644 index 000000000000..1a673ef5226e --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasDescriptions - schema v2.json @@ -0,0 +1,28 @@ +{ + "version": 2, + "nodes": { + "test.hasDescriptions": { + "kind": { + "object": { + "field": { + "kind": "Value", + "types": [ + "test.minimal" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasDescriptions" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasMinimalValueField - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasMinimalValueField - schema v2.json new file mode 100644 index 000000000000..dbef03ea4d01 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasMinimalValueField - schema v2.json @@ -0,0 +1,28 @@ +{ + "version": 2, + "nodes": { + "test.hasMinimalValueField": { + "kind": { + "object": { + "field": { + "kind": "Value", + "types": [ + "test.minimal" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasMinimalValueField" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasNumericValueField - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasNumericValueField - schema v2.json new file mode 100644 index 000000000000..bab5225cba21 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasNumericValueField - schema v2.json @@ -0,0 +1,28 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "test.hasNumericValueField": { + "kind": { + "object": { + "field": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasNumericValueField" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasOptionalField-empty - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasOptionalField-empty - schema v2.json new file mode 100644 index 000000000000..ab5793c516ed --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasOptionalField-empty - schema v2.json @@ -0,0 +1,28 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "test.hasOptionalField": { + "kind": { + "object": { + "field": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasOptionalField" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasPolymorphicValueField - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasPolymorphicValueField - schema v2.json new file mode 100644 index 000000000000..4d3de67bd772 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasPolymorphicValueField - schema v2.json @@ -0,0 +1,34 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "test.hasPolymorphicValueField": { + "kind": { + "object": { + "field": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number", + "test.minimal" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasPolymorphicValueField" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/hasRenamedField - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/hasRenamedField - schema v2.json new file mode 100644 index 000000000000..13165b281105 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/hasRenamedField - schema v2.json @@ -0,0 +1,28 @@ +{ + "version": 2, + "nodes": { + "test.hasRenamedField": { + "kind": { + "object": { + "stored-name": { + "kind": "Value", + "types": [ + "test.minimal" + ] + } + } + } + }, + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasRenamedField" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/identifier-field - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/identifier-field - schema v2.json new file mode 100644 index 000000000000..54464581a27a --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/identifier-field - schema v2.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + } + }, + "root": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/minimal - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/minimal - schema v2.json new file mode 100644 index 000000000000..1faedea5f391 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/minimal - schema v2.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "nodes": { + "test.minimal": { + "kind": { + "object": {} + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.minimal" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/node-with-identifier-field - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/node-with-identifier-field - schema v2.json new file mode 100644 index 000000000000..b2e88a500afd --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/node-with-identifier-field - schema v2.json @@ -0,0 +1,28 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "test.hasIdentifierField": { + "kind": { + "object": { + "field": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.hasIdentifierField" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/null - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/null - schema v2.json new file mode 100644 index 000000000000..6e78978c22a9 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/null - schema v2.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.null": { + "kind": { + "leaf": 4 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.null" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/numeric - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/numeric - schema v2.json new file mode 100644 index 000000000000..1a169e308c83 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/numeric - schema v2.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.number" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/numericMap-empty - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/numericMap-empty - schema v2.json new file mode 100644 index 000000000000..d635814e4494 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/numericMap-empty - schema v2.json @@ -0,0 +1,26 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "test.numericMap": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.numericMap" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/numericMap-full - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/numericMap-full - schema v2.json new file mode 100644 index 000000000000..d635814e4494 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/numericMap-full - schema v2.json @@ -0,0 +1,26 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "test.numericMap": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.numericMap" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/numericSequence - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/numericSequence - schema v2.json new file mode 100644 index 000000000000..e6c2fd36deec --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/numericSequence - schema v2.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + } + }, + "root": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-deeper - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-deeper - schema v2.json new file mode 100644 index 000000000000..a2cd9bd24370 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-deeper - schema v2.json @@ -0,0 +1,23 @@ +{ + "version": 2, + "nodes": { + "test.recursiveType": { + "kind": { + "object": { + "field": { + "kind": "Optional", + "types": [ + "test.recursiveType" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.recursiveType" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-empty - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-empty - schema v2.json new file mode 100644 index 000000000000..a2cd9bd24370 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-empty - schema v2.json @@ -0,0 +1,23 @@ +{ + "version": 2, + "nodes": { + "test.recursiveType": { + "kind": { + "object": { + "field": { + "kind": "Optional", + "types": [ + "test.recursiveType" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.recursiveType" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-recursive - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-recursive - schema v2.json new file mode 100644 index 000000000000..a2cd9bd24370 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/recursiveType-recursive - schema v2.json @@ -0,0 +1,23 @@ +{ + "version": 2, + "nodes": { + "test.recursiveType": { + "kind": { + "object": { + "field": { + "kind": "Optional", + "types": [ + "test.recursiveType" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test.recursiveType" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/schema-files/true boolean - schema v2.json b/packages/dds/tree/src/test/snapshots/schema-files/true boolean - schema v2.json new file mode 100644 index 000000000000..4f478d762a80 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/schema-files/true boolean - schema v2.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "nodes": { + "com.fluidframework.leaf.boolean": { + "kind": { + "leaf": 2 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "com.fluidframework.leaf.boolean" + ] + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/attachment-tree-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/attachment-tree-final.json new file mode 100644 index 000000000000..027deb0f511a --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/attachment-tree-final.json @@ -0,0 +1,143 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "attachment-tree.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "attachment-tree.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "attachment-tree.Array<[\"com.fluidframework.leaf.string\"]>", + "value": false, + "fields": [ + [ + "", + 1 + ] + ] + } + }, + { + "a": 2 + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + [ + "a", + "b" + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-0.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-0.json new file mode 100644 index 000000000000..6ce0a425fdf5 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-0.json @@ -0,0 +1,384 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 4 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 516 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sequenceNumber": 8, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + } + ] + } + ], + [ + "5a126183-91e7-488a-b7e9-3342a05c25ae", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-3" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + }, + { + "c": { + "type": "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + 1, + 2, + 3 + ] + ], + [ + 0, + 0 + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 1029, + 0, + 3 + ] + ], + "maxId": 3 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-1.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-1.json new file mode 100644 index 000000000000..bf3ba6ac85b1 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-1.json @@ -0,0 +1,399 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 4 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 516 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sequenceNumber": 8, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + } + ] + } + ], + [ + "5a126183-91e7-488a-b7e9-3342a05c25ae", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-3" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + }, + { + "c": { + "type": "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + 0, + 2, + 3 + ] + ], + [ + 0, + 1 + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 1029, + 0, + 3 + ] + ], + "maxId": 3 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-2.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-2.json new file mode 100644 index 000000000000..1a294cc9f7a1 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-2.json @@ -0,0 +1,399 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 4 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 516 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sequenceNumber": 8, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + } + ] + } + ], + [ + "5a126183-91e7-488a-b7e9-3342a05c25ae", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-3" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + }, + { + "c": { + "type": "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + 0, + 1, + 3 + ] + ], + [ + 0, + 2 + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 1029, + 0, + 3 + ] + ], + "maxId": 3 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-3.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-3.json new file mode 100644 index 000000000000..c41958a2714f --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/competing-removes-index-3.json @@ -0,0 +1,399 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 4 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 516 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sequenceNumber": 8, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + } + ] + } + ], + [ + "5a126183-91e7-488a-b7e9-3342a05c25ae", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-3" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + }, + { + "c": { + "type": "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + 0, + 1, + 2 + ] + ], + [ + 0, + 3 + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 1029, + 0, + 3 + ] + ], + "maxId": 3 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/complete-3x3-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/complete-3x3-final.json new file mode 100644 index 000000000000..c8a4044a0f83 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/complete-3x3-final.json @@ -0,0 +1,1007 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "test trees.Recursive Map": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "test trees.String Array": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [ + "FieldA", + "FieldB", + "FieldC" + ], + "shapes": [ + { + "c": { + "type": "test trees.String Array", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "c": { + "type": "test trees.Recursive Map", + "value": false, + "extraFields": 4 + } + }, + { + "a": 3 + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + }, + { + "a": 5 + }, + { + "d": 0 + } + ], + "data": [ + [ + 1, + [ + 0, + [ + 1, + [ + 0, + [ + 1, + [ + 0, + [ + 0, + [ + "1", + "2", + "3" + ] + ], + 1, + [ + 0, + [ + "4", + "5", + "6" + ] + ], + 2, + [ + 0, + [ + "7", + "8", + "9" + ] + ] + ] + ], + 1, + [ + 1, + [ + 0, + [ + 0, + [ + "10", + "11", + "12" + ] + ], + 1, + [ + 0, + [ + "13", + "14", + "15" + ] + ], + 2, + [ + 0, + [ + "16", + "17", + "18" + ] + ] + ] + ], + 2, + [ + 1, + [ + 0, + [ + 0, + [ + "19", + "20", + "21" + ] + ], + 1, + [ + 0, + [ + "22", + "23", + "24" + ] + ], + 2, + [ + 0, + [ + "25", + "26", + "27" + ] + ] + ] + ] + ] + ], + 1, + [ + 1, + [ + 0, + [ + 1, + [ + 0, + [ + 0, + [ + "28", + "29", + "30" + ] + ], + 1, + [ + 0, + [ + "31", + "32", + "33" + ] + ], + 2, + [ + 0, + [ + "34", + "35", + "36" + ] + ] + ] + ], + 1, + [ + 1, + [ + 0, + [ + 0, + [ + "37", + "38", + "39" + ] + ], + 1, + [ + 0, + [ + "40", + "41", + "42" + ] + ], + 2, + [ + 0, + [ + "43", + "44", + "45" + ] + ] + ] + ], + 2, + [ + 1, + [ + 0, + [ + 0, + [ + "46", + "47", + "48" + ] + ], + 1, + [ + 0, + [ + "49", + "50", + "51" + ] + ], + 2, + [ + 0, + [ + "52", + "53", + "54" + ] + ] + ] + ] + ] + ], + 2, + [ + 1, + [ + 0, + [ + 1, + [ + 0, + [ + 0, + [ + "55", + "56", + "57" + ] + ], + 1, + [ + 0, + [ + "58", + "59", + "60" + ] + ], + 2, + [ + 0, + [ + "61", + "62", + "63" + ] + ] + ] + ], + 1, + [ + 1, + [ + 0, + [ + 0, + [ + "64", + "65", + "66" + ] + ], + 1, + [ + 0, + [ + "67", + "68", + "69" + ] + ], + 2, + [ + 0, + [ + "70", + "71", + "72" + ] + ] + ] + ], + 2, + [ + 1, + [ + 0, + [ + 0, + [ + "73", + "74", + "75" + ] + ], + 1, + [ + 0, + [ + "76", + "77", + "78" + ] + ], + 2, + [ + 0, + [ + "79", + "80", + "81" + ] + ] + ] + ] + ] + ] + ] + ] + ] + } + } + } + }, + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "test trees.Recursive Map": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "test trees.String Array": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "old": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "test trees.Recursive Map": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "test trees.String Array": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + } + } + } + ], + "revision": 3, + "sequenceNumber": 2, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "test trees.Recursive Map": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + } + }, + "test trees.String Array": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [ + "FieldA", + "FieldB", + "FieldC" + ], + "shapes": [ + { + "c": { + "type": "test trees.String Array", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "c": { + "type": "test trees.Recursive Map", + "value": false, + "extraFields": 4 + } + }, + { + "a": 3 + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + }, + { + "a": 5 + }, + { + "d": 0 + } + ], + "data": [ + [ + 1, + [ + 0, + [ + 1, + [ + 0, + [ + 1, + [ + 0, + [ + 0, + [ + "1", + "2", + "3" + ] + ], + 1, + [ + 0, + [ + "4", + "5", + "6" + ] + ], + 2, + [ + 0, + [ + "7", + "8", + "9" + ] + ] + ] + ], + 1, + [ + 1, + [ + 0, + [ + 0, + [ + "10", + "11", + "12" + ] + ], + 1, + [ + 0, + [ + "13", + "14", + "15" + ] + ], + 2, + [ + 0, + [ + "16", + "17", + "18" + ] + ] + ] + ], + 2, + [ + 1, + [ + 0, + [ + 0, + [ + "19", + "20", + "21" + ] + ], + 1, + [ + 0, + [ + "22", + "23", + "24" + ] + ], + 2, + [ + 0, + [ + "25", + "26", + "27" + ] + ] + ] + ] + ] + ], + 1, + [ + 1, + [ + 0, + [ + 1, + [ + 0, + [ + 0, + [ + "28", + "29", + "30" + ] + ], + 1, + [ + 0, + [ + "31", + "32", + "33" + ] + ], + 2, + [ + 0, + [ + "34", + "35", + "36" + ] + ] + ] + ], + 1, + [ + 1, + [ + 0, + [ + 0, + [ + "37", + "38", + "39" + ] + ], + 1, + [ + 0, + [ + "40", + "41", + "42" + ] + ], + 2, + [ + 0, + [ + "43", + "44", + "45" + ] + ] + ] + ], + 2, + [ + 1, + [ + 0, + [ + 0, + [ + "46", + "47", + "48" + ] + ], + 1, + [ + 0, + [ + "49", + "50", + "51" + ] + ], + 2, + [ + 0, + [ + "52", + "53", + "54" + ] + ] + ] + ] + ] + ], + 2, + [ + 1, + [ + 0, + [ + 1, + [ + 0, + [ + 0, + [ + "55", + "56", + "57" + ] + ], + 1, + [ + 0, + [ + "58", + "59", + "60" + ] + ], + 2, + [ + 0, + [ + "61", + "62", + "63" + ] + ] + ] + ], + 1, + [ + 1, + [ + 0, + [ + 0, + [ + "64", + "65", + "66" + ] + ], + 1, + [ + 0, + [ + "67", + "68", + "69" + ] + ], + 2, + [ + 0, + [ + "70", + "71", + "72" + ] + ] + ] + ], + 2, + [ + 1, + [ + 0, + [ + 0, + [ + "73", + "74", + "75" + ] + ], + 1, + [ + 0, + [ + "76", + "77", + "78" + ] + ], + 2, + [ + 0, + [ + "79", + "80", + "81" + ] + ] + ] + ] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 0 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/concurrent-inserts-tree2.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/concurrent-inserts-tree2.json new file mode 100644 index 000000000000..872ac3a51156 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/concurrent-inserts-tree2.json @@ -0,0 +1,452 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + "y" + ] + ] + } + } + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 3, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 2 + } + }, + "cellId": 2 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 2, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + "x" + ] + ] + } + } + } + } + ], + "revision": 5, + "sequenceNumber": 6, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 3, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 2, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + }, + { + "a": 2 + }, + { + "d": 0 + } + ], + "data": [ + [ + 1, + [ + 0, + "a", + 0, + "c" + ] + ] + ] + } + } + } + } + ], + "revision": 6, + "sequenceNumber": 8, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 4, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "insert": { + "id": 3 + } + }, + "cellId": 3 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 3, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + "b" + ] + ] + } + } + } + } + ], + "revision": 7, + "sequenceNumber": 9, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>", + "value": false, + "fields": [ + [ + "", + 1 + ] + ] + } + }, + { + "a": 2 + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + [ + "x", + "y", + "a", + "b", + "c" + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 5 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/concurrent-inserts-tree3.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/concurrent-inserts-tree3.json new file mode 100644 index 000000000000..0932923336af --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/concurrent-inserts-tree3.json @@ -0,0 +1,459 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 4, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "insert": { + "id": 3 + } + }, + "cellId": 3 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 3, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + "b" + ] + ] + } + } + } + } + ], + "revision": 7, + "sequenceNumber": 9, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 5, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 4 + } + }, + "cellId": 4 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 4, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + "z" + ] + ] + } + } + } + } + ], + "revision": 10, + "sequenceNumber": 11, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 5, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 2, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + }, + { + "a": 2 + }, + { + "d": 0 + } + ], + "data": [ + [ + 1, + [ + 0, + "d", + 0, + "e" + ] + ] + ] + } + } + } + } + ], + "revision": 11, + "sequenceNumber": 13, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 5, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "insert": { + "id": 3 + } + }, + "cellId": 3 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 3, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + "f" + ] + ] + } + } + } + } + ], + "revision": 12, + "sequenceNumber": 14, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>", + "value": false, + "fields": [ + [ + "", + 1 + ] + ] + } + }, + { + "a": 2 + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + [ + "z", + "x", + "d", + "f", + "e", + "y", + "a", + "b", + "c" + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 9 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/empty-root-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/empty-root-final.json new file mode 100644 index 000000000000..8ba67dbcb432 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/empty-root-final.json @@ -0,0 +1,150 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.number": { + "leaf": 0 + } + }, + "root": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 0, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0 + } + } + } + ] + } + } + ], + "revision": 2, + "sequenceNumber": 2, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [], + "data": [] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": -1 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/has-handle-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/has-handle-final.json new file mode 100644 index 000000000000..147afdfd52d9 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/has-handle-final.json @@ -0,0 +1,217 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 2, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "handleField", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.handle", + "value": true + } + } + ], + "data": [ + [ + 0, + { + "type": "__fluid_handle__", + "url": "/test/tree-0" + } + ] + ] + } + } + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.handle": { + "kind": { + "leaf": 3 + } + }, + "has-handle.HandleObject": { + "kind": { + "object": { + "handleField": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.handle" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "has-handle.HandleObject" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "has-handle.HandleObject", + "value": false, + "fields": [ + [ + "handleField", + 1 + ] + ] + } + }, + { + "a": 2 + }, + { + "c": { + "type": "com.fluidframework.leaf.handle", + "value": true + } + } + ], + "data": [ + [ + 0, + [ + { + "type": "__fluid_handle__", + "url": "/test/tree-0" + } + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 1 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-0-after-insert.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-0-after-insert.json new file mode 100644 index 000000000000..1d33e6042967 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-0-after-insert.json @@ -0,0 +1,215 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + "42" + ] + ] + } + } + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>", + "value": false, + "fields": [ + [ + "", + 1 + ] + ] + } + }, + { + "a": 2 + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 0, + [ + "42" + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 1 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-0-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-0-final.json new file mode 100644 index 000000000000..2ba02b5f30b7 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-0-final.json @@ -0,0 +1,193 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 3, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 2 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 5, + "sequenceNumber": 6, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-2" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + }, + { + "c": { + "type": "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + 0 + ], + [ + 0, + "42" + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 5, + 2, + 2 + ] + ], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-1-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-1-final.json new file mode 100644 index 000000000000..1b5548dfe640 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/insert-and-remove-tree-1-final.json @@ -0,0 +1,201 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 3, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 2 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 5, + "sequenceNumber": 6, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [ + [ + "8f95be09-8376-4ff7-8755-ccd7e8124b06", + { + "base": 5, + "commits": [] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-2" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + }, + { + "c": { + "type": "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + 0 + ], + [ + 0, + "42" + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 5, + 2, + 2 + ] + ], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/move-across-fields-tree-0-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/move-across-fields-tree-0-final.json new file mode 100644 index 000000000000..7c8660b6ddfe --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/move-across-fields-tree-0-final.json @@ -0,0 +1,503 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "move-across-fields.Node": { + "object": { + "bar": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + }, + "foo": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "move-across-fields.Node" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "c": { + "type": "move-across-fields.Node", + "value": false, + "fields": [ + [ + "foo", + 0 + ], + [ + "bar", + 0 + ] + ] + } + }, + { + "a": 3 + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 1, + [ + "a", + "b", + "c" + ], + [ + "d", + "e", + "f" + ] + ] + ] + } + } + } + }, + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "move-across-fields.Node": { + "object": { + "bar": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + }, + "foo": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "move-across-fields.Node" + ] + } + }, + "old": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "move-across-fields.Node": { + "object": { + "bar": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + }, + "foo": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "move-across-fields.Node" + ] + } + } + } + } + ], + "revision": 3, + "sequenceNumber": 2, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 7, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "foo", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 2, + "effect": { + "moveOut": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + }, + { + "fieldKey": "bar", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 2, + "effect": { + "moveIn": { + "id": 0 + } + }, + "cellId": 2 + } + ] + } + ] + } + ] + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "move-across-fields.Node": { + "kind": { + "object": { + "bar": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + }, + "foo": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "move-across-fields.Node" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "c": { + "type": "move-across-fields.Node", + "value": false, + "fields": [ + [ + "foo", + 0 + ], + [ + "bar", + 0 + ] + ] + } + }, + { + "a": 3 + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": true + } + } + ], + "data": [ + [ + 1, + [ + "a" + ], + [ + "d", + "b", + "c", + "e", + "f" + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/nested-sequence-change-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/nested-sequence-change-final.json new file mode 100644 index 000000000000..4b9e99021d20 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/nested-sequence-change-final.json @@ -0,0 +1,285 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 5, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0, + "changes": { + "fieldChanges": [ + { + "fieldKey": "foo", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 2, + "s": 3 + } + } + } + ] + } + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ], + [ + 3, + 1 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "test trees.Recursive Map", + "value": false, + "extraFields": 3 + } + }, + { + "c": { + "type": "test trees.Array<[\"test trees.Recursive Map\"]>", + "value": false, + "fields": [ + [ + "", + 2 + ] + ] + } + }, + { + "a": 0 + }, + { + "a": 1 + } + ], + "data": [ + [ + 0, + [] + ], + [ + 1, + [ + [ + "bar", + [ + 0 + ] + ] + ] + ] + ] + } + } + } + } + ], + "revision": 6, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "test trees.Array<[\"test trees.Recursive Map\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "test trees.Recursive Map" + ] + } + } + } + }, + "test trees.Recursive Map": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Array<[\"test trees.Recursive Map\"]>" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test trees.Array<[\"test trees.Recursive Map\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "test trees.Array<[\"test trees.Recursive Map\"]>", + "value": false, + "fields": [ + [ + "", + 1 + ] + ] + } + }, + { + "a": 2 + }, + { + "c": { + "type": "test trees.Recursive Map", + "value": false, + "extraFields": 3 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 0, + [ + [ + "foo", + [ + [ + [ + "bar", + [ + 0 + ] + ] + ] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/optional-field-scenarios-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/optional-field-scenarios-final.json new file mode 100644 index 000000000000..f81a712fde37 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/optional-field-scenarios-final.json @@ -0,0 +1,550 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 2, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "root 1 child", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + } + ], + "data": [ + [ + 0, + 40 + ] + ] + } + } + } + } + ], + "revision": 515, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 4, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": false, + "d": 3, + "s": 4 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 4, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "optional-field-scenarios.Map", + "value": false, + "extraFields": 2 + } + }, + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + }, + { + "a": 3 + }, + { + "d": 0 + } + ], + "data": [ + [ + 0, + [ + "root 2 child", + [ + 1, + 41 + ] + ] + ] + ] + } + } + } + } + ], + "revision": 516, + "sequenceNumber": 8, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 7, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": false, + "d": 3, + "s": 4 + }, + "c": [ + [ + [ + 3, + 516 + ], + { + "fieldChanges": [ + { + "fieldKey": "root 1 child", + "fieldKind": "Optional", + "change": { + "r": { + "e": false, + "d": 0, + "s": 1 + } + } + } + ] + } + ], + [ + 4, + { + "fieldChanges": [ + { + "fieldKey": "root 3 child", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 5, + "s": 6 + } + } + } + ] + } + ] + ] + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ], + [ + 4, + 1 + ], + [ + 6, + 2 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + }, + { + "c": { + "type": "optional-field-scenarios.Map", + "value": false, + "extraFields": 2 + } + }, + { + "a": 3 + }, + { + "d": 0 + } + ], + "data": [ + [ + 0, + 42 + ], + [ + 1, + [] + ], + [ + 0, + 43 + ] + ] + } + } + } + } + ], + "revision": 7, + "sequenceNumber": 10, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 7, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "c": [ + [ + null, + { + "fieldChanges": [ + { + "fieldKey": "root 3 child", + "fieldKind": "Optional", + "change": { + "r": { + "e": false, + "d": 2, + "s": 3 + } + } + } + ] + } + ] + ] + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 3, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + } + ], + "data": [ + [ + 0, + 44 + ] + ] + } + } + } + } + ], + "revision": 8, + "sequenceNumber": 12, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": 516, + "commits": [] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "optional-field-scenarios.Map": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number", + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "optional-field-scenarios.Map" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-6", + "repair-8", + "repair-10", + "repair-11" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.fluidframework.leaf.number", + "value": true + } + }, + { + "c": { + "type": "optional-field-scenarios.Map", + "value": false, + "extraFields": 2 + } + }, + { + "a": 3 + }, + { + "d": 0 + } + ], + "data": [ + [ + 1, + [ + "root 3 child", + [ + 0, + 44 + ] + ] + ], + [ + 0, + 43 + ], + [ + 0, + 40 + ], + [ + 1, + [ + "root 1 child", + [ + 0, + 42 + ] + ] + ], + [ + 1, + [ + "root 2 child", + [ + 0, + 41 + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 7, + [ + [ + 0, + 8 + ], + [ + 3, + 11 + ] + ] + ], + [ + 8, + 2, + 6 + ], + [ + 516, + 3, + 10 + ] + ], + "maxId": 11 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/tree-with-identifier-field-final.json b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/tree-with-identifier-field-final.json new file mode 100644 index 000000000000..fde6b9bf93c8 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Compressed/v5/tree-with-identifier-field-final.json @@ -0,0 +1,293 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.example.parent": { + "object": { + "identifier": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "com.fluidframework.leaf.string": { + "leaf": 1 + } + }, + "root": { + "kind": "Optional", + "types": [ + "com.example.parent" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.example.parent", + "value": false, + "fields": [ + [ + "identifier", + 1 + ] + ] + } + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": 0 + } + } + ], + "data": [ + [ + 0, + 0 + ] + ] + } + } + } + }, + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.example.parent": { + "object": { + "identifier": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "com.fluidframework.leaf.string": { + "leaf": 1 + } + }, + "root": { + "kind": "Value", + "types": [ + "com.example.parent" + ] + } + }, + "old": { + "version": 1, + "nodes": { + "com.example.parent": { + "object": { + "identifier": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "com.fluidframework.leaf.string": { + "leaf": 1 + } + }, + "root": { + "kind": "Optional", + "types": [ + "com.example.parent" + ] + } + } + } + } + ], + "revision": 4, + "sequenceNumber": 2, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.example.parent": { + "kind": { + "object": { + "identifier": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "com.example.parent" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "type": "com.example.parent", + "value": false, + "fields": [ + [ + "identifier", + 1 + ] + ] + } + }, + { + "c": { + "type": "com.fluidframework.leaf.string", + "value": 0 + } + } + ], + "data": [ + [ + 0, + 0 + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 0 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/attachment-tree-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/attachment-tree-final.json new file mode 100644 index 000000000000..12de4a9be4a3 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/attachment-tree-final.json @@ -0,0 +1,143 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "attachment-tree.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "attachment-tree.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "attachment-tree.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "a", + [], + "com.fluidframework.leaf.string", + true, + "b", + [] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-0.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-0.json new file mode 100644 index 000000000000..a997f61131d8 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-0.json @@ -0,0 +1,392 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 4 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 516 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sequenceNumber": 8, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + } + ] + } + ], + [ + "5a126183-91e7-488a-b7e9-3342a05c25ae", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-3" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.number", + true, + 1, + [], + "com.fluidframework.leaf.number", + true, + 2, + [], + "com.fluidframework.leaf.number", + true, + 3, + [] + ] + ] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 0, + [] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 1029, + 0, + 3 + ] + ], + "maxId": 3 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-1.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-1.json new file mode 100644 index 000000000000..c53f6d03a5c9 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-1.json @@ -0,0 +1,407 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 4 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 516 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sequenceNumber": 8, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + } + ] + } + ], + [ + "5a126183-91e7-488a-b7e9-3342a05c25ae", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-3" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.number", + true, + 0, + [], + "com.fluidframework.leaf.number", + true, + 2, + [], + "com.fluidframework.leaf.number", + true, + 3, + [] + ] + ] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 1, + [] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 1029, + 0, + 3 + ] + ], + "maxId": 3 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-2.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-2.json new file mode 100644 index 000000000000..0c6701cc4444 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-2.json @@ -0,0 +1,407 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 4 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 516 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sequenceNumber": 8, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + } + ] + } + ], + [ + "5a126183-91e7-488a-b7e9-3342a05c25ae", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-3" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.number", + true, + 0, + [], + "com.fluidframework.leaf.number", + true, + 1, + [], + "com.fluidframework.leaf.number", + true, + 3, + [] + ] + ] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 2, + [] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 1029, + 0, + 3 + ] + ], + "maxId": 3 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-3.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-3.json new file mode 100644 index 000000000000..6d2070481806 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/competing-removes-index-3.json @@ -0,0 +1,407 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 4 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + }, + "cellId": [ + 0, + 516 + ] + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sequenceNumber": 8, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 516, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + } + ] + } + ], + [ + "5a126183-91e7-488a-b7e9-3342a05c25ae", + { + "base": "root", + "commits": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "remove": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 1029, + "sessionId": "5a126183-91e7-488a-b7e9-3342a05c25ae" + } + ] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.number" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-3" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "competing-removes.Array<[\"com.fluidframework.leaf.number\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.number", + true, + 0, + [], + "com.fluidframework.leaf.number", + true, + 1, + [], + "com.fluidframework.leaf.number", + true, + 2, + [] + ] + ] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 3, + [] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 1029, + 0, + 3 + ] + ], + "maxId": 3 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/complete-3x3-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/complete-3x3-final.json new file mode 100644 index 000000000000..2393da2840ca --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/complete-3x3-final.json @@ -0,0 +1,1681 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "test trees.Recursive Map": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "test trees.String Array": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "1", + [], + "com.fluidframework.leaf.string", + true, + "2", + [], + "com.fluidframework.leaf.string", + true, + "3", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "4", + [], + "com.fluidframework.leaf.string", + true, + "5", + [], + "com.fluidframework.leaf.string", + true, + "6", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "7", + [], + "com.fluidframework.leaf.string", + true, + "8", + [], + "com.fluidframework.leaf.string", + true, + "9", + [] + ] + ] + ] + ] + ], + "FieldB", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "10", + [], + "com.fluidframework.leaf.string", + true, + "11", + [], + "com.fluidframework.leaf.string", + true, + "12", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "13", + [], + "com.fluidframework.leaf.string", + true, + "14", + [], + "com.fluidframework.leaf.string", + true, + "15", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "16", + [], + "com.fluidframework.leaf.string", + true, + "17", + [], + "com.fluidframework.leaf.string", + true, + "18", + [] + ] + ] + ] + ] + ], + "FieldC", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "19", + [], + "com.fluidframework.leaf.string", + true, + "20", + [], + "com.fluidframework.leaf.string", + true, + "21", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "22", + [], + "com.fluidframework.leaf.string", + true, + "23", + [], + "com.fluidframework.leaf.string", + true, + "24", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "25", + [], + "com.fluidframework.leaf.string", + true, + "26", + [], + "com.fluidframework.leaf.string", + true, + "27", + [] + ] + ] + ] + ] + ] + ] + ], + "FieldB", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "28", + [], + "com.fluidframework.leaf.string", + true, + "29", + [], + "com.fluidframework.leaf.string", + true, + "30", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "31", + [], + "com.fluidframework.leaf.string", + true, + "32", + [], + "com.fluidframework.leaf.string", + true, + "33", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "34", + [], + "com.fluidframework.leaf.string", + true, + "35", + [], + "com.fluidframework.leaf.string", + true, + "36", + [] + ] + ] + ] + ] + ], + "FieldB", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "37", + [], + "com.fluidframework.leaf.string", + true, + "38", + [], + "com.fluidframework.leaf.string", + true, + "39", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "40", + [], + "com.fluidframework.leaf.string", + true, + "41", + [], + "com.fluidframework.leaf.string", + true, + "42", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "43", + [], + "com.fluidframework.leaf.string", + true, + "44", + [], + "com.fluidframework.leaf.string", + true, + "45", + [] + ] + ] + ] + ] + ], + "FieldC", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "46", + [], + "com.fluidframework.leaf.string", + true, + "47", + [], + "com.fluidframework.leaf.string", + true, + "48", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "49", + [], + "com.fluidframework.leaf.string", + true, + "50", + [], + "com.fluidframework.leaf.string", + true, + "51", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "52", + [], + "com.fluidframework.leaf.string", + true, + "53", + [], + "com.fluidframework.leaf.string", + true, + "54", + [] + ] + ] + ] + ] + ] + ] + ], + "FieldC", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "55", + [], + "com.fluidframework.leaf.string", + true, + "56", + [], + "com.fluidframework.leaf.string", + true, + "57", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "58", + [], + "com.fluidframework.leaf.string", + true, + "59", + [], + "com.fluidframework.leaf.string", + true, + "60", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "61", + [], + "com.fluidframework.leaf.string", + true, + "62", + [], + "com.fluidframework.leaf.string", + true, + "63", + [] + ] + ] + ] + ] + ], + "FieldB", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "64", + [], + "com.fluidframework.leaf.string", + true, + "65", + [], + "com.fluidframework.leaf.string", + true, + "66", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "67", + [], + "com.fluidframework.leaf.string", + true, + "68", + [], + "com.fluidframework.leaf.string", + true, + "69", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "70", + [], + "com.fluidframework.leaf.string", + true, + "71", + [], + "com.fluidframework.leaf.string", + true, + "72", + [] + ] + ] + ] + ] + ], + "FieldC", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "73", + [], + "com.fluidframework.leaf.string", + true, + "74", + [], + "com.fluidframework.leaf.string", + true, + "75", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "76", + [], + "com.fluidframework.leaf.string", + true, + "77", + [], + "com.fluidframework.leaf.string", + true, + "78", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "79", + [], + "com.fluidframework.leaf.string", + true, + "80", + [], + "com.fluidframework.leaf.string", + true, + "81", + [] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + } + } + } + }, + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "test trees.Recursive Map": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "test trees.String Array": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "old": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "test trees.Recursive Map": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "test trees.String Array": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + } + } + } + ], + "revision": 3, + "sequenceNumber": 2, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "test trees.Recursive Map": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + } + }, + "test trees.String Array": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test trees.Recursive Map", + "test trees.String Array" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "1", + [], + "com.fluidframework.leaf.string", + true, + "2", + [], + "com.fluidframework.leaf.string", + true, + "3", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "4", + [], + "com.fluidframework.leaf.string", + true, + "5", + [], + "com.fluidframework.leaf.string", + true, + "6", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "7", + [], + "com.fluidframework.leaf.string", + true, + "8", + [], + "com.fluidframework.leaf.string", + true, + "9", + [] + ] + ] + ] + ] + ], + "FieldB", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "10", + [], + "com.fluidframework.leaf.string", + true, + "11", + [], + "com.fluidframework.leaf.string", + true, + "12", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "13", + [], + "com.fluidframework.leaf.string", + true, + "14", + [], + "com.fluidframework.leaf.string", + true, + "15", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "16", + [], + "com.fluidframework.leaf.string", + true, + "17", + [], + "com.fluidframework.leaf.string", + true, + "18", + [] + ] + ] + ] + ] + ], + "FieldC", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "19", + [], + "com.fluidframework.leaf.string", + true, + "20", + [], + "com.fluidframework.leaf.string", + true, + "21", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "22", + [], + "com.fluidframework.leaf.string", + true, + "23", + [], + "com.fluidframework.leaf.string", + true, + "24", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "25", + [], + "com.fluidframework.leaf.string", + true, + "26", + [], + "com.fluidframework.leaf.string", + true, + "27", + [] + ] + ] + ] + ] + ] + ] + ], + "FieldB", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "28", + [], + "com.fluidframework.leaf.string", + true, + "29", + [], + "com.fluidframework.leaf.string", + true, + "30", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "31", + [], + "com.fluidframework.leaf.string", + true, + "32", + [], + "com.fluidframework.leaf.string", + true, + "33", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "34", + [], + "com.fluidframework.leaf.string", + true, + "35", + [], + "com.fluidframework.leaf.string", + true, + "36", + [] + ] + ] + ] + ] + ], + "FieldB", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "37", + [], + "com.fluidframework.leaf.string", + true, + "38", + [], + "com.fluidframework.leaf.string", + true, + "39", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "40", + [], + "com.fluidframework.leaf.string", + true, + "41", + [], + "com.fluidframework.leaf.string", + true, + "42", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "43", + [], + "com.fluidframework.leaf.string", + true, + "44", + [], + "com.fluidframework.leaf.string", + true, + "45", + [] + ] + ] + ] + ] + ], + "FieldC", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "46", + [], + "com.fluidframework.leaf.string", + true, + "47", + [], + "com.fluidframework.leaf.string", + true, + "48", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "49", + [], + "com.fluidframework.leaf.string", + true, + "50", + [], + "com.fluidframework.leaf.string", + true, + "51", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "52", + [], + "com.fluidframework.leaf.string", + true, + "53", + [], + "com.fluidframework.leaf.string", + true, + "54", + [] + ] + ] + ] + ] + ] + ] + ], + "FieldC", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "55", + [], + "com.fluidframework.leaf.string", + true, + "56", + [], + "com.fluidframework.leaf.string", + true, + "57", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "58", + [], + "com.fluidframework.leaf.string", + true, + "59", + [], + "com.fluidframework.leaf.string", + true, + "60", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "61", + [], + "com.fluidframework.leaf.string", + true, + "62", + [], + "com.fluidframework.leaf.string", + true, + "63", + [] + ] + ] + ] + ] + ], + "FieldB", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "64", + [], + "com.fluidframework.leaf.string", + true, + "65", + [], + "com.fluidframework.leaf.string", + true, + "66", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "67", + [], + "com.fluidframework.leaf.string", + true, + "68", + [], + "com.fluidframework.leaf.string", + true, + "69", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "70", + [], + "com.fluidframework.leaf.string", + true, + "71", + [], + "com.fluidframework.leaf.string", + true, + "72", + [] + ] + ] + ] + ] + ], + "FieldC", + [ + "test trees.Recursive Map", + false, + [ + "FieldA", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "73", + [], + "com.fluidframework.leaf.string", + true, + "74", + [], + "com.fluidframework.leaf.string", + true, + "75", + [] + ] + ] + ], + "FieldB", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "76", + [], + "com.fluidframework.leaf.string", + true, + "77", + [], + "com.fluidframework.leaf.string", + true, + "78", + [] + ] + ] + ], + "FieldC", + [ + "test trees.String Array", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "79", + [], + "com.fluidframework.leaf.string", + true, + "80", + [], + "com.fluidframework.leaf.string", + true, + "81", + [] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 0 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/concurrent-inserts-tree2.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/concurrent-inserts-tree2.json new file mode 100644 index 000000000000..5baf8af2d4d6 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/concurrent-inserts-tree2.json @@ -0,0 +1,482 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "y", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 3, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 2 + } + }, + "cellId": 2 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 2, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "x", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 5, + "sequenceNumber": 6, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 3, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 2, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "a", + [], + "com.fluidframework.leaf.string", + true, + "c", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 6, + "sequenceNumber": 8, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 4, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "insert": { + "id": 3 + } + }, + "cellId": 3 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 3, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "b", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 7, + "sequenceNumber": 9, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "x", + [], + "com.fluidframework.leaf.string", + true, + "y", + [], + "com.fluidframework.leaf.string", + true, + "a", + [], + "com.fluidframework.leaf.string", + true, + "b", + [], + "com.fluidframework.leaf.string", + true, + "c", + [] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 5 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/concurrent-inserts-tree3.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/concurrent-inserts-tree3.json new file mode 100644 index 000000000000..391d515c38e3 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/concurrent-inserts-tree3.json @@ -0,0 +1,501 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 4, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "insert": { + "id": 3 + } + }, + "cellId": 3 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 3, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "b", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 7, + "sequenceNumber": 9, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 5, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 4 + } + }, + "cellId": 4 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 4, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "z", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 10, + "sequenceNumber": 11, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 5, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 2 + }, + { + "count": 2, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "d", + [], + "com.fluidframework.leaf.string", + true, + "e", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 11, + "sequenceNumber": 13, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 5, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 3 + }, + { + "count": 1, + "effect": { + "insert": { + "id": 3 + } + }, + "cellId": 3 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 3, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "f", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 12, + "sequenceNumber": 14, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "concurrent-inserts.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "z", + [], + "com.fluidframework.leaf.string", + true, + "x", + [], + "com.fluidframework.leaf.string", + true, + "d", + [], + "com.fluidframework.leaf.string", + true, + "f", + [], + "com.fluidframework.leaf.string", + true, + "e", + [], + "com.fluidframework.leaf.string", + true, + "y", + [], + "com.fluidframework.leaf.string", + true, + "a", + [], + "com.fluidframework.leaf.string", + true, + "b", + [], + "com.fluidframework.leaf.string", + true, + "c", + [] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 9 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/empty-root-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/empty-root-final.json new file mode 100644 index 000000000000..493447f7c798 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/empty-root-final.json @@ -0,0 +1,159 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.number": { + "leaf": 0 + } + }, + "root": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 0, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0 + } + } + } + ] + } + } + ], + "revision": 2, + "sequenceNumber": 2, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": -1 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/has-handle-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/has-handle-final.json new file mode 100644 index 000000000000..d3d4b1b5ec56 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/has-handle-final.json @@ -0,0 +1,221 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 2, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "handleField", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.handle", + true, + { + "type": "__fluid_handle__", + "url": "/test/tree-0" + }, + [] + ] + ] + ] + } + } + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.handle": { + "kind": { + "leaf": 3 + } + }, + "has-handle.HandleObject": { + "kind": { + "object": { + "handleField": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.handle" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "has-handle.HandleObject" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "has-handle.HandleObject", + false, + [ + "handleField", + [ + "com.fluidframework.leaf.handle", + true, + { + "type": "__fluid_handle__", + "url": "/test/tree-0" + }, + [] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 1 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-0-after-insert.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-0-after-insert.json new file mode 100644 index 000000000000..0e96258b3a59 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-0-after-insert.json @@ -0,0 +1,219 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0 + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "42", + [] + ] + ] + ] + } + } + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "42", + [] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 1 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-0-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-0-final.json new file mode 100644 index 000000000000..d628b6b9a50b --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-0-final.json @@ -0,0 +1,189 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 3, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 2 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 5, + "sequenceNumber": 6, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-2" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "42", + [] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 5, + 2, + 2 + ] + ], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-1-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-1-final.json new file mode 100644 index 000000000000..93f5126f17c0 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/insert-and-remove-tree-1-final.json @@ -0,0 +1,197 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 3, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "remove": { + "id": 2 + } + } + } + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 5, + "sequenceNumber": 6, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [ + [ + "8f95be09-8376-4ff7-8755-ccd7e8124b06", + { + "base": 5, + "commits": [] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-2" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "insert-and-remove.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.string", + true, + "42", + [] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 5, + 2, + 2 + ] + ], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/move-across-fields-tree-0-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/move-across-fields-tree-0-final.json new file mode 100644 index 000000000000..848c10c2e5ab --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/move-across-fields-tree-0-final.json @@ -0,0 +1,525 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "move-across-fields.Node": { + "object": { + "bar": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + }, + "foo": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "move-across-fields.Node" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "move-across-fields.Node", + false, + [ + "foo", + [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "a", + [], + "com.fluidframework.leaf.string", + true, + "b", + [], + "com.fluidframework.leaf.string", + true, + "c", + [] + ] + ] + ], + "bar", + [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "d", + [], + "com.fluidframework.leaf.string", + true, + "e", + [], + "com.fluidframework.leaf.string", + true, + "f", + [] + ] + ] + ] + ] + ] + ] + ] + } + } + } + }, + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "move-across-fields.Node": { + "object": { + "bar": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + }, + "foo": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "move-across-fields.Node" + ] + } + }, + "old": { + "version": 1, + "nodes": { + "com.fluidframework.leaf.string": { + "leaf": 1 + }, + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "move-across-fields.Node": { + "object": { + "bar": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + }, + "foo": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "move-across-fields.Node" + ] + } + } + } + } + ], + "revision": 3, + "sequenceNumber": 2, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 7, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "foo", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 2, + "effect": { + "moveOut": { + "id": 0 + } + } + } + ] + } + ] + } + ] + ] + }, + { + "fieldKey": "bar", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1 + }, + { + "count": 2, + "effect": { + "moveIn": { + "id": 0 + } + }, + "cellId": 2 + } + ] + } + ] + } + ] + ] + } + ] + } + ] + ] + } + ] + } + } + ], + "revision": 4, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "move-across-fields.Node": { + "kind": { + "object": { + "bar": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + }, + "foo": { + "kind": "Value", + "types": [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>" + ] + } + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "move-across-fields.Node" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "move-across-fields.Node", + false, + [ + "foo", + [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "a", + [] + ] + ] + ], + "bar", + [ + "move-across-fields.Array<[\"com.fluidframework.leaf.string\"]>", + false, + [ + "", + [ + "com.fluidframework.leaf.string", + true, + "d", + [], + "com.fluidframework.leaf.string", + true, + "b", + [], + "com.fluidframework.leaf.string", + true, + "c", + [], + "com.fluidframework.leaf.string", + true, + "e", + [], + "com.fluidframework.leaf.string", + true, + "f", + [] + ] + ] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/nested-sequence-change-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/nested-sequence-change-final.json new file mode 100644 index 000000000000..8e0933e210e8 --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/nested-sequence-change-final.json @@ -0,0 +1,284 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 5, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "", + "fieldKind": "Sequence", + "change": [ + { + "count": 1, + "effect": { + "insert": { + "id": 0 + } + }, + "cellId": 0, + "changes": { + "fieldChanges": [ + { + "fieldKey": "foo", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 2, + "s": 3 + } + } + } + ] + } + } + ] + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 0, + 0 + ], + [ + 3, + 1 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "test trees.Recursive Map", + false, + [] + ] + ], + [ + 1, + [ + "test trees.Array<[\"test trees.Recursive Map\"]>", + false, + [ + "", + [ + "test trees.Recursive Map", + false, + [ + "bar", + [ + "test trees.Array<[\"test trees.Recursive Map\"]>", + false, + [] + ] + ] + ] + ] + ] + ] + ] + } + } + } + } + ], + "revision": 6, + "sequenceNumber": 4, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "test trees.Array<[\"test trees.Recursive Map\"]>": { + "kind": { + "object": { + "": { + "kind": "Sequence", + "types": [ + "test trees.Recursive Map" + ] + } + } + } + }, + "test trees.Recursive Map": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "test trees.Array<[\"test trees.Recursive Map\"]>" + ] + } + } + } + }, + "root": { + "kind": "Value", + "types": [ + "test trees.Array<[\"test trees.Recursive Map\"]>" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "test trees.Array<[\"test trees.Recursive Map\"]>", + false, + [ + "", + [ + "test trees.Recursive Map", + false, + [ + "foo", + [ + "test trees.Array<[\"test trees.Recursive Map\"]>", + false, + [ + "", + [ + "test trees.Recursive Map", + false, + [ + "bar", + [ + "test trees.Array<[\"test trees.Recursive Map\"]>", + false, + [] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 2 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/optional-field-scenarios-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/optional-field-scenarios-final.json new file mode 100644 index 000000000000..76a84617fe2f --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/optional-field-scenarios-final.json @@ -0,0 +1,579 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "data": { + "maxId": 2, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "ModularEditBuilder.Generic", + "change": [ + [ + 0, + { + "fieldChanges": [ + { + "fieldKey": "root 1 child", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ] + } + ] + ] + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 40, + [] + ] + ] + ] + } + } + } + } + ], + "revision": 515, + "sequenceNumber": 6, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 4, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": false, + "d": 3, + "s": 4 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 4, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "optional-field-scenarios.Map", + false, + [ + "root 2 child", + [ + "com.fluidframework.leaf.number", + true, + 41, + [] + ] + ] + ] + ] + ] + } + } + } + } + ], + "revision": 516, + "sequenceNumber": 8, + "sessionId": "a0693eac-892a-4396-86f7-ad20dc1cade2" + }, + { + "change": [ + { + "data": { + "maxId": 7, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": false, + "d": 3, + "s": 4 + }, + "c": [ + [ + [ + 3, + 516 + ], + { + "fieldChanges": [ + { + "fieldKey": "root 1 child", + "fieldKind": "Optional", + "change": { + "r": { + "e": false, + "d": 0, + "s": 1 + } + } + } + ] + } + ], + [ + 4, + { + "fieldChanges": [ + { + "fieldKey": "root 3 child", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 5, + "s": 6 + } + } + } + ] + } + ] + ] + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ], + [ + 4, + 1 + ], + [ + 6, + 2 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 42, + [] + ] + ], + [ + 1, + [ + "optional-field-scenarios.Map", + false, + [] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 43, + [] + ] + ] + ] + } + } + } + } + ], + "revision": 7, + "sequenceNumber": 10, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + }, + { + "change": [ + { + "data": { + "maxId": 7, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "c": [ + [ + null, + { + "fieldChanges": [ + { + "fieldKey": "root 3 child", + "fieldKind": "Optional", + "change": { + "r": { + "e": false, + "d": 2, + "s": 3 + } + } + } + ] + } + ] + ] + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 3, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 44, + [] + ] + ] + ] + } + } + } + } + ], + "revision": 8, + "sequenceNumber": 12, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [ + [ + "a0693eac-892a-4396-86f7-ad20dc1cade2", + { + "base": 516, + "commits": [] + } + ] + ], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.fluidframework.leaf.number": { + "kind": { + "leaf": 0 + } + }, + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + }, + "optional-field-scenarios.Map": { + "kind": { + "map": { + "kind": "Optional", + "types": [ + "com.fluidframework.leaf.number", + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "root": { + "kind": "Optional", + "types": [ + "optional-field-scenarios.Map" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey", + "repair-6", + "repair-8", + "repair-10", + "repair-11" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "optional-field-scenarios.Map", + false, + [ + "root 3 child", + [ + "com.fluidframework.leaf.number", + true, + 44, + [] + ] + ] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 43, + [] + ] + ], + [ + 1, + [ + "com.fluidframework.leaf.number", + true, + 40, + [] + ] + ], + [ + 1, + [ + "optional-field-scenarios.Map", + false, + [ + "root 1 child", + [ + "com.fluidframework.leaf.number", + true, + 42, + [] + ] + ] + ] + ], + [ + 1, + [ + "optional-field-scenarios.Map", + false, + [ + "root 2 child", + [ + "com.fluidframework.leaf.number", + true, + 41, + [] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [ + [ + 7, + [ + [ + 0, + 8 + ], + [ + 3, + 11 + ] + ] + ], + [ + 8, + 2, + 6 + ], + [ + 516, + 3, + 10 + ] + ], + "maxId": 11 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/tree-with-identifier-field-final.json b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/tree-with-identifier-field-final.json new file mode 100644 index 000000000000..d12432c0f1dc --- /dev/null +++ b/packages/dds/tree/src/test/snapshots/summary/Uncompressed/v5/tree-with-identifier-field-final.json @@ -0,0 +1,297 @@ +{ + "type": "tree", + "tree": { + "type": "tree", + "indexes": { + "type": "tree", + "entries": [ + { + "type": "tree", + "EditManager": { + "type": "tree", + "tree": { + "type": "blob", + "String": { + "type": "blob", + "content": { + "trunk": [ + { + "change": [ + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.example.parent": { + "object": { + "identifier": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "com.fluidframework.leaf.string": { + "leaf": 1 + } + }, + "root": { + "kind": "Optional", + "types": [ + "com.example.parent" + ] + } + }, + "old": { + "version": 1, + "nodes": {}, + "root": { + "kind": "Forbidden", + "types": [] + } + } + } + }, + { + "data": { + "maxId": 1, + "changes": [ + { + "fieldKey": "rootFieldKey", + "fieldKind": "Optional", + "change": { + "r": { + "e": true, + "d": 0, + "s": 1 + } + } + } + ], + "builds": { + "builds": [ + [ + [ + [ + 1, + 0 + ] + ] + ] + ], + "trees": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.example.parent", + false, + [ + "identifier", + [ + "com.fluidframework.leaf.string", + true, + "8f95be09-8376-4ff7-8755-ccd7e8124b06", + [] + ] + ] + ] + ] + ] + } + } + } + }, + { + "schema": { + "new": { + "version": 1, + "nodes": { + "com.example.parent": { + "object": { + "identifier": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "com.fluidframework.leaf.string": { + "leaf": 1 + } + }, + "root": { + "kind": "Value", + "types": [ + "com.example.parent" + ] + } + }, + "old": { + "version": 1, + "nodes": { + "com.example.parent": { + "object": { + "identifier": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + }, + "com.fluidframework.leaf.string": { + "leaf": 1 + } + }, + "root": { + "kind": "Optional", + "types": [ + "com.example.parent" + ] + } + } + } + } + ], + "revision": 4, + "sequenceNumber": 2, + "sessionId": "8f95be09-8376-4ff7-8755-ccd7e8124b06" + } + ], + "branches": [], + "version": 4 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Schema": { + "type": "tree", + "tree": { + "type": "blob", + "SchemaString": { + "type": "blob", + "content": { + "version": 2, + "nodes": { + "com.example.parent": { + "kind": { + "object": { + "identifier": { + "kind": "Identifier", + "types": [ + "com.fluidframework.leaf.string" + ] + } + } + } + }, + "com.fluidframework.leaf.string": { + "kind": { + "leaf": 1 + } + } + }, + "root": { + "kind": "Value", + "types": [ + "com.example.parent" + ] + } + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "Forest": { + "type": "tree", + "tree": { + "type": "blob", + "ForestTree": { + "type": "blob", + "content": { + "keys": [ + "rootFieldKey" + ], + "fields": { + "version": 1, + "identifiers": [], + "shapes": [ + { + "c": { + "extraFields": 1 + } + }, + { + "a": 0 + } + ], + "data": [ + [ + 1, + [ + "com.example.parent", + false, + [ + "identifier", + [ + "com.fluidframework.leaf.string", + true, + "8f95be09-8376-4ff7-8755-ccd7e8124b06", + [] + ] + ] + ] + ] + ] + }, + "version": 1 + }, + "encoding": "utf-8" + } + } + } + }, + { + "type": "tree", + "DetachedFieldIndex": { + "type": "tree", + "tree": { + "type": "blob", + "DetachedFieldIndexBlob": { + "type": "blob", + "content": { + "version": 1, + "data": [], + "maxId": 0 + }, + "encoding": "utf-8" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/dds/tree/src/test/utils.ts b/packages/dds/tree/src/test/utils.ts index 2005c374eae2..1773fad05e5b 100644 --- a/packages/dds/tree/src/test/utils.ts +++ b/packages/dds/tree/src/test/utils.ts @@ -638,15 +638,11 @@ export function validateTree(tree: ITreeCheckout, expected: JsonableTree[]): voi assert.deepEqual(actual, expected); } -const schemaCodec = makeSchemaCodec({ jsonValidator: typeboxValidator }, SchemaVersion.v1); - -// If you are adding a new schema format, consider changing the encoding format used in the above codec, given +// If you are adding a new schema format, consider changing the encoding format used for this codec, given // that equality of two schemas in tests is achieved by deep-comparing their persisted representations. -// Note we have to divide the length of the return value from `Object.keys` to get the number of enum entries. -assert( - Object.keys(SchemaVersion).length / 2 === 1, - "This code only handles a single schema codec version.", -); +// If the newer format is a superset of the previous format, it can be safely used for comparisons. This is the +// case with schema format v2. +const schemaCodec = makeSchemaCodec({ jsonValidator: typeboxValidator }, SchemaVersion.v2); export function checkRemovedRootsAreSynchronized(trees: readonly ITreeCheckout[]): void { if (trees.length > 1) { diff --git a/packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md b/packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md index d4c72a8073ce..4a4c9080ac27 100644 --- a/packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md +++ b/packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md @@ -1226,6 +1226,7 @@ export const SharedTreeFormatVersion: { readonly v1: 1; readonly v2: 2; readonly v3: 3; + readonly v5: 5; }; // @alpha