@fluid-experimental/tree 0.59.3000 → 0.59.3003

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/SharedTree.d.ts +30 -89
  2. package/dist/SharedTree.d.ts.map +1 -1
  3. package/dist/SharedTree.js +58 -93
  4. package/dist/SharedTree.js.map +1 -1
  5. package/dist/SharedTreeEncoder.d.ts +1 -1
  6. package/dist/SharedTreeEncoder.d.ts.map +1 -1
  7. package/dist/SharedTreeEncoder.js.map +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/lib/SharedTree.d.ts +30 -89
  12. package/lib/SharedTree.d.ts.map +1 -1
  13. package/lib/SharedTree.js +59 -94
  14. package/lib/SharedTree.js.map +1 -1
  15. package/lib/SharedTreeEncoder.d.ts +1 -1
  16. package/lib/SharedTreeEncoder.d.ts.map +1 -1
  17. package/lib/SharedTreeEncoder.js.map +1 -1
  18. package/lib/index.d.ts +1 -1
  19. package/lib/index.d.ts.map +1 -1
  20. package/lib/index.js.map +1 -1
  21. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -1
  22. package/lib/test/fuzz/SharedTreeFuzzTests.js +1 -3
  23. package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -1
  24. package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
  25. package/lib/test/utilities/SharedTreeTests.js +50 -27
  26. package/lib/test/utilities/SharedTreeTests.js.map +1 -1
  27. package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -1
  28. package/lib/test/utilities/SharedTreeVersioningTests.js +19 -19
  29. package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -1
  30. package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
  31. package/lib/test/utilities/TestUtilities.js +6 -4
  32. package/lib/test/utilities/TestUtilities.js.map +1 -1
  33. package/package.json +15 -15
  34. package/src/SharedTree.ts +46 -195
  35. package/src/SharedTreeEncoder.ts +1 -1
  36. package/src/index.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"SharedTreeEncoder.js","sourceRoot":"","sources":["../src/SharedTreeEncoder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAEN,gBAAgB,EAKhB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAEN,cAAc,EAEd,WAAW,EAIX,gBAAgB,EAGhB,kBAAkB,EAGlB,eAAe,EAMf,mBAAmB,EACnB,IAAI,GACJ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAkB,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,YAAY,GAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpE;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAInC,YAAoC,gBAAyB;QAAzB,qBAAgB,GAAhB,gBAAgB,CAAS;QAH5C,mBAAc,GAAG,IAAI,uBAAuB,EAAS,CAAC;QACtD,qBAAgB,GAA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B,cAAc,CACb;wBACC,OAAO;wBACP,EAAE,EAAE,MAAA,OAAO,CAAC,OAAO,EAAE,CAAC,mCAAI,IAAI,CAAC,kDAAkD,CAAC;qBAClF,EACD,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAC7C,CACD,CAAC;gBACH,CAAC,CAAC,CAAC;aACH;QACF,CAAC,CAAC,CAAC;QAEH,OAAO;YACN,WAAW,EAAE,2BAA2B,CAAC,WAAW,EAAE,WAAW,CAAC;YAClE,cAAc;YACd,OAAO,EAAE,WAAW,CAAC,MAAM;SAC3B,CAAC;IACH,CAAC;CACD;AAED,SAAS,YAAY,CAAC,KAA0D;IAC/E,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from '@fluidframework/common-utils';\nimport { assert, fail } from './Common';\nimport { EditLog } from './EditLog';\nimport { convertTreeNodes, newEdit } from './EditUtilities';\nimport { AttributionId, DetachedSequenceId, FinalNodeId, OpSpaceNodeId, TraitLabel } from './Identifiers';\nimport { initialTree } from './InitialTree';\nimport {\n\tContextualizedNodeIdNormalizer,\n\tgetNodeIdContext,\n\tNodeIdContext,\n\tNodeIdConverter,\n\tNodeIdGenerator,\n\tNodeIdNormalizer,\n\tscopeIdNormalizer,\n\tsequencedIdNormalizer,\n} from './NodeIdUtilities';\nimport { getChangeNodeFromView, getChangeNode_0_0_2FromView } from './SerializationUtilities';\nimport {\n\tCompressedChangeInternal,\n\tChangeInternal,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n\tChangeNode,\n\tEdit,\n\tSharedTreeEditOp,\n\tSharedTreeOpType,\n\tSharedTreeSummary,\n\tEditWithoutId,\n\tChangeTypeInternal,\n\tChangeInternal_0_0_2,\n\tSharedTreeEditOp_0_0_2,\n\treservedIdCount,\n\tChangeNode_0_0_2,\n\tEditChunkContents,\n\tEditLogSummary,\n\tEditChunkContents_0_1_1,\n\tFluidEditHandle,\n\tStablePlaceInternal,\n\tSide,\n} from './persisted-types';\nimport { RevisionView } from './RevisionView';\nimport { MutableStringInterner, StringInterner } from './StringInterner';\nimport { SummaryContents } from './Summary';\nimport { InterningTreeCompressor } from './TreeCompressor';\nimport {\n\tcreateSessionId,\n\thasOngoingSession,\n\tIdCompressor,\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n} from './id-compressor';\nimport { ChangeCompressor, compressEdit, decompressEdit } from './ChangeCompression';\nimport { convertEditIds, convertNodeDataIds } from './IdConversion';\n\n/**\n * Object capable of converting between the current internal representation for 0.1.1 edits and their wire format.\n * @internal\n */\nexport class SharedTreeEncoder_0_1_1 {\n\tprivate readonly treeCompressor = new InterningTreeCompressor<never>();\n\tprivate readonly changeCompressor = new ChangeCompressor(this.treeCompressor);\n\n\tpublic constructor(private readonly summarizeHistory: boolean) {}\n\n\t/**\n\t * Encodes an edit op to be sent.\n\t * @param edit - edit to encode.\n\t * @param fluidSerialize - Callback which serializes Fluid handles contained in a JSON-serializable object, returning the result.\n\t * Should be invoked on the edit contents at some point before op encoding is complete.\n\t * This is because edit contents may have Payloads needing to be serialized.\n\t */\n\tpublic encodeEditOp(\n\t\tedit: Edit<ChangeInternal>,\n\t\tfluidSerialize: (\n\t\t\tedit: Edit<CompressedChangeInternal<OpSpaceNodeId>>\n\t\t) => Edit<CompressedChangeInternal<OpSpaceNodeId>>,\n\t\tidRange: IdCreationRange,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner\n\t): SharedTreeEditOp {\n\t\t// IFluidHandles are not allowed in Ops.\n\t\t// Ops can contain Fluid's Serializable (for payloads) which allows IFluidHandles.\n\t\t// So replace the handles by encoding before sending:\n\t\tconst semiSerialized = fluidSerialize(\n\t\t\tcompressEdit(this.changeCompressor, interner, scopeIdNormalizer(idNormalizer, idRange.sessionId), edit)\n\t\t);\n\n\t\treturn {\n\t\t\ttype: SharedTreeOpType.Edit,\n\t\t\tedit: semiSerialized,\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tidRange,\n\t\t};\n\t}\n\n\t/**\n\t * Decodes an edit op encoded with `encodeEditOp`.\n\t * @param op - op to decode.\n\t * @param fluidDeserialize - Callback which deserializes Fluid handles contained in a JSON-serializable object.\n\t * Should be invoked on the semi-serialized edit contents at some point before decoding is complete.\n\t * This will rehydrate any serialized Fluid handles into usable IFluidHandle objects.\n\t */\n\tpublic decodeEditOp(\n\t\top: SharedTreeEditOp,\n\t\tfluidDeserialize: (\n\t\t\tsemiSerializedEdit: Edit<CompressedChangeInternal<OpSpaceNodeId>>\n\t\t) => Edit<CompressedChangeInternal<OpSpaceNodeId>>,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner\n\t): Edit<ChangeInternal> {\n\t\tconst { edit: semiSerializedEdit } = op;\n\t\tconst parsedEdit = fluidDeserialize(semiSerializedEdit);\n\t\treturn decompressEdit(\n\t\t\tthis.changeCompressor,\n\t\t\tinterner,\n\t\t\tscopeIdNormalizer(idNormalizer, op.idRange.sessionId),\n\t\t\tparsedEdit\n\t\t);\n\t}\n\n\t/**\n\t * Encodes a summary.\n\t */\n\tpublic encodeSummary(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidContext: NodeIdContext,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tif (this.summarizeHistory) {\n\t\t\treturn this.fullHistorySummarizer(edits, currentView, idNormalizer, interner, serializedIdCompressor);\n\t\t} else {\n\t\t\treturn this.noHistorySummarizer(\n\t\t\t\tedits,\n\t\t\t\tcurrentView,\n\t\t\t\tidContext,\n\t\t\t\tidNormalizer,\n\t\t\t\tinterner,\n\t\t\t\tserializedIdCompressor\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary(\n\t\t{\n\t\t\teditHistory,\n\t\t\tcurrentTree: compressedTree,\n\t\t\tinternedStrings,\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t\tversion,\n\t\t}: SharedTreeSummary,\n\t\tattributionId: AttributionId\n\t): SummaryContents {\n\t\tassert(version === WriteFormat.v0_1_1, `Invalid summary version to decode: ${version}, expected: 0.1.1`);\n\t\tassert(typeof editHistory === 'object', '0.1.1 summary encountered with non-object edit history.');\n\n\t\tconst idCompressor = hasOngoingSession(serializedIdCompressor)\n\t\t\t? IdCompressor.deserialize(serializedIdCompressor)\n\t\t\t: IdCompressor.deserialize(serializedIdCompressor, createSessionId(), attributionId);\n\n\t\tconst interner = new MutableStringInterner(internedStrings);\n\t\tconst sequencedNormalizer = sequencedIdNormalizer(getNodeIdContext(idCompressor));\n\t\tconst decompressedTree: ChangeNode | undefined =\n\t\t\tcompressedTree !== undefined\n\t\t\t\t? this.treeCompressor.decompress(compressedTree, interner, sequencedNormalizer)\n\t\t\t\t: undefined;\n\t\tconst { editChunks, editIds } = editHistory;\n\t\tassert(editChunks !== undefined, 'Missing editChunks on 0.1.1 summary.');\n\t\tassert(editIds !== undefined, 'Missing editIds on 0.1.1 summary.');\n\n\t\tconst uncompressedChunks = editChunks.map(({ startRevision, chunk }) => ({\n\t\t\tstartRevision,\n\t\t\tchunk: isEditHandle(chunk)\n\t\t\t\t? {\n\t\t\t\t\t\tget: async () => {\n\t\t\t\t\t\t\tconst baseHandle = chunk;\n\t\t\t\t\t\t\tconst contents: EditChunkContents = JSON.parse(\n\t\t\t\t\t\t\t\tIsoBuffer.from(await baseHandle.get()).toString()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// Note: any interned IDs referenced in chunks taken at the time of summarization must be included\n\t\t\t\t\t\t\t// in the summary. So this interner is sufficient.\n\t\t\t\t\t\t\treturn this.decodeEditChunk(contents, sequencedNormalizer, interner);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbaseHandle: chunk,\n\t\t\t\t }\n\t\t\t\t: chunk.map((edit) => decompressEdit(this.changeCompressor, interner, sequencedNormalizer, edit)),\n\t\t}));\n\t\treturn {\n\t\t\tcurrentTree: decompressedTree,\n\t\t\teditHistory: { editIds, editChunks: uncompressedChunks },\n\t\t\tidCompressor,\n\t\t\tinterner,\n\t\t};\n\t}\n\n\t/**\n\t * Does not preserve (persist) history at all.\n\t * Instead, the history returned in the summary will contain a single edit that creates a revision identical to the supplied view.\n\t * Writes summary format 0.1.1 which does not store the currentView for no history summaries.\n\t */\n\tprivate noHistorySummarizer<TChange>(\n\t\t_edits: EditLog<TChange>,\n\t\tcurrentView: RevisionView,\n\t\tidContext: NodeIdContext,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tconst currentTree = getChangeNodeFromView(currentView);\n\t\tconst initialTreeId = idContext.convertToNodeId(initialTree.identifier);\n\t\tconst changes: ChangeInternal[] = [];\n\t\t// Generate a set of changes to set the root node's children to that of the root in the currentTree\n\t\tObject.entries(currentTree.traits).forEach(([label, children]) => {\n\t\t\tconst id = 0 as DetachedSequenceId;\n\t\t\tchanges.push(\n\t\t\t\tChangeInternal.build(children, id),\n\t\t\t\tChangeInternal.insert(\n\t\t\t\t\tid,\n\t\t\t\t\tStablePlaceInternal.atStartOf({ parent: initialTreeId, label: label as TraitLabel })\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\n\t\tif (currentTree.payload !== undefined) {\n\t\t\tchanges.push(ChangeInternal.setPayload(initialTreeId, currentTree.payload));\n\t\t}\n\n\t\tassert(\n\t\t\tcurrentTree.identifier === initialTreeId && currentTree.definition === initialTree.definition,\n\t\t\t'root definition and identifier should be immutable.'\n\t\t);\n\t\tconst edit = newEdit(changes);\n\t\tconst compressedChanges = edit.changes.map((change) =>\n\t\t\tthis.changeCompressor.compress(change, interner, sequencedIdNormalizer(idNormalizer))\n\t\t);\n\t\treturn {\n\t\t\teditHistory: {\n\t\t\t\teditChunks: [{ startRevision: 0, chunk: [{ changes: compressedChanges }] }],\n\t\t\t\teditIds: [edit.id],\n\t\t\t},\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tinternedStrings: interner.getSerializable(),\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t};\n\t}\n\n\t/**\n\t * Generates a summary with format version 0.1.1. This will prefer handles over edits in edit chunks where possible,\n\t * and string interning and tree compression will be applied.\n\t */\n\tprivate fullHistorySummarizer(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tconst sequencedNormalizer = sequencedIdNormalizer(idNormalizer);\n\t\tconst currentTree = this.treeCompressor.compress(\n\t\t\tgetChangeNodeFromView(currentView),\n\t\t\tinterner,\n\t\t\tsequencedNormalizer\n\t\t);\n\n\t\treturn {\n\t\t\tcurrentTree,\n\t\t\teditHistory: edits.getEditLogSummary((edit) =>\n\t\t\t\tcompressEdit(this.changeCompressor, interner, sequencedNormalizer, edit)\n\t\t\t),\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tinternedStrings: interner.getSerializable(),\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t};\n\t}\n\n\tpublic encodeEditChunk(\n\t\tedits: readonly EditWithoutId<ChangeInternal>[],\n\t\tidNormalizer: ContextualizedNodeIdNormalizer<FinalNodeId>,\n\t\tinterner: StringInterner\n\t): EditChunkContents_0_1_1 {\n\t\tconst compressedEdits = edits.map((edit) => compressEdit(this.changeCompressor, interner, idNormalizer, edit));\n\t\treturn {\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tedits: compressedEdits,\n\t\t};\n\t}\n\n\tpublic decodeEditChunk(\n\t\tcontents: EditChunkContents,\n\t\tidNormalizer: ContextualizedNodeIdNormalizer<FinalNodeId>,\n\t\tinterner: StringInterner\n\t): EditWithoutId<ChangeInternal>[] {\n\t\tassert(\n\t\t\tcontents.version === WriteFormat.v0_1_1,\n\t\t\t`Invalid editChunk to decode: ${contents.version}. Expected 0.1.1.`\n\t\t);\n\t\treturn contents.edits.map((edit) => decompressEdit(this.changeCompressor, interner, idNormalizer, edit));\n\t}\n}\n\n/**\n * Object capable of converting between the current internal representation for 0.0.2 edits and their wire format.\n * @internal\n */\nexport class SharedTreeEncoder_0_0_2 {\n\tpublic constructor(private readonly summarizeHistory: boolean) {}\n\n\t/**\n\t * Encodes an edit op to be sent.\n\t * @param edit - edit to encode.\n\t * @param fluidSerialize - Callback which serializes Fluid handles contained in a JSON-serializable object, returning the result.\n\t * Should be invoked on the edit contents at some point before op encoding is complete.\n\t * This is because edit contents may have Payloads needing to be serialized.\n\t */\n\tpublic encodeEditOp(\n\t\tedit: Edit<ChangeInternal>,\n\t\tfluidSerialize: (edit: Edit<ChangeInternal_0_0_2>) => Edit<ChangeInternal_0_0_2>,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeEditOp_0_0_2 {\n\t\t// IFluidHandles are not allowed in Ops.\n\t\t// Ops can contain Fluid's Serializable (for payloads) which allows IFluidHandles.\n\t\t// So replace the handles by encoding before sending:\n\t\tconst semiSerialized = fluidSerialize(convertEditIds(edit, (id) => idConverter.convertToStableNodeId(id)));\n\n\t\treturn {\n\t\t\ttype: SharedTreeOpType.Edit,\n\t\t\tedit: semiSerialized,\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n\n\t/**\n\t * Decodes an edit op encoded with `encodeEditOp`.\n\t * @param op - op to decode.\n\t * @param fluidDeserialize - Callback which deserializes Fluid handles contained in a JSON-serializable object.\n\t * Should be invoked on the semi-serialized edit contents at some point before decoding is complete.\n\t * This will rehydrate any serialized Fluid handles into usable IFluidHandle objects.\n\t */\n\tpublic decodeEditOp(\n\t\top: SharedTreeEditOp_0_0_2,\n\t\tfluidDeserialize: (semiSerializedEdit: Edit<ChangeInternal_0_0_2>) => Edit<ChangeInternal_0_0_2>,\n\t\tidGenerator: NodeIdGenerator\n\t): Edit<ChangeInternal> {\n\t\tconst { edit: semiSerializedEdit } = op;\n\t\tconst parsedEdit = fluidDeserialize(semiSerializedEdit);\n\t\treturn convertEditIds(parsedEdit, (id) => idGenerator.generateNodeId(id));\n\t}\n\n\t/**\n\t * Encodes a summary.\n\t */\n\tpublic encodeSummary(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tif (this.summarizeHistory) {\n\t\t\treturn this.fullHistorySummarizer(edits, currentView, idConverter);\n\t\t} else {\n\t\t\treturn this.noHistorySummarizer(edits, currentView, idConverter);\n\t\t}\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary(\n\t\t{ currentTree, sequencedEdits }: SharedTreeSummary_0_0_2,\n\t\tattributionId?: AttributionId\n\t): SummaryContents {\n\t\tassert(sequencedEdits !== undefined, '0.0.2 summary encountered with missing sequencedEdits field.');\n\t\tconst idCompressor = new IdCompressor(createSessionId(), reservedIdCount, attributionId);\n\t\tconst idGenerator = getNodeIdContext(idCompressor);\n\t\tconst generateId = (id) => idGenerator.generateNodeId(id);\n\n\t\t// This saves all of the edits in the summary as part of the first chunk.\n\t\tconst temporaryLog = new EditLog<ChangeInternal>();\n\t\tsequencedEdits.forEach((edit) =>\n\t\t\ttemporaryLog.addSequencedEdit(convertEditIds(edit, generateId), {\n\t\t\t\tsequenceNumber: 1,\n\t\t\t\treferenceSequenceNumber: 0,\n\t\t\t})\n\t\t);\n\n\t\treturn {\n\t\t\tcurrentTree: convertTreeNodes<ChangeNode_0_0_2, ChangeNode>(currentTree, (node) =>\n\t\t\t\tconvertNodeDataIds(node, generateId)\n\t\t\t),\n\t\t\tidCompressor,\n\t\t\tinterner: new MutableStringInterner(),\n\t\t\t// This cast is valid because we just constructed this log and gave it only in-session edits.\n\t\t\teditHistory: temporaryLog.getEditLogSummary() as EditLogSummary<ChangeInternal, never>,\n\t\t};\n\t}\n\n\t/**\n\t * Does not preserve (persist) history at all.\n\t * Instead, the history returned in the summary will contain a single edit that creates a revision identical to the supplied view.\n\t * @param stable - Generates the single edit with a stable edit ID. False by default, used for testing.\n\t */\n\tprivate noHistorySummarizer<TChange>(\n\t\t_edits: EditLog<TChange>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tconst currentTree = getChangeNode_0_0_2FromView(currentView, idConverter);\n\t\tconst changes: ChangeInternal_0_0_2[] = [];\n\t\t// Generate a set of changes to set the root node's children to that of the root in the currentTree\n\t\tObject.entries(currentTree.traits).forEach(([label, children]) => {\n\t\t\tconst id = 0 as DetachedSequenceId;\n\t\t\tchanges.push(\n\t\t\t\t{ type: ChangeTypeInternal.Build, source: children, destination: id },\n\t\t\t\t{\n\t\t\t\t\ttype: ChangeTypeInternal.Insert,\n\t\t\t\t\tsource: id,\n\t\t\t\t\tdestination: {\n\t\t\t\t\t\tside: Side.After,\n\t\t\t\t\t\treferenceTrait: { label: label as TraitLabel, parent: initialTree.identifier },\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tif (currentTree.payload !== undefined) {\n\t\t\tchanges.push({\n\t\t\t\ttype: ChangeTypeInternal.SetValue,\n\t\t\t\tnodeToModify: initialTree.identifier,\n\t\t\t\tpayload: currentTree.payload,\n\t\t\t});\n\t\t}\n\n\t\tassert(\n\t\t\tcurrentTree.identifier === initialTree.identifier && currentTree.definition === initialTree.definition,\n\t\t\t'root definition and identifier should be immutable.'\n\t\t);\n\t\tconst edit = newEdit(changes);\n\n\t\treturn {\n\t\t\tcurrentTree,\n\t\t\tsequencedEdits: [\n\t\t\t\t{\n\t\t\t\t\tid: edit.id,\n\t\t\t\t\tchanges: edit.changes,\n\t\t\t\t},\n\t\t\t],\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n\t/**\n\t * Preserves the full history in the generated summary.\n\t */\n\tprivate fullHistorySummarizer(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tconst { editChunks, editIds } = edits.getEditLogSummary();\n\n\t\tconst sequencedEdits: Edit<ChangeInternal_0_0_2>[] = [];\n\t\tlet idIndex = 0;\n\t\teditChunks.forEach(({ chunk }) => {\n\t\t\tif (isEditHandle(chunk)) {\n\t\t\t\tfail('Cannot write handles to summary version 0.0.2');\n\t\t\t} else {\n\t\t\t\tchunk.forEach(({ changes }) => {\n\t\t\t\t\tsequencedEdits.push(\n\t\t\t\t\t\tconvertEditIds(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchanges,\n\t\t\t\t\t\t\t\tid: editIds[idIndex++] ?? fail('Number of edits should match number of edit IDs.'),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(id) => idConverter.convertToStableNodeId(id)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tcurrentTree: getChangeNode_0_0_2FromView(currentView, idConverter),\n\t\t\tsequencedEdits,\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n}\n\nfunction isEditHandle(chunk: FluidEditHandle | readonly EditWithoutId<unknown>[]): chunk is FluidEditHandle {\n\treturn !Array.isArray(chunk);\n}\n"]}
1
+ {"version":3,"file":"SharedTreeEncoder.js","sourceRoot":"","sources":["../src/SharedTreeEncoder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA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AC,CAAC,CAAC;aACH;QACF,CAAC,CAAC,CAAC;QAEH,OAAO;YACN,WAAW,EAAE,2BAA2B,CAAC,WAAW,EAAE,WAAW,CAAC;YAClE,cAAc;YACd,OAAO,EAAE,WAAW,CAAC,MAAM;SAC3B,CAAC;IACH,CAAC;CACD;AAED,SAAS,YAAY,CAAC,KAA0D;IAC/E,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from '@fluidframework/common-utils';\nimport { assert, fail } from './Common';\nimport { EditLog } from './EditLog';\nimport { convertTreeNodes, newEdit } from './EditUtilities';\nimport { AttributionId, DetachedSequenceId, FinalNodeId, OpSpaceNodeId, TraitLabel } from './Identifiers';\nimport { initialTree } from './InitialTree';\nimport {\n\tContextualizedNodeIdNormalizer,\n\tgetNodeIdContext,\n\tNodeIdContext,\n\tNodeIdConverter,\n\tNodeIdGenerator,\n\tNodeIdNormalizer,\n\tscopeIdNormalizer,\n\tsequencedIdNormalizer,\n} from './NodeIdUtilities';\nimport { getChangeNodeFromView, getChangeNode_0_0_2FromView } from './SerializationUtilities';\nimport {\n\tCompressedChangeInternal,\n\tChangeInternal,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n\tChangeNode,\n\tEdit,\n\tSharedTreeEditOp,\n\tSharedTreeOpType,\n\tSharedTreeSummary,\n\tEditWithoutId,\n\tChangeTypeInternal,\n\tChangeInternal_0_0_2,\n\tSharedTreeEditOp_0_0_2,\n\treservedIdCount,\n\tChangeNode_0_0_2,\n\tEditChunkContents,\n\tEditLogSummary,\n\tEditChunkContents_0_1_1,\n\tFluidEditHandle,\n\tStablePlaceInternal,\n\tSide,\n} from './persisted-types';\nimport { RevisionView } from './RevisionView';\nimport { MutableStringInterner, StringInterner } from './StringInterner';\nimport { SummaryContents } from './Summary';\nimport { InterningTreeCompressor } from './TreeCompressor';\nimport {\n\tcreateSessionId,\n\thasOngoingSession,\n\tIdCompressor,\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n} from './id-compressor';\nimport { ChangeCompressor, compressEdit, decompressEdit } from './ChangeCompression';\nimport { convertEditIds, convertNodeDataIds } from './IdConversion';\n\n/**\n * Object capable of converting between the current internal representation for 0.1.1 edits and their wire format.\n * @internal\n */\nexport class SharedTreeEncoder_0_1_1 {\n\tprivate readonly treeCompressor = new InterningTreeCompressor<never>();\n\tprivate readonly changeCompressor = new ChangeCompressor(this.treeCompressor);\n\n\tpublic constructor(private readonly summarizeHistory: boolean) {}\n\n\t/**\n\t * Encodes an edit op to be sent.\n\t * @param edit - edit to encode.\n\t * @param fluidSerialize - Callback which serializes Fluid handles contained in a JSON-serializable object, returning the result.\n\t * Should be invoked on the edit contents at some point before op encoding is complete.\n\t * This is because edit contents may have Payloads needing to be serialized.\n\t */\n\tpublic encodeEditOp(\n\t\tedit: Edit<ChangeInternal>,\n\t\tfluidSerialize: (\n\t\t\tedit: Edit<CompressedChangeInternal<OpSpaceNodeId>>\n\t\t) => Edit<CompressedChangeInternal<OpSpaceNodeId>>,\n\t\tidRange: IdCreationRange,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner\n\t): SharedTreeEditOp {\n\t\t// IFluidHandles are not allowed in Ops.\n\t\t// Ops can contain Fluid's Serializable (for payloads) which allows IFluidHandles.\n\t\t// So replace the handles by encoding before sending:\n\t\tconst semiSerialized = fluidSerialize(\n\t\t\tcompressEdit(this.changeCompressor, interner, scopeIdNormalizer(idNormalizer, idRange.sessionId), edit)\n\t\t);\n\n\t\treturn {\n\t\t\ttype: SharedTreeOpType.Edit,\n\t\t\tedit: semiSerialized,\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tidRange,\n\t\t};\n\t}\n\n\t/**\n\t * Decodes an edit op encoded with `encodeEditOp`.\n\t * @param op - op to decode.\n\t * @param fluidDeserialize - Callback which deserializes Fluid handles contained in a JSON-serializable object.\n\t * Should be invoked on the semi-serialized edit contents at some point before decoding is complete.\n\t * This will rehydrate any serialized Fluid handles into usable IFluidHandle objects.\n\t */\n\tpublic decodeEditOp(\n\t\top: SharedTreeEditOp,\n\t\tfluidDeserialize: (\n\t\t\tsemiSerializedEdit: Edit<CompressedChangeInternal<OpSpaceNodeId>>\n\t\t) => Edit<CompressedChangeInternal<OpSpaceNodeId>>,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner\n\t): Edit<ChangeInternal> {\n\t\tconst { edit: semiSerializedEdit } = op;\n\t\tconst parsedEdit = fluidDeserialize(semiSerializedEdit);\n\t\treturn decompressEdit(\n\t\t\tthis.changeCompressor,\n\t\t\tinterner,\n\t\t\tscopeIdNormalizer(idNormalizer, op.idRange.sessionId),\n\t\t\tparsedEdit\n\t\t);\n\t}\n\n\t/**\n\t * Encodes a summary.\n\t */\n\tpublic encodeSummary(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidContext: NodeIdContext,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tif (this.summarizeHistory) {\n\t\t\treturn this.fullHistorySummarizer(edits, currentView, idNormalizer, interner, serializedIdCompressor);\n\t\t} else {\n\t\t\treturn this.noHistorySummarizer(\n\t\t\t\tedits,\n\t\t\t\tcurrentView,\n\t\t\t\tidContext,\n\t\t\t\tidNormalizer,\n\t\t\t\tinterner,\n\t\t\t\tserializedIdCompressor\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary(\n\t\t{\n\t\t\teditHistory,\n\t\t\tcurrentTree: compressedTree,\n\t\t\tinternedStrings,\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t\tversion,\n\t\t}: SharedTreeSummary,\n\t\tattributionId?: AttributionId\n\t): SummaryContents {\n\t\tassert(version === WriteFormat.v0_1_1, `Invalid summary version to decode: ${version}, expected: 0.1.1`);\n\t\tassert(typeof editHistory === 'object', '0.1.1 summary encountered with non-object edit history.');\n\n\t\tconst idCompressor = hasOngoingSession(serializedIdCompressor)\n\t\t\t? IdCompressor.deserialize(serializedIdCompressor)\n\t\t\t: IdCompressor.deserialize(serializedIdCompressor, createSessionId(), attributionId);\n\n\t\tconst interner = new MutableStringInterner(internedStrings);\n\t\tconst sequencedNormalizer = sequencedIdNormalizer(getNodeIdContext(idCompressor));\n\t\tconst decompressedTree: ChangeNode | undefined =\n\t\t\tcompressedTree !== undefined\n\t\t\t\t? this.treeCompressor.decompress(compressedTree, interner, sequencedNormalizer)\n\t\t\t\t: undefined;\n\t\tconst { editChunks, editIds } = editHistory;\n\t\tassert(editChunks !== undefined, 'Missing editChunks on 0.1.1 summary.');\n\t\tassert(editIds !== undefined, 'Missing editIds on 0.1.1 summary.');\n\n\t\tconst uncompressedChunks = editChunks.map(({ startRevision, chunk }) => ({\n\t\t\tstartRevision,\n\t\t\tchunk: isEditHandle(chunk)\n\t\t\t\t? {\n\t\t\t\t\t\tget: async () => {\n\t\t\t\t\t\t\tconst baseHandle = chunk;\n\t\t\t\t\t\t\tconst contents: EditChunkContents = JSON.parse(\n\t\t\t\t\t\t\t\tIsoBuffer.from(await baseHandle.get()).toString()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// Note: any interned IDs referenced in chunks taken at the time of summarization must be included\n\t\t\t\t\t\t\t// in the summary. So this interner is sufficient.\n\t\t\t\t\t\t\treturn this.decodeEditChunk(contents, sequencedNormalizer, interner);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbaseHandle: chunk,\n\t\t\t\t }\n\t\t\t\t: chunk.map((edit) => decompressEdit(this.changeCompressor, interner, sequencedNormalizer, edit)),\n\t\t}));\n\t\treturn {\n\t\t\tcurrentTree: decompressedTree,\n\t\t\teditHistory: { editIds, editChunks: uncompressedChunks },\n\t\t\tidCompressor,\n\t\t\tinterner,\n\t\t};\n\t}\n\n\t/**\n\t * Does not preserve (persist) history at all.\n\t * Instead, the history returned in the summary will contain a single edit that creates a revision identical to the supplied view.\n\t * Writes summary format 0.1.1 which does not store the currentView for no history summaries.\n\t */\n\tprivate noHistorySummarizer<TChange>(\n\t\t_edits: EditLog<TChange>,\n\t\tcurrentView: RevisionView,\n\t\tidContext: NodeIdContext,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tconst currentTree = getChangeNodeFromView(currentView);\n\t\tconst initialTreeId = idContext.convertToNodeId(initialTree.identifier);\n\t\tconst changes: ChangeInternal[] = [];\n\t\t// Generate a set of changes to set the root node's children to that of the root in the currentTree\n\t\tObject.entries(currentTree.traits).forEach(([label, children]) => {\n\t\t\tconst id = 0 as DetachedSequenceId;\n\t\t\tchanges.push(\n\t\t\t\tChangeInternal.build(children, id),\n\t\t\t\tChangeInternal.insert(\n\t\t\t\t\tid,\n\t\t\t\t\tStablePlaceInternal.atStartOf({ parent: initialTreeId, label: label as TraitLabel })\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\n\t\tif (currentTree.payload !== undefined) {\n\t\t\tchanges.push(ChangeInternal.setPayload(initialTreeId, currentTree.payload));\n\t\t}\n\n\t\tassert(\n\t\t\tcurrentTree.identifier === initialTreeId && currentTree.definition === initialTree.definition,\n\t\t\t'root definition and identifier should be immutable.'\n\t\t);\n\t\tconst edit = newEdit(changes);\n\t\tconst compressedChanges = edit.changes.map((change) =>\n\t\t\tthis.changeCompressor.compress(change, interner, sequencedIdNormalizer(idNormalizer))\n\t\t);\n\t\treturn {\n\t\t\teditHistory: {\n\t\t\t\teditChunks: [{ startRevision: 0, chunk: [{ changes: compressedChanges }] }],\n\t\t\t\teditIds: [edit.id],\n\t\t\t},\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tinternedStrings: interner.getSerializable(),\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t};\n\t}\n\n\t/**\n\t * Generates a summary with format version 0.1.1. This will prefer handles over edits in edit chunks where possible,\n\t * and string interning and tree compression will be applied.\n\t */\n\tprivate fullHistorySummarizer(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tconst sequencedNormalizer = sequencedIdNormalizer(idNormalizer);\n\t\tconst currentTree = this.treeCompressor.compress(\n\t\t\tgetChangeNodeFromView(currentView),\n\t\t\tinterner,\n\t\t\tsequencedNormalizer\n\t\t);\n\n\t\treturn {\n\t\t\tcurrentTree,\n\t\t\teditHistory: edits.getEditLogSummary((edit) =>\n\t\t\t\tcompressEdit(this.changeCompressor, interner, sequencedNormalizer, edit)\n\t\t\t),\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tinternedStrings: interner.getSerializable(),\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t};\n\t}\n\n\tpublic encodeEditChunk(\n\t\tedits: readonly EditWithoutId<ChangeInternal>[],\n\t\tidNormalizer: ContextualizedNodeIdNormalizer<FinalNodeId>,\n\t\tinterner: StringInterner\n\t): EditChunkContents_0_1_1 {\n\t\tconst compressedEdits = edits.map((edit) => compressEdit(this.changeCompressor, interner, idNormalizer, edit));\n\t\treturn {\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tedits: compressedEdits,\n\t\t};\n\t}\n\n\tpublic decodeEditChunk(\n\t\tcontents: EditChunkContents,\n\t\tidNormalizer: ContextualizedNodeIdNormalizer<FinalNodeId>,\n\t\tinterner: StringInterner\n\t): EditWithoutId<ChangeInternal>[] {\n\t\tassert(\n\t\t\tcontents.version === WriteFormat.v0_1_1,\n\t\t\t`Invalid editChunk to decode: ${contents.version}. Expected 0.1.1.`\n\t\t);\n\t\treturn contents.edits.map((edit) => decompressEdit(this.changeCompressor, interner, idNormalizer, edit));\n\t}\n}\n\n/**\n * Object capable of converting between the current internal representation for 0.0.2 edits and their wire format.\n * @internal\n */\nexport class SharedTreeEncoder_0_0_2 {\n\tpublic constructor(private readonly summarizeHistory: boolean) {}\n\n\t/**\n\t * Encodes an edit op to be sent.\n\t * @param edit - edit to encode.\n\t * @param fluidSerialize - Callback which serializes Fluid handles contained in a JSON-serializable object, returning the result.\n\t * Should be invoked on the edit contents at some point before op encoding is complete.\n\t * This is because edit contents may have Payloads needing to be serialized.\n\t */\n\tpublic encodeEditOp(\n\t\tedit: Edit<ChangeInternal>,\n\t\tfluidSerialize: (edit: Edit<ChangeInternal_0_0_2>) => Edit<ChangeInternal_0_0_2>,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeEditOp_0_0_2 {\n\t\t// IFluidHandles are not allowed in Ops.\n\t\t// Ops can contain Fluid's Serializable (for payloads) which allows IFluidHandles.\n\t\t// So replace the handles by encoding before sending:\n\t\tconst semiSerialized = fluidSerialize(convertEditIds(edit, (id) => idConverter.convertToStableNodeId(id)));\n\n\t\treturn {\n\t\t\ttype: SharedTreeOpType.Edit,\n\t\t\tedit: semiSerialized,\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n\n\t/**\n\t * Decodes an edit op encoded with `encodeEditOp`.\n\t * @param op - op to decode.\n\t * @param fluidDeserialize - Callback which deserializes Fluid handles contained in a JSON-serializable object.\n\t * Should be invoked on the semi-serialized edit contents at some point before decoding is complete.\n\t * This will rehydrate any serialized Fluid handles into usable IFluidHandle objects.\n\t */\n\tpublic decodeEditOp(\n\t\top: SharedTreeEditOp_0_0_2,\n\t\tfluidDeserialize: (semiSerializedEdit: Edit<ChangeInternal_0_0_2>) => Edit<ChangeInternal_0_0_2>,\n\t\tidGenerator: NodeIdGenerator\n\t): Edit<ChangeInternal> {\n\t\tconst { edit: semiSerializedEdit } = op;\n\t\tconst parsedEdit = fluidDeserialize(semiSerializedEdit);\n\t\treturn convertEditIds(parsedEdit, (id) => idGenerator.generateNodeId(id));\n\t}\n\n\t/**\n\t * Encodes a summary.\n\t */\n\tpublic encodeSummary(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tif (this.summarizeHistory) {\n\t\t\treturn this.fullHistorySummarizer(edits, currentView, idConverter);\n\t\t} else {\n\t\t\treturn this.noHistorySummarizer(edits, currentView, idConverter);\n\t\t}\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary(\n\t\t{ currentTree, sequencedEdits }: SharedTreeSummary_0_0_2,\n\t\tattributionId?: AttributionId\n\t): SummaryContents {\n\t\tassert(sequencedEdits !== undefined, '0.0.2 summary encountered with missing sequencedEdits field.');\n\t\tconst idCompressor = new IdCompressor(createSessionId(), reservedIdCount, attributionId);\n\t\tconst idGenerator = getNodeIdContext(idCompressor);\n\t\tconst generateId = (id) => idGenerator.generateNodeId(id);\n\n\t\t// This saves all of the edits in the summary as part of the first chunk.\n\t\tconst temporaryLog = new EditLog<ChangeInternal>();\n\t\tsequencedEdits.forEach((edit) =>\n\t\t\ttemporaryLog.addSequencedEdit(convertEditIds(edit, generateId), {\n\t\t\t\tsequenceNumber: 1,\n\t\t\t\treferenceSequenceNumber: 0,\n\t\t\t})\n\t\t);\n\n\t\treturn {\n\t\t\tcurrentTree: convertTreeNodes<ChangeNode_0_0_2, ChangeNode>(currentTree, (node) =>\n\t\t\t\tconvertNodeDataIds(node, generateId)\n\t\t\t),\n\t\t\tidCompressor,\n\t\t\tinterner: new MutableStringInterner(),\n\t\t\t// This cast is valid because we just constructed this log and gave it only in-session edits.\n\t\t\teditHistory: temporaryLog.getEditLogSummary() as EditLogSummary<ChangeInternal, never>,\n\t\t};\n\t}\n\n\t/**\n\t * Does not preserve (persist) history at all.\n\t * Instead, the history returned in the summary will contain a single edit that creates a revision identical to the supplied view.\n\t * @param stable - Generates the single edit with a stable edit ID. False by default, used for testing.\n\t */\n\tprivate noHistorySummarizer<TChange>(\n\t\t_edits: EditLog<TChange>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tconst currentTree = getChangeNode_0_0_2FromView(currentView, idConverter);\n\t\tconst changes: ChangeInternal_0_0_2[] = [];\n\t\t// Generate a set of changes to set the root node's children to that of the root in the currentTree\n\t\tObject.entries(currentTree.traits).forEach(([label, children]) => {\n\t\t\tconst id = 0 as DetachedSequenceId;\n\t\t\tchanges.push(\n\t\t\t\t{ type: ChangeTypeInternal.Build, source: children, destination: id },\n\t\t\t\t{\n\t\t\t\t\ttype: ChangeTypeInternal.Insert,\n\t\t\t\t\tsource: id,\n\t\t\t\t\tdestination: {\n\t\t\t\t\t\tside: Side.After,\n\t\t\t\t\t\treferenceTrait: { label: label as TraitLabel, parent: initialTree.identifier },\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tif (currentTree.payload !== undefined) {\n\t\t\tchanges.push({\n\t\t\t\ttype: ChangeTypeInternal.SetValue,\n\t\t\t\tnodeToModify: initialTree.identifier,\n\t\t\t\tpayload: currentTree.payload,\n\t\t\t});\n\t\t}\n\n\t\tassert(\n\t\t\tcurrentTree.identifier === initialTree.identifier && currentTree.definition === initialTree.definition,\n\t\t\t'root definition and identifier should be immutable.'\n\t\t);\n\t\tconst edit = newEdit(changes);\n\n\t\treturn {\n\t\t\tcurrentTree,\n\t\t\tsequencedEdits: [\n\t\t\t\t{\n\t\t\t\t\tid: edit.id,\n\t\t\t\t\tchanges: edit.changes,\n\t\t\t\t},\n\t\t\t],\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n\t/**\n\t * Preserves the full history in the generated summary.\n\t */\n\tprivate fullHistorySummarizer(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tconst { editChunks, editIds } = edits.getEditLogSummary();\n\n\t\tconst sequencedEdits: Edit<ChangeInternal_0_0_2>[] = [];\n\t\tlet idIndex = 0;\n\t\teditChunks.forEach(({ chunk }) => {\n\t\t\tif (isEditHandle(chunk)) {\n\t\t\t\tfail('Cannot write handles to summary version 0.0.2');\n\t\t\t} else {\n\t\t\t\tchunk.forEach(({ changes }) => {\n\t\t\t\t\tsequencedEdits.push(\n\t\t\t\t\t\tconvertEditIds(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchanges,\n\t\t\t\t\t\t\t\tid: editIds[idIndex++] ?? fail('Number of edits should match number of edit IDs.'),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(id) => idConverter.convertToStableNodeId(id)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tcurrentTree: getChangeNode_0_0_2FromView(currentView, idConverter),\n\t\t\tsequencedEdits,\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n}\n\nfunction isEditHandle(chunk: FluidEditHandle | readonly EditWithoutId<unknown>[]): chunk is FluidEditHandle {\n\treturn !Array.isArray(chunk);\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -28,7 +28,7 @@ export * from './MergeHealth';
28
28
  export * from './TreeViewUtilities';
29
29
  export { StringInterner } from './StringInterner';
30
30
  export { Side, EditStatus, TreeNode, TreeNodeSequence, Payload, ConstraintEffect, Edit, ChangeInternal, InternalizedChange, ChangeNode, ChangeNode_0_0_2, EditLogSummary, FluidEditHandle, SharedTreeSummaryBase, EditWithoutId, PlaceholderTree, EditBase, HasTraits, InsertInternal, DetachInternal, BuildInternal, SetValueInternal, ConstraintInternal, BuildNodeInternal, StablePlaceInternal_0_0_2, StableRangeInternal_0_0_2, NodeData, TraitMap, ChangeTypeInternal, TraitLocationInternal_0_0_2, WriteFormat, ConstraintInternal_0_0_2, StablePlaceInternal, StableRangeInternal, BuildNodeInternal_0_0_2, BuildInternal_0_0_2, InsertInternal_0_0_2, DetachInternal_0_0_2, SetValueInternal_0_0_2, TraitLocationInternal, } from './persisted-types';
31
- export { SharedTreeArgs, SharedTreeOptions, SharedTreeOptions_0_0_2, SharedTreeOptions_0_1_1, SharedTreeFactory, SharedTree, EditCommittedHandler, SequencedEditAppliedHandler, EditCommittedEventArguments, SequencedEditAppliedEventArguments, EditApplicationOutcome, ISharedTreeEvents, } from './SharedTree';
31
+ export { SharedTreeFactory, SharedTree, EditCommittedHandler, SequencedEditAppliedHandler, EditCommittedEventArguments, SequencedEditAppliedEventArguments, EditApplicationOutcome, ISharedTreeEvents, } from './SharedTree';
32
32
  export * from './EventTypes';
33
33
  export { setTrait, areRevisionViewsSemanticallyEqual, BadPlaceValidationResult, BadRangeValidationResult, PlaceValidationResult, RangeValidationResult, RangeValidationResultKind, } from './EditUtilities';
34
34
  export { comparePayloads } from './PayloadUtilities';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnF,YAAY,EACX,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,YAAY,EACZ,wBAAwB,E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ACpB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAqB,MAAM,eAAe,CAAC;AAEjF;;GAEG;AACH,OAAO;AACN,wEAAwE;AACxE,sCAAsC,IAAI,4BAA4B,EACtE,sCAAsC,GACtC,MAAM,wBAAwB,CAAC;AAEhC,cAAc,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Fluid DDS storing a tree.\n *\n * @packageDocumentation\n */\n\n/**\n * This file represents the public API. Consumers of this package will not see exported modules unless they are enumerated here.\n * Removing / editing existing exports here will often indicate a breaking change, so please be cognizant of changes made here.\n */\n\n// API Exports\n\nexport { initialTree } from './InitialTree';\nexport { TreeNodeHandle } from './TreeNodeHandle';\nexport { Delta, Forest, ForestNode, ParentData } from './Forest';\nexport { sharedTreeAssertionErrorType, isSharedTreeEvent, Result } from './Common';\nexport type {\n\tCompressedId,\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tInternedStringId,\n\tFinalCompressedId,\n\tLocalCompressedId,\n\tNodeId,\n\tNodeIdBrand,\n\tStableNodeId,\n\tSessionSpaceCompressedId,\n\tSessionUnique,\n\tTraitLabel,\n\tUuidString,\n\tAttributionId,\n} from './Identifiers';\nexport { isDetachedSequenceId } from './Identifiers';\nexport type { OrderedEditSet, EditHandle } from './EditLog';\nexport { LogViewer } from './LogViewer';\nexport { Revision } from './RevisionValueCache';\nexport { Checkout, CheckoutEvent, ICheckoutEvents, EditValidationResult } from './Checkout';\nexport { LazyCheckout } from './LazyCheckout';\nexport { EagerCheckout } from './EagerCheckout';\nexport * from './ReconciliationPath';\nexport * from './MergeHealth';\nexport * from './TreeViewUtilities';\nexport { StringInterner } from './StringInterner';\nexport {\n\tSide,\n\tEditStatus,\n\tTreeNode,\n\tTreeNodeSequence,\n\tPayload,\n\tConstraintEffect,\n\tEdit,\n\tChangeInternal,\n\tInternalizedChange,\n\tChangeNode,\n\tChangeNode_0_0_2,\n\tEditLogSummary,\n\tFluidEditHandle,\n\tSharedTreeSummaryBase,\n\tEditWithoutId,\n\tPlaceholderTree,\n\tEditBase,\n\tHasTraits,\n\tInsertInternal,\n\tDetachInternal,\n\tBuildInternal,\n\tSetValueInternal,\n\tConstraintInternal,\n\tBuildNodeInternal,\n\tStablePlaceInternal_0_0_2,\n\tStableRangeInternal_0_0_2,\n\tNodeData,\n\tTraitMap,\n\tChangeTypeInternal,\n\tTraitLocationInternal_0_0_2,\n\tWriteFormat,\n\tConstraintInternal_0_0_2,\n\tStablePlaceInternal,\n\tStableRangeInternal,\n\tBuildNodeInternal_0_0_2,\n\tBuildInternal_0_0_2,\n\tInsertInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tSetValueInternal_0_0_2,\n\tTraitLocationInternal,\n} from './persisted-types';\nexport {\n\tSharedTreeArgs,\n\tSharedTreeOptions,\n\tSharedTreeOptions_0_0_2,\n\tSharedTreeOptions_0_1_1,\n\tSharedTreeFactory,\n\tSharedTree,\n\tEditCommittedHandler,\n\tSequencedEditAppliedHandler,\n\tEditCommittedEventArguments,\n\tSequencedEditAppliedEventArguments,\n\tEditApplicationOutcome,\n\tISharedTreeEvents,\n} from './SharedTree';\nexport * from './EventTypes';\nexport {\n\tsetTrait,\n\tareRevisionViewsSemanticallyEqual,\n\tBadPlaceValidationResult,\n\tBadRangeValidationResult,\n\tPlaceValidationResult,\n\tRangeValidationResult,\n\tRangeValidationResultKind,\n} from './EditUtilities';\nexport { comparePayloads } from './PayloadUtilities';\nexport {\n\tTransactionInternal,\n\tGenericTransaction,\n\tGenericTransactionPolicy,\n\tEditingResult,\n\tEditingResultBase,\n\tFailedEditingResult,\n\tValidEditingResult,\n\tTransactionState,\n\tTransactionFailure,\n\tSucceedingTransactionState,\n\tFailingTransactionState,\n\tChangeResult,\n} from './TransactionInternal';\nexport {\n\tNodeInTrait,\n\tPlaceIndex,\n\tTreeViewNode,\n\tTreeView,\n\tTraitNodeIndex,\n\tTreeViewPlace,\n\tTreeViewRange,\n\tTraitLocation,\n} from './TreeView';\nexport { RevisionView, TransactionView } from './RevisionView';\nexport { NodeIdContext, NodeIdGenerator, NodeIdConverter } from './NodeIdUtilities';\nexport { Transaction, TransactionEvent, TransactionEvents } from './Transaction';\n\n/**\n * TODO:#61413: Publish test utilities from a separate test package\n */\nexport {\n\t/** @deprecated Use `getSerializedUploadedEditChunkContents` instead. */\n\tgetSerializedUploadedEditChunkContents as getUploadedEditChunkContents,\n\tgetSerializedUploadedEditChunkContents,\n} from './SummaryTestUtilities';\n\nexport * from './ChangeTypes';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH,cAAc;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAS,MAAM,EAA0B,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAkBnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAmB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACN,IAAI,EACJ,UAAU,EAIV,gBAAgB,EAEhB,cAAc,EAqBd,kBAAkB,EAElB,WAAW,EAEX,mBAAmB,EACnB,mBAAmB,GAOnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,iBAAiB,EACjB,UAAU,GAOV,MAAM,cAAc,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,OAAO,EACN,QAAQ,EACR,iCAAiC,EAGjC,qBAAqB,EAErB,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACN,mBAAmB,EACnB,kBAAkB,GAWlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIN,QAAQ,GAKR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAqB,MAAM,eAAe,CAAC;AAEjF;;GAEG;AACH,OAAO;AACN,wEAAwE;AACxE,sCAAsC,IAAI,4BAA4B,EACtE,sCAAsC,GACtC,MAAM,wBAAwB,CAAC;AAEhC,cAAc,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Fluid DDS storing a tree.\n *\n * @packageDocumentation\n */\n\n/**\n * This file represents the public API. Consumers of this package will not see exported modules unless they are enumerated here.\n * Removing / editing existing exports here will often indicate a breaking change, so please be cognizant of changes made here.\n */\n\n// API Exports\n\nexport { initialTree } from './InitialTree';\nexport { TreeNodeHandle } from './TreeNodeHandle';\nexport { Delta, Forest, ForestNode, ParentData } from './Forest';\nexport { sharedTreeAssertionErrorType, isSharedTreeEvent, Result } from './Common';\nexport type {\n\tCompressedId,\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tInternedStringId,\n\tFinalCompressedId,\n\tLocalCompressedId,\n\tNodeId,\n\tNodeIdBrand,\n\tStableNodeId,\n\tSessionSpaceCompressedId,\n\tSessionUnique,\n\tTraitLabel,\n\tUuidString,\n\tAttributionId,\n} from './Identifiers';\nexport { isDetachedSequenceId } from './Identifiers';\nexport type { OrderedEditSet, EditHandle } from './EditLog';\nexport { LogViewer } from './LogViewer';\nexport { Revision } from './RevisionValueCache';\nexport { Checkout, CheckoutEvent, ICheckoutEvents, EditValidationResult } from './Checkout';\nexport { LazyCheckout } from './LazyCheckout';\nexport { EagerCheckout } from './EagerCheckout';\nexport * from './ReconciliationPath';\nexport * from './MergeHealth';\nexport * from './TreeViewUtilities';\nexport { StringInterner } from './StringInterner';\nexport {\n\tSide,\n\tEditStatus,\n\tTreeNode,\n\tTreeNodeSequence,\n\tPayload,\n\tConstraintEffect,\n\tEdit,\n\tChangeInternal,\n\tInternalizedChange,\n\tChangeNode,\n\tChangeNode_0_0_2,\n\tEditLogSummary,\n\tFluidEditHandle,\n\tSharedTreeSummaryBase,\n\tEditWithoutId,\n\tPlaceholderTree,\n\tEditBase,\n\tHasTraits,\n\tInsertInternal,\n\tDetachInternal,\n\tBuildInternal,\n\tSetValueInternal,\n\tConstraintInternal,\n\tBuildNodeInternal,\n\tStablePlaceInternal_0_0_2,\n\tStableRangeInternal_0_0_2,\n\tNodeData,\n\tTraitMap,\n\tChangeTypeInternal,\n\tTraitLocationInternal_0_0_2,\n\tWriteFormat,\n\tConstraintInternal_0_0_2,\n\tStablePlaceInternal,\n\tStableRangeInternal,\n\tBuildNodeInternal_0_0_2,\n\tBuildInternal_0_0_2,\n\tInsertInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tSetValueInternal_0_0_2,\n\tTraitLocationInternal,\n} from './persisted-types';\nexport {\n\tSharedTreeFactory,\n\tSharedTree,\n\tEditCommittedHandler,\n\tSequencedEditAppliedHandler,\n\tEditCommittedEventArguments,\n\tSequencedEditAppliedEventArguments,\n\tEditApplicationOutcome,\n\tISharedTreeEvents,\n} from './SharedTree';\nexport * from './EventTypes';\nexport {\n\tsetTrait,\n\tareRevisionViewsSemanticallyEqual,\n\tBadPlaceValidationResult,\n\tBadRangeValidationResult,\n\tPlaceValidationResult,\n\tRangeValidationResult,\n\tRangeValidationResultKind,\n} from './EditUtilities';\nexport { comparePayloads } from './PayloadUtilities';\nexport {\n\tTransactionInternal,\n\tGenericTransaction,\n\tGenericTransactionPolicy,\n\tEditingResult,\n\tEditingResultBase,\n\tFailedEditingResult,\n\tValidEditingResult,\n\tTransactionState,\n\tTransactionFailure,\n\tSucceedingTransactionState,\n\tFailingTransactionState,\n\tChangeResult,\n} from './TransactionInternal';\nexport {\n\tNodeInTrait,\n\tPlaceIndex,\n\tTreeViewNode,\n\tTreeView,\n\tTraitNodeIndex,\n\tTreeViewPlace,\n\tTreeViewRange,\n\tTraitLocation,\n} from './TreeView';\nexport { RevisionView, TransactionView } from './RevisionView';\nexport { NodeIdContext, NodeIdGenerator, NodeIdConverter } from './NodeIdUtilities';\nexport { Transaction, TransactionEvent, TransactionEvents } from './Transaction';\n\n/**\n * TODO:#61413: Publish test utilities from a separate test package\n */\nexport {\n\t/** @deprecated Use `getSerializedUploadedEditChunkContents` instead. */\n\tgetSerializedUploadedEditChunkContents as getUploadedEditChunkContents,\n\tgetSerializedUploadedEditChunkContents,\n} from './SummaryTestUtilities';\n\nexport * from './ChangeTypes';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SharedTreeFuzzTests.d.ts","sourceRoot":"","sources":["../../../src/test/fuzz/SharedTreeFuzzTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,cAAc,EAKd,MAAM,uCAAuC,CAAC;AAK/C,OAAO,EAAE,aAAa,EAAwB,SAAS,EAAE,MAAM,SAAS,CAAC;AASzE;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACvC,SAAS,EAAE,cAAc,CAAC,SAAS,EAAE,aAAa,CAAC,EACnD,IAAI,EAAE,MAAM,EACZ,gBAAgB,GAAE,OAAc,EAChC,QAAQ,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CA8GlC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAkI1D"}
1
+ {"version":3,"file":"SharedTreeFuzzTests.d.ts","sourceRoot":"","sources":["../../../src/test/fuzz/SharedTreeFuzzTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,cAAc,EAKd,MAAM,uCAAuC,CAAC;AAK/C,OAAO,EAAE,aAAa,EAAwB,SAAS,EAAE,MAAM,SAAS,CAAC;AASzE;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACvC,SAAS,EAAE,cAAc,CAAC,SAAS,EAAE,aAAa,CAAC,EACnD,IAAI,EAAE,MAAM,EACZ,gBAAgB,GAAE,OAAc,EAChC,QAAQ,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAwGlC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAkI1D"}
@@ -90,9 +90,7 @@ export async function performFuzzActions(generator, seed, synchronizeAtEnd = tru
90
90
  }
91
91
  expect(areRevisionViewsSemanticallyEqual(tree.currentView, tree, first.currentView, first)).to
92
92
  .be.true;
93
- for (const node of tree.currentView) {
94
- expect(tree.attributeNodeId(node.identifier)).to.equal(first.attributeNodeId(first.convertToNodeId(tree.convertToStableNodeId(node.identifier))));
95
- }
93
+ // TODO:#461: Compare attribution info of all nodes in currentView to all nodes in `first`
96
94
  }
97
95
  }
98
96
  return state;
@@ -1 +1 @@
1
- {"version":3,"file":"SharedTreeFuzzTests.js","sourceRoot":"","sources":["../../../src/test/fuzz/SharedTreeFuzzTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,M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,CAAC,+BAA+B,EAAE,GAAG,EAAE;YAC9C,oBAAoB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;YAC3C,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { expect } from 'chai';\nimport {\n\tAsyncGenerator,\n\tchainAsync as chain,\n\tmakeRandom,\n\ttakeAsync as take,\n\tperformFuzzActionsAsync as performFuzzActionsBase,\n} from '@fluid-internal/stochastic-test-utils';\nimport { setUpLocalServerTestSharedTree, testDocumentsPathBase } from '../utilities/TestUtilities';\nimport { WriteFormat } from '../../persisted-types';\nimport { fail } from '../../Common';\nimport { areRevisionViewsSemanticallyEqual } from '../../EditUtilities';\nimport { FuzzTestState, EditGenerationConfig, Operation } from './Types';\nimport { makeOpGenerator } from './Generators';\n\nconst directory = join(testDocumentsPathBase, 'fuzz-tests');\n\n// TODO: Kludge: Use this to change the seed such that the tests avoid hitting bugs in the Fluid Framework.\n// Should be removed once fuzz tests pass reliably with any seed.\nconst adjustSeed = 0;\n\n/**\n * Performs random actions on a set of clients.\n * @param generator - finite generator for a sequence of Operations to test. The test will run until this generator is\n * exhausted.\n * @param seed - the seed for the random generation of the fuzz actions\n * @param synchronizeAtEnd - if provided, all client will have all operations delivered from the server at the end of\n * the test\n * @param saveInfo - optionally provide an operation number at which a history of all operations will be saved to disk\n * at a given filepath. This can be useful for debugging why a fuzz test may have failed.\n */\nexport async function performFuzzActions(\n\tgenerator: AsyncGenerator<Operation, FuzzTestState>,\n\tseed: number,\n\tsynchronizeAtEnd: boolean = true,\n\tsaveInfo?: { saveAt?: number; saveOnFailure: boolean; filepath: string }\n): Promise<Required<FuzzTestState>> {\n\tconst random = makeRandom(seed);\n\n\t// Note: the direct fields of `state` aren't mutated, but it is mutated transitively.\n\tconst initialState: FuzzTestState = { random, passiveCollaborators: [], activeCollaborators: [] };\n\tconst finalState = await performFuzzActionsBase(\n\t\tgenerator,\n\t\t{\n\t\t\tedit: async (state, operation) => {\n\t\t\t\tconst { index, contents } = operation;\n\t\t\t\tconst { tree } = state.activeCollaborators[index];\n\t\t\t\tswitch (contents.fuzzType) {\n\t\t\t\t\tcase 'insert':\n\t\t\t\t\t\ttree.applyEdit(contents.build, contents.insert);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\ttree.applyEdit(contents);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'move':\n\t\t\t\t\t\ttree.applyEdit(contents.detach, contents.insert);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'setPayload':\n\t\t\t\t\t\ttree.applyEdit(contents);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfail('Invalid edit.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tjoin: async (state, operation) => {\n\t\t\t\tconst { isObserver, summarizeHistory, writeFormat } = operation;\n\t\t\t\tconst { container, tree, testObjectProvider } = await setUpLocalServerTestSharedTree({\n\t\t\t\t\twriteFormat,\n\t\t\t\t\tsummarizeHistory,\n\t\t\t\t\ttestObjectProvider: state.testObjectProvider,\n\t\t\t\t});\n\t\t\t\t(isObserver ? state.passiveCollaborators : state.activeCollaborators).push({ container, tree });\n\t\t\t\treturn { ...state, testObjectProvider };\n\t\t\t},\n\t\t\tleave: async (state, operation) => {\n\t\t\t\tconst { index, isObserver } = operation;\n\t\t\t\tconst treeList = isObserver ? state.passiveCollaborators : state.activeCollaborators;\n\t\t\t\ttreeList[index].container.close();\n\t\t\t\ttreeList.splice(index, 1);\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tsynchronize: async (state) => {\n\t\t\t\tconst { testObjectProvider } = state;\n\t\t\t\tif (testObjectProvider === undefined) {\n\t\t\t\t\tfail('Attempted to synchronize with undefined testObjectProvider');\n\t\t\t\t}\n\t\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\t\tconst trees = [...state.activeCollaborators, ...state.passiveCollaborators];\n\t\t\t\tif (trees.length > 1) {\n\t\t\t\t\tconst first = trees[0].tree;\n\t\t\t\t\tfor (let i = 1; i < trees.length; i++) {\n\t\t\t\t\t\tconst tree = trees[i].tree;\n\t\t\t\t\t\tconst editLogA = first.edits;\n\t\t\t\t\t\tconst editLogB = tree.edits;\n\t\t\t\t\t\tconst minEdits = Math.min(editLogA.length, editLogB.length);\n\t\t\t\t\t\tfor (let j = 0; j < minEdits - 1; j++) {\n\t\t\t\t\t\t\tconst editA = await editLogA.getEditAtIndex(editLogA.length - j - 1);\n\t\t\t\t\t\t\tconst editB = await editLogB.getEditAtIndex(editLogB.length - j - 1);\n\t\t\t\t\t\t\texpect(editA.id).to.equal(editB.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\texpect(areRevisionViewsSemanticallyEqual(tree.currentView, tree, first.currentView, first)).to\n\t\t\t\t\t\t\t.be.true;\n\n\t\t\t\t\t\tfor (const node of tree.currentView) {\n\t\t\t\t\t\t\texpect(tree.attributeNodeId(node.identifier)).to.equal(\n\t\t\t\t\t\t\t\tfirst.attributeNodeId(\n\t\t\t\t\t\t\t\t\tfirst.convertToNodeId(tree.convertToStableNodeId(node.identifier))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn state;\n\t\t\t},\n\t\t},\n\t\tinitialState,\n\t\tsaveInfo\n\t);\n\n\tif (synchronizeAtEnd) {\n\t\tif (finalState.testObjectProvider !== undefined) {\n\t\t\tawait finalState.testObjectProvider.ensureSynchronized();\n\t\t\tconst events = finalState.testObjectProvider.logger.reportAndClearTrackedEvents();\n\t\t\texpect(events.expectedNotFound.length).to.equal(0);\n\t\t\t// Tolerate failed edit chunk uploads, because they are fire-and-forget and can fail (e.g. the uploading client leaves before upload completes).\n\t\t\texpect(\n\t\t\t\tevents.unexpectedErrors.every(\n\t\t\t\t\t(e) => e.eventName === 'fluid:telemetry:FluidDataStoreRuntime:SharedTree:EditChunkUploadFailure'\n\t\t\t\t)\n\t\t\t).to.be.true;\n\t\t}\n\t\tconst trees = [\n\t\t\t...finalState.activeCollaborators.map(({ tree }) => tree),\n\t\t\t...finalState.passiveCollaborators.map(({ tree }) => tree),\n\t\t];\n\t\tfor (let i = 0; i < trees.length - 1; i++) {\n\t\t\texpect(trees[i].equals(trees[i + 1]));\n\t\t}\n\t}\n\n\treturn finalState as Required<FuzzTestState>;\n}\n\nexport function runSharedTreeFuzzTests(title: string): void {\n\t// Some useful tips for debugging fuzz tests:\n\t// - A JSON dump of the operation sequence can be written to disk by passing `true` for `saveOnFailure`.\n\t// - Different shared-tree instances can be distinguished (e.g. in logs) by using `tree.getRuntime().clientId`\n\tdescribe(title, () => {\n\t\tfunction runTest(\n\t\t\tgeneratorFactory: () => AsyncGenerator<Operation, FuzzTestState>,\n\t\t\tseed: number,\n\t\t\tsaveOnFailure?: boolean\n\t\t): void {\n\t\t\tit(`with seed ${seed}`, async () => {\n\t\t\t\tconst saveInfo =\n\t\t\t\t\tsaveOnFailure !== undefined\n\t\t\t\t\t\t? { filepath: join(directory, `test-history-${seed}.json`), saveOnFailure }\n\t\t\t\t\t\t: undefined;\n\t\t\t\tif (saveInfo !== undefined && !existsSync(directory)) {\n\t\t\t\t\tmkdirSync(directory);\n\t\t\t\t}\n\t\t\t\tawait performFuzzActions(generatorFactory(), seed + adjustSeed, true, saveInfo);\n\t\t\t}).timeout(10000);\n\t\t}\n\n\t\tfunction runMixedVersionTests(summarizeHistory: boolean, testsPerSuite: number, testLength: number): void {\n\t\t\tdescribe('using 0.0.2 and 0.1.1 trees', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(testLength, makeOpGenerator({ joinConfig: { summarizeHistory: [summarizeHistory] } })),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('using only version 0.0.2', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t\ttestLength,\n\t\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_0_2],\n\t\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('using only version 0.1.1', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t\ttestLength,\n\t\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_1_1],\n\t\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('upgrading halfway through', () => {\n\t\t\t\tconst maximumActiveCollaborators = 10;\n\t\t\t\tconst maximumPassiveCollaborators = 5;\n\t\t\t\tconst editConfig: EditGenerationConfig = { maxTreeSize: 1000 };\n\t\t\t\tconst generatorFactory = () =>\n\t\t\t\t\tchain(\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\ttestLength / 2 - 1,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\teditConfig,\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_0_2],\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators: maximumActiveCollaborators + 1,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_1_1],\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\teditWeight: 0,\n\t\t\t\t\t\t\t\tjoinWeight: 1,\n\t\t\t\t\t\t\t\tleaveWeight: 0,\n\t\t\t\t\t\t\t\tsynchronizeWeight: 0,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\ttestLength / 2,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\teditConfig,\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(generatorFactory, seed);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tconst testCount = 1;\n\t\tconst testLength = 200;\n\t\tdescribe('with no-history summarization', () => {\n\t\t\trunMixedVersionTests(false, testCount, testLength);\n\t\t});\n\n\t\tdescribe('with history summarization', () => {\n\t\t\trunMixedVersionTests(true, testCount, testLength);\n\t\t});\n\t});\n}\n"]}
1
+ {"version":3,"file":"SharedTreeFuzzTests.js","sourceRoot":"","sources":["../../../src/test/fuzz/SharedTreeFuzzTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAEN,UAAU,IAAI,KAAK,EACnB,UAAU,EACV,SAAS,IAAI,IAAI,EACjB,uBAAuB,IAAI,sBAAsB,GACjD,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,SAAS,GAAG,IAAI,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;AAE5D,2GAA2G;AAC3G,iEAAiE;AACjE,MAAM,UAAU,G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B,gBAAgB,EAAE,CAAC,gBAAgB,CAAC;qBACpC;iBACD,CAAC,CACF,CACD,CAAC;gBACH,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,aAAa,EAAE,IAAI,EAAE,EAAE;oBAChD,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;iBAChC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,GAAG,CAAC,CAAC;QACpB,MAAM,UAAU,GAAG,GAAG,CAAC;QACvB,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;YAC9C,oBAAoB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;YAC3C,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { expect } from 'chai';\nimport {\n\tAsyncGenerator,\n\tchainAsync as chain,\n\tmakeRandom,\n\ttakeAsync as take,\n\tperformFuzzActionsAsync as performFuzzActionsBase,\n} from '@fluid-internal/stochastic-test-utils';\nimport { setUpLocalServerTestSharedTree, testDocumentsPathBase } from '../utilities/TestUtilities';\nimport { WriteFormat } from '../../persisted-types';\nimport { fail } from '../../Common';\nimport { areRevisionViewsSemanticallyEqual } from '../../EditUtilities';\nimport { FuzzTestState, EditGenerationConfig, Operation } from './Types';\nimport { makeOpGenerator } from './Generators';\n\nconst directory = join(testDocumentsPathBase, 'fuzz-tests');\n\n// TODO: Kludge: Use this to change the seed such that the tests avoid hitting bugs in the Fluid Framework.\n// Should be removed once fuzz tests pass reliably with any seed.\nconst adjustSeed = 0;\n\n/**\n * Performs random actions on a set of clients.\n * @param generator - finite generator for a sequence of Operations to test. The test will run until this generator is\n * exhausted.\n * @param seed - the seed for the random generation of the fuzz actions\n * @param synchronizeAtEnd - if provided, all client will have all operations delivered from the server at the end of\n * the test\n * @param saveInfo - optionally provide an operation number at which a history of all operations will be saved to disk\n * at a given filepath. This can be useful for debugging why a fuzz test may have failed.\n */\nexport async function performFuzzActions(\n\tgenerator: AsyncGenerator<Operation, FuzzTestState>,\n\tseed: number,\n\tsynchronizeAtEnd: boolean = true,\n\tsaveInfo?: { saveAt?: number; saveOnFailure: boolean; filepath: string }\n): Promise<Required<FuzzTestState>> {\n\tconst random = makeRandom(seed);\n\n\t// Note: the direct fields of `state` aren't mutated, but it is mutated transitively.\n\tconst initialState: FuzzTestState = { random, passiveCollaborators: [], activeCollaborators: [] };\n\tconst finalState = await performFuzzActionsBase(\n\t\tgenerator,\n\t\t{\n\t\t\tedit: async (state, operation) => {\n\t\t\t\tconst { index, contents } = operation;\n\t\t\t\tconst { tree } = state.activeCollaborators[index];\n\t\t\t\tswitch (contents.fuzzType) {\n\t\t\t\t\tcase 'insert':\n\t\t\t\t\t\ttree.applyEdit(contents.build, contents.insert);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\ttree.applyEdit(contents);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'move':\n\t\t\t\t\t\ttree.applyEdit(contents.detach, contents.insert);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'setPayload':\n\t\t\t\t\t\ttree.applyEdit(contents);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfail('Invalid edit.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tjoin: async (state, operation) => {\n\t\t\t\tconst { isObserver, summarizeHistory, writeFormat } = operation;\n\t\t\t\tconst { container, tree, testObjectProvider } = await setUpLocalServerTestSharedTree({\n\t\t\t\t\twriteFormat,\n\t\t\t\t\tsummarizeHistory,\n\t\t\t\t\ttestObjectProvider: state.testObjectProvider,\n\t\t\t\t});\n\t\t\t\t(isObserver ? state.passiveCollaborators : state.activeCollaborators).push({ container, tree });\n\t\t\t\treturn { ...state, testObjectProvider };\n\t\t\t},\n\t\t\tleave: async (state, operation) => {\n\t\t\t\tconst { index, isObserver } = operation;\n\t\t\t\tconst treeList = isObserver ? state.passiveCollaborators : state.activeCollaborators;\n\t\t\t\ttreeList[index].container.close();\n\t\t\t\ttreeList.splice(index, 1);\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tsynchronize: async (state) => {\n\t\t\t\tconst { testObjectProvider } = state;\n\t\t\t\tif (testObjectProvider === undefined) {\n\t\t\t\t\tfail('Attempted to synchronize with undefined testObjectProvider');\n\t\t\t\t}\n\t\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\t\tconst trees = [...state.activeCollaborators, ...state.passiveCollaborators];\n\t\t\t\tif (trees.length > 1) {\n\t\t\t\t\tconst first = trees[0].tree;\n\t\t\t\t\tfor (let i = 1; i < trees.length; i++) {\n\t\t\t\t\t\tconst tree = trees[i].tree;\n\t\t\t\t\t\tconst editLogA = first.edits;\n\t\t\t\t\t\tconst editLogB = tree.edits;\n\t\t\t\t\t\tconst minEdits = Math.min(editLogA.length, editLogB.length);\n\t\t\t\t\t\tfor (let j = 0; j < minEdits - 1; j++) {\n\t\t\t\t\t\t\tconst editA = await editLogA.getEditAtIndex(editLogA.length - j - 1);\n\t\t\t\t\t\t\tconst editB = await editLogB.getEditAtIndex(editLogB.length - j - 1);\n\t\t\t\t\t\t\texpect(editA.id).to.equal(editB.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\texpect(areRevisionViewsSemanticallyEqual(tree.currentView, tree, first.currentView, first)).to\n\t\t\t\t\t\t\t.be.true;\n\n\t\t\t\t\t\t// TODO:#461: Compare attribution info of all nodes in currentView to all nodes in `first`\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn state;\n\t\t\t},\n\t\t},\n\t\tinitialState,\n\t\tsaveInfo\n\t);\n\n\tif (synchronizeAtEnd) {\n\t\tif (finalState.testObjectProvider !== undefined) {\n\t\t\tawait finalState.testObjectProvider.ensureSynchronized();\n\t\t\tconst events = finalState.testObjectProvider.logger.reportAndClearTrackedEvents();\n\t\t\texpect(events.expectedNotFound.length).to.equal(0);\n\t\t\t// Tolerate failed edit chunk uploads, because they are fire-and-forget and can fail (e.g. the uploading client leaves before upload completes).\n\t\t\texpect(\n\t\t\t\tevents.unexpectedErrors.every(\n\t\t\t\t\t(e) => e.eventName === 'fluid:telemetry:FluidDataStoreRuntime:SharedTree:EditChunkUploadFailure'\n\t\t\t\t)\n\t\t\t).to.be.true;\n\t\t}\n\t\tconst trees = [\n\t\t\t...finalState.activeCollaborators.map(({ tree }) => tree),\n\t\t\t...finalState.passiveCollaborators.map(({ tree }) => tree),\n\t\t];\n\t\tfor (let i = 0; i < trees.length - 1; i++) {\n\t\t\texpect(trees[i].equals(trees[i + 1]));\n\t\t}\n\t}\n\n\treturn finalState as Required<FuzzTestState>;\n}\n\nexport function runSharedTreeFuzzTests(title: string): void {\n\t// Some useful tips for debugging fuzz tests:\n\t// - A JSON dump of the operation sequence can be written to disk by passing `true` for `saveOnFailure`.\n\t// - Different shared-tree instances can be distinguished (e.g. in logs) by using `tree.getRuntime().clientId`\n\tdescribe(title, () => {\n\t\tfunction runTest(\n\t\t\tgeneratorFactory: () => AsyncGenerator<Operation, FuzzTestState>,\n\t\t\tseed: number,\n\t\t\tsaveOnFailure?: boolean\n\t\t): void {\n\t\t\tit(`with seed ${seed}`, async () => {\n\t\t\t\tconst saveInfo =\n\t\t\t\t\tsaveOnFailure !== undefined\n\t\t\t\t\t\t? { filepath: join(directory, `test-history-${seed}.json`), saveOnFailure }\n\t\t\t\t\t\t: undefined;\n\t\t\t\tif (saveInfo !== undefined && !existsSync(directory)) {\n\t\t\t\t\tmkdirSync(directory);\n\t\t\t\t}\n\t\t\t\tawait performFuzzActions(generatorFactory(), seed + adjustSeed, true, saveInfo);\n\t\t\t}).timeout(10000);\n\t\t}\n\n\t\tfunction runMixedVersionTests(summarizeHistory: boolean, testsPerSuite: number, testLength: number): void {\n\t\t\tdescribe('using 0.0.2 and 0.1.1 trees', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(testLength, makeOpGenerator({ joinConfig: { summarizeHistory: [summarizeHistory] } })),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('using only version 0.0.2', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t\ttestLength,\n\t\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_0_2],\n\t\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('using only version 0.1.1', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t\ttestLength,\n\t\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_1_1],\n\t\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('upgrading halfway through', () => {\n\t\t\t\tconst maximumActiveCollaborators = 10;\n\t\t\t\tconst maximumPassiveCollaborators = 5;\n\t\t\t\tconst editConfig: EditGenerationConfig = { maxTreeSize: 1000 };\n\t\t\t\tconst generatorFactory = () =>\n\t\t\t\t\tchain(\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\ttestLength / 2 - 1,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\teditConfig,\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_0_2],\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators: maximumActiveCollaborators + 1,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_1_1],\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\teditWeight: 0,\n\t\t\t\t\t\t\t\tjoinWeight: 1,\n\t\t\t\t\t\t\t\tleaveWeight: 0,\n\t\t\t\t\t\t\t\tsynchronizeWeight: 0,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\ttestLength / 2,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\teditConfig,\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(generatorFactory, seed);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tconst testCount = 1;\n\t\tconst testLength = 200;\n\t\tdescribe('with no-history summarization', () => {\n\t\t\trunMixedVersionTests(false, testCount, testLength);\n\t\t});\n\n\t\tdescribe('with history summarization', () => {\n\t\t\trunMixedVersionTests(true, testCount, testLength);\n\t\t});\n\t});\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SharedTreeTests.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/SharedTreeTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,OAAO,EAeN,WAAW,EACX,MAAM,uBAAuB,CAAC;AAa/B,OAAO,EAGN,2BAA2B,EAC3B,wBAAwB,EAcxB,MAAM,iBAAiB,CAAC;AAazB;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,qCAAqC,EAAE,CAAC,OAAO,CAAC,EAAE,wBAAwB,KAAK,2BAA2B,QA49C1G"}
1
+ {"version":3,"file":"SharedTreeTests.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/SharedTreeTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,OAAO,EAeN,WAAW,EACX,MAAM,uBAAuB,CAAC;AAa/B,OAAO,EAGN,2BAA2B,EAC3B,wBAAwB,EAcxB,MAAM,iBAAiB,CAAC;AAazB;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,qCAAqC,EAAE,CAAC,OAAO,CAAC,EAAE,wBAAwB,KAAK,2BAA2B,QAy9C1G"}
@@ -23,7 +23,6 @@ import { InterningTreeCompressor } from '../../TreeCompressor';
23
23
  import { SharedTreeEncoder_0_0_2, SharedTreeEncoder_0_1_1 } from '../../SharedTreeEncoder';
24
24
  import { sequencedIdNormalizer } from '../../NodeIdUtilities';
25
25
  import { convertNodeDataIds } from '../../IdConversion';
26
- import { generateStableId, nilUuid } from '../../UuidUtilities';
27
26
  import { buildLeaf, SimpleTestTree } from './TestNode';
28
27
  import { TestFluidHandle, TestFluidSerializer } from './TestSerializer';
29
28
  import { runSharedTreeUndoRedoTestSuite } from './UndoRedoTests';
@@ -217,16 +216,18 @@ export function runSharedTreeOperationsTests(title, writeFormat, setUpTestShared
217
216
  sharedTree.applyEdit(Change.build([], 0));
218
217
  });
219
218
  });
220
- it('correctly reports attribution ID', () => {
221
- const attributionId = generateStableId();
222
- const { tree } = setUpTestSharedTree({ attributionId });
223
- expect(tree.attributionId).to.equal(writeFormat === WriteFormat.v0_0_2 ? nilUuid : attributionId);
219
+ // TODO:#461: Reenable
220
+ it.skip('correctly reports attribution ID', () => {
221
+ // const attributionId = generateStableId();
222
+ // const { tree } = setUpTestSharedTree({ attributionId });
223
+ // expect(tree.attributionId).to.equal(writeFormat === WriteFormat.v0_0_2 ? nilUuid : attributionId);
224
224
  });
225
- it('correctly attributes node IDs', () => {
226
- const attributionId = generateStableId();
227
- const { tree } = setUpTestSharedTree({ attributionId });
228
- const id = tree.generateNodeId();
229
- expect(tree.attributeNodeId(id)).to.equal(writeFormat === WriteFormat.v0_0_2 ? nilUuid : attributionId);
225
+ // TODO:#461: Reenable
226
+ it.skip('correctly attributes node IDs', () => {
227
+ // const attributionId = generateStableId();
228
+ // const { tree } = setUpTestSharedTree({ attributionId });
229
+ // const id = tree.generateNodeId();
230
+ // expect(tree.attributeNodeId(id)).to.equal(writeFormat === WriteFormat.v0_0_2 ? nilUuid : attributionId);
230
231
  });
231
232
  runSharedTreeUndoRedoTestSuite(Object.assign({ localMode: true }, undoRedoOptions));
232
233
  });
@@ -458,22 +459,43 @@ export function runSharedTreeOperationsTests(title, writeFormat, setUpTestShared
458
459
  const blobContents = await blobHandle.get();
459
460
  expect(IsoBuffer.from(blobContents, 'utf8').toString()).to.equal(blobbedPayload);
460
461
  });
461
- it('can exchange attribution IDs', () => {
462
- const attributionId1 = generateStableId();
463
- const { tree: sharedTree1, containerRuntimeFactory } = setUpTestSharedTree(Object.assign(Object.assign({}, tree1Options), { attributionId: attributionId1 }));
464
- const attributionId2 = generateStableId();
465
- const { tree: sharedTree2 } = setUpTestSharedTree(Object.assign(Object.assign({}, createSecondTreeOptions(containerRuntimeFactory)), { attributionId: attributionId2 }));
466
- containerRuntimeFactory.processAllMessages();
467
- const nodeId1 = sharedTree1.generateNodeId();
468
- const stableNodeId1 = sharedTree1.convertToStableNodeId(nodeId1);
469
- sharedTree1.applyEdit(...Change.insertTree([buildLeaf(nodeId1)], StablePlace.atEndOf(testTrait(sharedTree1.currentView))));
470
- containerRuntimeFactory.processAllMessages();
471
- expect(sharedTree2.attributeNodeId(sharedTree2.convertToNodeId(stableNodeId1))).to.equal(attributionId1);
472
- const nodeId2 = sharedTree2.generateNodeId();
473
- const stableNodeId2 = sharedTree2.convertToStableNodeId(nodeId1);
474
- sharedTree2.applyEdit(...Change.insertTree([buildLeaf(nodeId2)], StablePlace.atEndOf(testTrait(sharedTree2.currentView))));
475
- containerRuntimeFactory.processAllMessages();
476
- expect(sharedTree1.attributeNodeId(sharedTree1.convertToNodeId(stableNodeId2))).to.equal(attributionId2);
462
+ // TODO:#461: Reenable
463
+ it.skip('can exchange attribution IDs', () => {
464
+ // const attributionId1 = generateStableId();
465
+ // const { tree: sharedTree1, containerRuntimeFactory } = setUpTestSharedTree({
466
+ // ...tree1Options,
467
+ // attributionId: attributionId1,
468
+ // });
469
+ // const attributionId2 = generateStableId();
470
+ // const { tree: sharedTree2 } = setUpTestSharedTree({
471
+ // ...createSecondTreeOptions(containerRuntimeFactory),
472
+ // attributionId: attributionId2,
473
+ // });
474
+ // containerRuntimeFactory.processAllMessages();
475
+ // const nodeId1 = sharedTree1.generateNodeId();
476
+ // const stableNodeId1 = sharedTree1.convertToStableNodeId(nodeId1);
477
+ // sharedTree1.applyEdit(
478
+ // ...Change.insertTree(
479
+ // [buildLeaf(nodeId1)],
480
+ // StablePlace.atEndOf(testTrait(sharedTree1.currentView))
481
+ // )
482
+ // );
483
+ // containerRuntimeFactory.processAllMessages();
484
+ // expect(sharedTree2.attributeNodeId(sharedTree2.convertToNodeId(stableNodeId1))).to.equal(
485
+ // attributionId1
486
+ // );
487
+ // const nodeId2 = sharedTree2.generateNodeId();
488
+ // const stableNodeId2 = sharedTree2.convertToStableNodeId(nodeId1);
489
+ // sharedTree2.applyEdit(
490
+ // ...Change.insertTree(
491
+ // [buildLeaf(nodeId2)],
492
+ // StablePlace.atEndOf(testTrait(sharedTree2.currentView))
493
+ // )
494
+ // );
495
+ // containerRuntimeFactory.processAllMessages();
496
+ // expect(sharedTree1.attributeNodeId(sharedTree1.convertToNodeId(stableNodeId2))).to.equal(
497
+ // attributionId2
498
+ // );
477
499
  });
478
500
  }
479
501
  });
@@ -517,7 +539,8 @@ export function runSharedTreeOperationsTests(title, writeFormat, setUpTestShared
517
539
  const treeContent = JSON.parse(serialized);
518
540
  let parsedTree;
519
541
  if (writeFormat === WriteFormat.v0_1_1) {
520
- parsedTree = new SharedTreeEncoder_0_1_1(true).decodeSummary(treeContent, sharedTree.attributionId);
542
+ // TODO:#461: Pass in attribution ID
543
+ parsedTree = new SharedTreeEncoder_0_1_1(true).decodeSummary(treeContent);
521
544
  }
522
545
  else {
523
546
  parsedTree = new SharedTreeEncoder_0_0_2(true).decodeSummary(treeContent);