@fluidframework/register-collection 2.0.0-rc.1.0.6 → 2.0.0-rc.2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.eslintrc.js → .eslintrc.cjs} +4 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/register-collection.api.md +1 -4
- package/dist/consensusRegisterCollection.d.ts +4 -4
- package/dist/consensusRegisterCollection.d.ts.map +1 -1
- package/dist/consensusRegisterCollection.js +16 -15
- package/dist/consensusRegisterCollection.js.map +1 -1
- package/dist/consensusRegisterCollectionFactory.d.ts +1 -1
- package/dist/consensusRegisterCollectionFactory.d.ts.map +1 -1
- package/dist/consensusRegisterCollectionFactory.js +5 -5
- package/dist/consensusRegisterCollectionFactory.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/register-collection-alpha.d.ts +1 -1
- package/dist/register-collection-beta.d.ts +2 -0
- package/dist/register-collection-public.d.ts +2 -0
- package/dist/register-collection-untrimmed.d.ts +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{consensusRegisterCollection.d.mts → consensusRegisterCollection.d.ts} +5 -5
- package/lib/consensusRegisterCollection.d.ts.map +1 -0
- package/lib/{consensusRegisterCollection.mjs → consensusRegisterCollection.js} +14 -13
- package/lib/consensusRegisterCollection.js.map +1 -0
- package/lib/{consensusRegisterCollectionFactory.d.mts → consensusRegisterCollectionFactory.d.ts} +2 -2
- package/lib/consensusRegisterCollectionFactory.d.ts.map +1 -0
- package/lib/{consensusRegisterCollectionFactory.mjs → consensusRegisterCollectionFactory.js} +3 -3
- package/lib/consensusRegisterCollectionFactory.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +4 -4
- package/lib/index.d.ts.map +1 -0
- package/lib/{index.mjs → index.js} +4 -4
- package/lib/index.js.map +1 -0
- package/lib/{interfaces.d.mts → interfaces.d.ts} +1 -1
- package/lib/interfaces.d.ts.map +1 -0
- package/lib/{interfaces.mjs → interfaces.js} +1 -1
- package/lib/interfaces.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/{register-collection-alpha.d.mts → register-collection-alpha.d.ts} +1 -1
- package/lib/{register-collection-beta.d.mts → register-collection-beta.d.ts} +2 -0
- package/lib/{register-collection-public.d.mts → register-collection-public.d.ts} +2 -0
- package/lib/{register-collection-untrimmed.d.mts → register-collection-untrimmed.d.ts} +1 -1
- package/lib/test/consensusRegisterCollection.spec.js +281 -0
- package/lib/test/consensusRegisterCollection.spec.js.map +1 -0
- package/lib/test/types/validateRegisterCollectionPrevious.generated.js +14 -0
- package/lib/test/types/validateRegisterCollectionPrevious.generated.js.map +1 -0
- package/package.json +40 -47
- package/src/consensusRegisterCollection.ts +35 -23
- package/src/consensusRegisterCollectionFactory.ts +3 -3
- package/src/index.ts +3 -3
- package/src/packageVersion.ts +1 -1
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/consensusRegisterCollection.d.mts.map +0 -1
- package/lib/consensusRegisterCollection.mjs.map +0 -1
- package/lib/consensusRegisterCollectionFactory.d.mts.map +0 -1
- package/lib/consensusRegisterCollectionFactory.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs.map +0 -1
- package/lib/interfaces.d.mts.map +0 -1
- package/lib/interfaces.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consensusRegisterCollection.js","sourceRoot":"","sources":["../src/consensusRegisterCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAMrE,OAAO,EAA6B,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAE9F,OAAO,EAEN,YAAY,EACZ,uBAAuB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAGN,UAAU,GACV,MAAM,iBAAiB,CAAC;AAqBzB,MAAM,gBAAgB,GAAG,CAAI,cAAsB,EAAE,KAAQ,EAAqB,EAAE,CAAC,CAAC;IACrF,cAAc;IACd,KAAK,EAAE;QACN,IAAI,EAAE,OAAO;QACb,KAAK;KACL;CACD,CAAC,CAAC;AA6CH,0EAA0E;AAC1E,MAAM,4BAA4B,GAAG,CAAI,EAAE,EAAoC,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC;AAKhG,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;GAGG;AACH,MAAM,OAAO,2BACZ,SAAQ,YAAgD;IAGxD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAI,OAA+B,EAAE,EAAW;QACnE,OAAO,OAAO,CAAC,aAAa,CAC3B,EAAE,EACF,kCAAkC,CAAC,IAAI,CACL,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,kCAAkC,EAAE,CAAC;IACjD,CAAC;IAID;;;OAGG;IACH,YACC,EAAU,EACV,OAA+B,EAC/B,UAA8B;QAE9B,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,oCAAoC,CAAC,CAA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AC,UAAU,EAAE,EAAE;YACvB,MAAM,CACL,MAAM,KAAK,CAAC,IAAI,cAAc,KAAK,CAAC,EACpC,KAAK,CAAC,6DAA6D,CACnE,CAAC;SACF;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACpC,MAAM;YACL,uGAAuG;YACvG,cAAc,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,cAAc,EACxE,KAAK,CAAC,8DAA8D,CACpE,CAAC;SACF;QAED,wBAAwB;QACxB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAElC,sDAAsD;QACtD,IAAI,MAAM,EAAE;YACX,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC9C;QACD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAE/C,OAAO,MAAM,CAAC;IACf,CAAC;IAEO,SAAS,CAAC,KAAU,EAAE,UAA4B;QACzD,OAAO,UAAU,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAEO,KAAK,CAAC,OAAe,EAAE,UAA4B;QAC1D,OAAO,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAES,cAAc;QACvB,uBAAuB;IACxB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport {\n\tIChannelAttributes,\n\tIChannelStorageService,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport {\n\tIFluidSerializer,\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base\";\nimport { ConsensusRegisterCollectionFactory } from \"./consensusRegisterCollectionFactory.js\";\nimport {\n\tIConsensusRegisterCollection,\n\tIConsensusRegisterCollectionEvents,\n\tReadPolicy,\n} from \"./interfaces.js\";\n\ninterface ILocalData<T> {\n\t// Atomic version\n\tatomic: ILocalRegister<T>;\n\n\t// All concurrent versions awaiting consensus\n\tversions: ILocalRegister<T>[];\n}\n\ninterface ILocalRegister<T> {\n\t// Register value, wrapped for backwards compatibility with < 0.17\n\tvalue: {\n\t\ttype: \"Plain\";\n\t\tvalue: T;\n\t};\n\n\t// The sequence number when last consensus was reached\n\tsequenceNumber: number;\n}\n\nconst newLocalRegister = <T>(sequenceNumber: number, value: T): ILocalRegister<T> => ({\n\tsequenceNumber,\n\tvalue: {\n\t\ttype: \"Plain\",\n\t\tvalue,\n\t},\n});\n\n/**\n * An operation for consensus register collection\n *\n * The value stored in this op is serialized as a string and must be deserialized\n */\ninterface IRegisterOperationSerialized {\n\tkey: string;\n\ttype: \"write\";\n\tserializedValue: string;\n\n\t// Message can be delivered with delay - resubmitted on reconnect.\n\t// As such, refSeq needs to reference seq # at the time op was created,\n\t// not when op was actually sent over wire (ISequencedDocumentMessage.referenceSequenceNumber),\n\t// as client can ingest ops in between.\n\trefSeq: number | undefined;\n}\n\n/**\n * IRegisterOperation format in versions \\< 0.17 and \\>=2.0.0-rc.2.0.0\n *\n * The value stored in this op is _not_ serialized and is stored literally as `T`\n */\ninterface IRegisterOperationPlain<T> {\n\tkey: string;\n\ttype: \"write\";\n\n\tvalue: {\n\t\ttype: \"Plain\";\n\t\tvalue: T;\n\t};\n\n\t// back-compat: for clients prior to 2.0.0-rc.2.0.0, we must also pass in\n\t// the serialized value for them to parse handles correctly. we do not have\n\t// to pay the cost of deserializing this value in newer clients\n\tserializedValue: string;\n\n\t// back-compat: files at rest written with runtime <= 0.13 do not have refSeq\n\trefSeq: number | undefined;\n}\n\n/** Incoming ops could match any of these types */\ntype IIncomingRegisterOperation<T> = IRegisterOperationSerialized | IRegisterOperationPlain<T>;\n\n/** Distinguish between incoming op formats so we know which type it is */\nconst incomingOpMatchesPlainFormat = <T>(op): op is IRegisterOperationPlain<T> => \"value\" in op;\n\n/** The type of the resolve function to call after the local operation is ack'd */\ntype PendingResolve = (winner: boolean) => void;\n\nconst snapshotFileName = \"header\";\n\n/**\n * {@inheritDoc IConsensusRegisterCollection}\n * @alpha\n */\nexport class ConsensusRegisterCollection<T>\n\textends SharedObject<IConsensusRegisterCollectionEvents>\n\timplements IConsensusRegisterCollection<T>\n{\n\t/**\n\t * Create a new consensus register collection\n\t *\n\t * @param runtime - data store runtime the new consensus register collection belongs to\n\t * @param id - optional name of the consensus register collection\n\t * @returns newly create consensus register collection (but not attached yet)\n\t */\n\tpublic static create<T>(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(\n\t\t\tid,\n\t\t\tConsensusRegisterCollectionFactory.Type,\n\t\t) as ConsensusRegisterCollection<T>;\n\t}\n\n\t/**\n\t * Get a factory for ConsensusRegisterCollection to register with the data store.\n\t *\n\t * @returns a factory that creates and load ConsensusRegisterCollection\n\t */\n\tpublic static getFactory() {\n\t\treturn new ConsensusRegisterCollectionFactory();\n\t}\n\n\tprivate readonly data = new Map<string, ILocalData<T>>();\n\n\t/**\n\t * Constructs a new consensus register collection. If the object is non-local an id and service interfaces will\n\t * be provided\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_consensusRegisterCollection_\");\n\t}\n\n\t/**\n\t * Creates a new register or writes a new value.\n\t * Returns a promise that will resolve when the write is acked.\n\t *\n\t * @returns Promise<true> if write was non-concurrent\n\t */\n\tpublic async write(key: string, value: T): Promise<boolean> {\n\t\tif (!this.isAttached()) {\n\t\t\tthis.processInboundWrite(key, value, 0, 0, true);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst message: IRegisterOperationPlain<T> = {\n\t\t\tkey,\n\t\t\ttype: \"write\",\n\t\t\tserializedValue: this.stringify(value, this.serializer),\n\t\t\tvalue: {\n\t\t\t\ttype: \"Plain\",\n\t\t\t\tvalue,\n\t\t\t},\n\t\t\trefSeq: this.runtime.deltaManager.lastSequenceNumber,\n\t\t};\n\n\t\treturn this.newAckBasedPromise<boolean>((resolve) => {\n\t\t\t// Send the resolve function as the localOpMetadata. This will be provided back to us when the\n\t\t\t// op is ack'd.\n\t\t\tthis.submitLocalMessage(message, resolve);\n\t\t\t// If we fail due to runtime being disposed, it's better to return false then unhandled exception.\n\t\t}).catch((error) => false);\n\t}\n\n\t/**\n\t * Returns the most recent local value of a register.\n\t * @param key - The key to read\n\t * @param readPolicy - The ReadPolicy to apply. Defaults to Atomic.\n\t */\n\tpublic read(key: string, readPolicy: ReadPolicy = ReadPolicy.Atomic): T | undefined {\n\t\tif (readPolicy === ReadPolicy.Atomic) {\n\t\t\treturn this.readAtomic(key);\n\t\t}\n\n\t\tconst versions = this.readVersions(key);\n\n\t\tif (versions !== undefined) {\n\t\t\t// We don't support deletion. So there should be at least one value.\n\t\t\tassert(versions.length > 0, 0x06c /* \"Value should be undefined or non-empty\" */);\n\n\t\t\treturn versions[versions.length - 1];\n\t\t}\n\t}\n\n\tpublic readVersions(key: string): T[] | undefined {\n\t\tconst data = this.data.get(key);\n\t\treturn data?.versions.map((element: ILocalRegister<T>) => element.value.value);\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [...this.data.keys()];\n\t}\n\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst dataObj: { [key: string]: ILocalData<T> } = {};\n\t\tthis.data.forEach((v, k) => {\n\t\t\tdataObj[k] = v;\n\t\t});\n\n\t\treturn createSingleBlobSummary(snapshotFileName, this.stringify(dataObj, serializer));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst blob = await storage.readBlob(snapshotFileName);\n\t\tconst header = bufferToString(blob, \"utf8\");\n\t\tconst dataObj = this.parse(header, this.serializer);\n\n\t\tfor (const key of Object.keys(dataObj)) {\n\t\t\tassert(\n\t\t\t\tdataObj[key].atomic?.value.type !== \"Shared\",\n\t\t\t\t0x06d /* \"SharedObjects contained in ConsensusRegisterCollection can no longer be deserialized as of 0.17\" */,\n\t\t\t);\n\n\t\t\tthis.data.set(key, dataObj[key]);\n\t\t}\n\t}\n\n\tprotected onDisconnect() {}\n\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t) {\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tconst op = message.contents as IIncomingRegisterOperation<T>;\n\t\t\tswitch (op.type) {\n\t\t\t\tcase \"write\": {\n\t\t\t\t\t// backward compatibility: File at rest written with runtime <= 0.13 do not have refSeq\n\t\t\t\t\t// when the refSeq property didn't exist\n\t\t\t\t\tif (op.refSeq === undefined) {\n\t\t\t\t\t\top.refSeq = message.referenceSequenceNumber;\n\t\t\t\t\t}\n\t\t\t\t\t// Message can be delivered with delay - e.g. resubmitted on reconnect.\n\t\t\t\t\t// Use the refSeq from when the op was created, not when it was transmitted\n\t\t\t\t\tconst refSeqWhenCreated = op.refSeq;\n\t\t\t\t\tassert(\n\t\t\t\t\t\trefSeqWhenCreated <= message.referenceSequenceNumber,\n\t\t\t\t\t\t0x06e /* \"Message's reference sequence number < op's reference sequence number!\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst value = incomingOpMatchesPlainFormat<T>(op)\n\t\t\t\t\t\t? op.value.value\n\t\t\t\t\t\t: (this.parse(op.serializedValue, this.serializer) as T);\n\t\t\t\t\tconst winner = this.processInboundWrite(\n\t\t\t\t\t\top.key,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\trefSeqWhenCreated,\n\t\t\t\t\t\tmessage.sequenceNumber,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t);\n\t\t\t\t\tif (local) {\n\t\t\t\t\t\t// Resolve the pending promise for this operation now that we have received an ack for it.\n\t\t\t\t\t\tconst resolve = localOpMetadata as PendingResolve;\n\t\t\t\t\t\tresolve(winner);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(op.type);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readAtomic(key: string): T | undefined {\n\t\tconst data = this.data.get(key);\n\t\treturn data?.atomic.value.value;\n\t}\n\n\t/**\n\t * Process an inbound write op\n\t * @param key - Key that was written to\n\t * @param value - Incoming value\n\t * @param refSeq - RefSeq at the time of write on the remote client\n\t * @param sequenceNumber - Sequence Number of this write op\n\t * @param local - Did this write originate on this client\n\t */\n\tprivate processInboundWrite(\n\t\tkey: string,\n\t\tvalue: T,\n\t\trefSeq: number,\n\t\tsequenceNumber: number,\n\t\tlocal: boolean,\n\t): boolean {\n\t\tlet data = this.data.get(key);\n\t\t// Atomic update if it's a new register or the write was not concurrent,\n\t\t// meaning our state was known to the remote client at the time of write\n\t\tconst winner = data === undefined || refSeq >= data.atomic.sequenceNumber;\n\t\tif (winner) {\n\t\t\tconst atomicUpdate = newLocalRegister<T>(sequenceNumber, value);\n\t\t\tif (data === undefined) {\n\t\t\t\tdata = {\n\t\t\t\t\tatomic: atomicUpdate,\n\t\t\t\t\tversions: [], // we'll update versions next, leave it empty for now\n\t\t\t\t};\n\t\t\t\tthis.data.set(key, data);\n\t\t\t} else {\n\t\t\t\tdata.atomic = atomicUpdate;\n\t\t\t}\n\t\t} else {\n\t\t\tassert(!!data, 0x06f /* \"data missing for non-atomic inbound update!\" */);\n\t\t}\n\n\t\t// Remove versions that were known to the remote client at the time of write\n\t\twhile (data.versions.length > 0 && refSeq >= data.versions[0].sequenceNumber) {\n\t\t\tdata.versions.shift();\n\t\t}\n\n\t\tconst versionUpdate = newLocalRegister<T>(sequenceNumber, value);\n\n\t\t// Asserts for data integrity\n\t\tif (!this.isAttached()) {\n\t\t\tassert(\n\t\t\t\trefSeq === 0 && sequenceNumber === 0,\n\t\t\t\t0x070 /* \"sequence numbers are expected to be 0 when unattached\" */,\n\t\t\t);\n\t\t} else if (data.versions.length > 0) {\n\t\t\tassert(\n\t\t\t\t// seqNum should always be increasing, except for the case of grouped batches (seqNum will be the same)\n\t\t\t\tsequenceNumber >= data.versions[data.versions.length - 1].sequenceNumber,\n\t\t\t\t0x071 /* \"Versions should naturally be ordered by sequenceNumber\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Push the new element.\n\t\tdata.versions.push(versionUpdate);\n\n\t\t// Raise events at the end, to avoid reentrancy issues\n\t\tif (winner) {\n\t\t\tthis.emit(\"atomicChanged\", key, value, local);\n\t\t}\n\t\tthis.emit(\"versionChanged\", key, value, local);\n\n\t\treturn winner;\n\t}\n\n\tprivate stringify(value: any, serializer: IFluidSerializer): string {\n\t\treturn serializer.stringify(value, this.handle);\n\t}\n\n\tprivate parse(content: string, serializer: IFluidSerializer): any {\n\t\treturn serializer.parse(content);\n\t}\n\n\tprotected applyStashedOp(): void {\n\t\t// empty implementation\n\t}\n}\n"]}
|
package/lib/{consensusRegisterCollectionFactory.d.mts → consensusRegisterCollectionFactory.d.ts}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices } from "@fluidframework/datastore-definitions";
|
|
6
|
-
import { IConsensusRegisterCollection, IConsensusRegisterCollectionFactory } from "./interfaces.
|
|
6
|
+
import { IConsensusRegisterCollection, IConsensusRegisterCollectionFactory } from "./interfaces.js";
|
|
7
7
|
/**
|
|
8
8
|
* The factory that defines the consensus queue.
|
|
9
9
|
* @alpha
|
|
@@ -19,4 +19,4 @@ export declare class ConsensusRegisterCollectionFactory implements IConsensusReg
|
|
|
19
19
|
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IConsensusRegisterCollection>;
|
|
20
20
|
create(document: IFluidDataStoreRuntime, id: string): IConsensusRegisterCollection;
|
|
21
21
|
}
|
|
22
|
-
//# sourceMappingURL=consensusRegisterCollectionFactory.d.
|
|
22
|
+
//# sourceMappingURL=consensusRegisterCollectionFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consensusRegisterCollectionFactory.d.ts","sourceRoot":"","sources":["../src/consensusRegisterCollectionFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAGpG;;;GAGG;AACH,qBAAa,kCAAmC,YAAW,mCAAmC;IAC7F,OAAc,IAAI,SAAqE;IAEvF,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,4BAA4B,CAAC;IAMjC,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,4BAA4B;CASzF"}
|
package/lib/{consensusRegisterCollectionFactory.mjs → consensusRegisterCollectionFactory.js}
RENAMED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ConsensusRegisterCollection } from "./consensusRegisterCollection.
|
|
6
|
-
import { pkgVersion } from "./packageVersion.
|
|
5
|
+
import { ConsensusRegisterCollection } from "./consensusRegisterCollection.js";
|
|
6
|
+
import { pkgVersion } from "./packageVersion.js";
|
|
7
7
|
/**
|
|
8
8
|
* The factory that defines the consensus queue.
|
|
9
9
|
* @alpha
|
|
@@ -35,4 +35,4 @@ ConsensusRegisterCollectionFactory.Attributes = {
|
|
|
35
35
|
snapshotFormatVersion: "0.1",
|
|
36
36
|
packageVersion: pkgVersion,
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=consensusRegisterCollectionFactory.
|
|
38
|
+
//# sourceMappingURL=consensusRegisterCollectionFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consensusRegisterCollectionFactory.js","sourceRoot":"","sources":["../src/consensusRegisterCollectionFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,OAAO,kCAAkC;IAS9C,IAAW,IAAI;QACd,OAAO,kCAAkC,CAAC,IAAI,CAAC;IAChD,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,kCAAkC,CAAC,UAAU,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,UAAU,GAAG,IAAI,2BAA2B,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC5E,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,UAAU,GAAG,IAAI,2BAA2B,CACjD,EAAE,EACF,QAAQ,EACR,kCAAkC,CAAC,UAAU,CAC7C,CAAC;QACF,UAAU,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC;IACnB,CAAC;;AAtCa,uCAAI,GAAG,iEAAiE,CAAC;AAEhE,6CAAU,GAAuB;IACvD,IAAI,EAAE,kCAAkC,CAAC,IAAI;IAC7C,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions\";\nimport { ConsensusRegisterCollection } from \"./consensusRegisterCollection.js\";\nimport { IConsensusRegisterCollection, IConsensusRegisterCollectionFactory } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The factory that defines the consensus queue.\n * @alpha\n */\nexport class ConsensusRegisterCollectionFactory implements IConsensusRegisterCollectionFactory {\n\tpublic static Type = \"https://graph.microsoft.com/types/consensus-register-collection\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: ConsensusRegisterCollectionFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type() {\n\t\treturn ConsensusRegisterCollectionFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn ConsensusRegisterCollectionFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<IConsensusRegisterCollection> {\n\t\tconst collection = new ConsensusRegisterCollection(id, runtime, attributes);\n\t\tawait collection.load(services);\n\t\treturn collection;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): IConsensusRegisterCollection {\n\t\tconst collection = new ConsensusRegisterCollection(\n\t\t\tid,\n\t\t\tdocument,\n\t\t\tConsensusRegisterCollectionFactory.Attributes,\n\t\t);\n\t\tcollection.initializeLocal();\n\t\treturn collection;\n\t}\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ConsensusRegisterCollection } from "./consensusRegisterCollection.
|
|
6
|
-
export { ConsensusRegisterCollectionFactory } from "./consensusRegisterCollectionFactory.
|
|
7
|
-
export { IConsensusRegisterCollection, IConsensusRegisterCollectionEvents, IConsensusRegisterCollectionFactory, ReadPolicy, } from "./interfaces.
|
|
8
|
-
//# sourceMappingURL=index.d.
|
|
5
|
+
export { ConsensusRegisterCollection } from "./consensusRegisterCollection.js";
|
|
6
|
+
export { ConsensusRegisterCollectionFactory } from "./consensusRegisterCollectionFactory.js";
|
|
7
|
+
export { IConsensusRegisterCollection, IConsensusRegisterCollectionEvents, IConsensusRegisterCollectionFactory, ReadPolicy, } from "./interfaces.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EACN,4BAA4B,EAC5B,kCAAkC,EAClC,mCAAmC,EACnC,UAAU,GACV,MAAM,iBAAiB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ConsensusRegisterCollection } from "./consensusRegisterCollection.
|
|
6
|
-
export { ConsensusRegisterCollectionFactory } from "./consensusRegisterCollectionFactory.
|
|
7
|
-
export { ReadPolicy, } from "./interfaces.
|
|
8
|
-
//# sourceMappingURL=index.
|
|
5
|
+
export { ConsensusRegisterCollection } from "./consensusRegisterCollection.js";
|
|
6
|
+
export { ConsensusRegisterCollectionFactory } from "./consensusRegisterCollectionFactory.js";
|
|
7
|
+
export { ReadPolicy, } from "./interfaces.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAIN,UAAU,GACV,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConsensusRegisterCollection } from \"./consensusRegisterCollection.js\";\nexport { ConsensusRegisterCollectionFactory } from \"./consensusRegisterCollectionFactory.js\";\nexport {\n\tIConsensusRegisterCollection,\n\tIConsensusRegisterCollectionEvents,\n\tIConsensusRegisterCollectionFactory,\n\tReadPolicy,\n} from \"./interfaces.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAExF;;;;;;GAMG;AACH,MAAM,WAAW,mCAAoC,SAAQ,eA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+CAAM,CAAA;IAEN,2DAA2D;IAC3D,yCAAG,CAAA;AACJ,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelAttributes,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\n\n/**\n * Consensus Register Collection channel factory interface\n *\n * Extends the base IChannelFactory to return a more definite type of IConsensusRegisterCollection\n * Use for the runtime to create and load distributed data structure by type name of each channel.\n * @alpha\n */\nexport interface IConsensusRegisterCollectionFactory extends IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tload(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<IConsensusRegisterCollection>;\n\n\tcreate(document: IFluidDataStoreRuntime, id: string): IConsensusRegisterCollection;\n}\n\n/**\n * Events emitted by {@link IConsensusRegisterCollection}.\n * @alpha\n */\nexport interface IConsensusRegisterCollectionEvents extends ISharedObjectEvents {\n\t(\n\t\tevent: \"atomicChanged\" | \"versionChanged\",\n\t\tlistener: (key: string, value: any, local: boolean) => void,\n\t);\n}\n\n/**\n * A distributed data structure that holds a set of registers with update\n * versions. On concurrent updates, a register internally stores all possible versions of a value by using reference\n * sequence number of the incoming update.\n *\n * Using all the stored versions, we can then distinguish amongst different read policies. Below are the policies\n * we support:\n *\n * Atomic: Atomicity requires a linearizable register. A linearizable register behaves as if there is only a single\n * copy of the data, and that every operation appears to take effect atomically at one point in time. This definition\n * implies that operations are executed in an well-defined order. On a concurrent update, we perform a compare-and-set\n * operation, where we compare a register sequence number with the incoming reference sequence number.\n * The earliest operation overwriting prior sequence numbers wins since every client reaches to an agreement on\n * the value. So we can safely return the first value.\n *\n * LWW: The last write to a key always wins.\n * @alpha\n */\nexport interface IConsensusRegisterCollection<T = any>\n\textends ISharedObject<IConsensusRegisterCollectionEvents> {\n\t/**\n\t * Attempts to write a register with a value. Returns a promise to indicate the roundtrip completion.\n\t * For a non existent register, it will attempt to create a new register with the specified value.\n\t *\n\t * @returns Promise<true> if write was non-concurrent\n\t */\n\twrite(key: string, value: T): Promise<boolean>;\n\n\t/**\n\t * Retrieves the agreed upon value for the register based on policy. Returns undefined if not present.\n\t */\n\tread(key: string, policy?: ReadPolicy): T | undefined;\n\n\t/**\n\t * Retrives all concurrent versions. Undefined if not present.\n\t */\n\treadVersions(key: string): T[] | undefined;\n\n\t/**\n\t * Returns the keys.\n\t */\n\tkeys(): string[];\n}\n\n/**\n * Read policies used when reading the map value.\n * @alpha\n */\nexport enum ReadPolicy {\n\t// On a concurrent update, returns the first agreed upon value amongst all clients.\n\tAtomic,\n\n\t// Last writer wins. Simply returns the last written value.\n\tLWW,\n}\n"]}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/register-collection";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-rc.
|
|
9
|
-
//# sourceMappingURL=packageVersion.d.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-rc.2.0.1";
|
|
9
|
+
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,wCAAwC,CAAC;AAC7D,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/register-collection";
|
|
8
|
-
export const pkgVersion = "2.0.0-rc.
|
|
9
|
-
//# sourceMappingURL=packageVersion.
|
|
8
|
+
export const pkgVersion = "2.0.0-rc.2.0.1";
|
|
9
|
+
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qCAAqC,CAAC;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/register-collection\";\nexport const pkgVersion = \"2.0.0-rc.2.0.1\";\n"]}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { strict as assert } from "assert";
|
|
6
|
+
import { BlobTreeEntry } from "@fluidframework/driver-utils";
|
|
7
|
+
import { runGCTests } from "@fluid-private/test-dds-utils";
|
|
8
|
+
import { MockContainerRuntimeFactory, MockContainerRuntimeFactoryForReconnection, MockEmptyDeltaConnection, MockFluidDataStoreRuntime, MockStorage, } from "@fluidframework/test-runtime-utils";
|
|
9
|
+
import { ConsensusRegisterCollectionFactory } from "../consensusRegisterCollectionFactory.js";
|
|
10
|
+
function createConnectedCollection(id, runtimeFactory) {
|
|
11
|
+
const dataStoreRuntime = new MockFluidDataStoreRuntime();
|
|
12
|
+
runtimeFactory.createContainerRuntime(dataStoreRuntime);
|
|
13
|
+
const services = {
|
|
14
|
+
deltaConnection: dataStoreRuntime.createDeltaConnection(),
|
|
15
|
+
objectStorage: new MockStorage(),
|
|
16
|
+
};
|
|
17
|
+
const crcFactory = new ConsensusRegisterCollectionFactory();
|
|
18
|
+
const collection = crcFactory.create(dataStoreRuntime, id);
|
|
19
|
+
collection.connect(services);
|
|
20
|
+
return collection;
|
|
21
|
+
}
|
|
22
|
+
function createLocalCollection(id) {
|
|
23
|
+
const factory = new ConsensusRegisterCollectionFactory();
|
|
24
|
+
return factory.create(new MockFluidDataStoreRuntime(), id);
|
|
25
|
+
}
|
|
26
|
+
function createCollectionForReconnection(id, runtimeFactory) {
|
|
27
|
+
const dataStoreRuntime = new MockFluidDataStoreRuntime();
|
|
28
|
+
const containerRuntime = runtimeFactory.createContainerRuntime(dataStoreRuntime);
|
|
29
|
+
const services = {
|
|
30
|
+
deltaConnection: dataStoreRuntime.createDeltaConnection(),
|
|
31
|
+
objectStorage: new MockStorage(),
|
|
32
|
+
};
|
|
33
|
+
const crcFactory = new ConsensusRegisterCollectionFactory();
|
|
34
|
+
const collection = crcFactory.create(dataStoreRuntime, id);
|
|
35
|
+
collection.connect(services);
|
|
36
|
+
return { collection, containerRuntime };
|
|
37
|
+
}
|
|
38
|
+
describe("ConsensusRegisterCollection", () => {
|
|
39
|
+
describe("Single connected client", () => {
|
|
40
|
+
const collectionId = "consensus-register-collection";
|
|
41
|
+
let crc;
|
|
42
|
+
let containerRuntimeFactory;
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
containerRuntimeFactory = new MockContainerRuntimeFactory();
|
|
45
|
+
crc = createConnectedCollection(collectionId, containerRuntimeFactory);
|
|
46
|
+
});
|
|
47
|
+
async function writeAndProcessMsg(key, value) {
|
|
48
|
+
const waitP = crc.write(key, value);
|
|
49
|
+
containerRuntimeFactory.processAllMessages();
|
|
50
|
+
return waitP;
|
|
51
|
+
}
|
|
52
|
+
describe("API", () => {
|
|
53
|
+
it("Can create a collection", () => {
|
|
54
|
+
assert.ok(crc);
|
|
55
|
+
});
|
|
56
|
+
it("Can add and remove data", async () => {
|
|
57
|
+
assert.strictEqual(crc.read("key1"), undefined);
|
|
58
|
+
const writeResult = await writeAndProcessMsg("key1", "val1");
|
|
59
|
+
assert.strictEqual(crc.read("key1"), "val1");
|
|
60
|
+
assert.strictEqual(writeResult, true, "No concurrency expected");
|
|
61
|
+
});
|
|
62
|
+
it("Can add and remove a handle", async () => {
|
|
63
|
+
assert.strictEqual(crc.read("key1"), undefined);
|
|
64
|
+
const handle = crc.handle;
|
|
65
|
+
if (handle === undefined) {
|
|
66
|
+
assert.fail("Need an actual handle to test this case");
|
|
67
|
+
}
|
|
68
|
+
const writeResult = await writeAndProcessMsg("key1", handle);
|
|
69
|
+
const readValue = crc.read("key1");
|
|
70
|
+
assert.strictEqual(readValue.absolutePath, handle.absolutePath);
|
|
71
|
+
assert.strictEqual(writeResult, true, "No concurrency expected");
|
|
72
|
+
});
|
|
73
|
+
it("Change events emit the right key/value", async () => {
|
|
74
|
+
crc.on("atomicChanged", (key, value, local) => {
|
|
75
|
+
assert.strictEqual(key, "key1", "atomicChanged event emitted the wrong key");
|
|
76
|
+
assert.strictEqual(value, "val1", "atomicChanged event emitted the wrong value");
|
|
77
|
+
});
|
|
78
|
+
crc.on("versionChanged", (key, value, local) => {
|
|
79
|
+
assert.strictEqual(key, "key1", "versionChanged event emitted the wrong key");
|
|
80
|
+
assert.strictEqual(value, "val1", "versionChanged event emitted the wrong value");
|
|
81
|
+
});
|
|
82
|
+
await writeAndProcessMsg("key1", "val1");
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe("Summary", () => {
|
|
86
|
+
const snapshotFileName = "header";
|
|
87
|
+
const expectedSerialization = JSON.stringify({
|
|
88
|
+
key1: {
|
|
89
|
+
atomic: { sequenceNumber: 1, value: { type: "Plain", value: "val1.1" } },
|
|
90
|
+
versions: [{ sequenceNumber: 1, value: { type: "Plain", value: "val1.1" } }],
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
const legacySharedObjectSerialization = JSON.stringify({
|
|
94
|
+
key1: {
|
|
95
|
+
atomic: { sequenceNumber: 1, value: { type: "Shared", value: "sharedObjId" } },
|
|
96
|
+
versions: [
|
|
97
|
+
{ sequenceNumber: 1, value: { type: "Shared", value: "sharedObjId" } },
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
const buildTree = (serialized) => ({
|
|
102
|
+
entries: [new BlobTreeEntry(snapshotFileName, serialized)],
|
|
103
|
+
});
|
|
104
|
+
it("summarize", async () => {
|
|
105
|
+
await writeAndProcessMsg("key1", "val1.1");
|
|
106
|
+
const summaryTree = crc.getAttachSummary().summary;
|
|
107
|
+
assert(Object.keys(summaryTree.tree).length === 1, "summarize should return a tree with single blob");
|
|
108
|
+
const serialized = summaryTree.tree.header?.content;
|
|
109
|
+
assert(serialized, "summarize should return a tree with blob with contents");
|
|
110
|
+
assert.strictEqual(serialized, expectedSerialization);
|
|
111
|
+
});
|
|
112
|
+
it("load", async () => {
|
|
113
|
+
const tree = buildTree(expectedSerialization);
|
|
114
|
+
const services = {
|
|
115
|
+
deltaConnection: new MockEmptyDeltaConnection(),
|
|
116
|
+
objectStorage: new MockStorage(tree),
|
|
117
|
+
};
|
|
118
|
+
const crcFactory = new ConsensusRegisterCollectionFactory();
|
|
119
|
+
const loadedCrc = await crcFactory.load(new MockFluidDataStoreRuntime(), collectionId, services, ConsensusRegisterCollectionFactory.Attributes);
|
|
120
|
+
assert.strictEqual(loadedCrc.read("key1"), "val1.1");
|
|
121
|
+
});
|
|
122
|
+
it("load with SharedObject not supported", async () => {
|
|
123
|
+
const tree = buildTree(legacySharedObjectSerialization);
|
|
124
|
+
const services = {
|
|
125
|
+
deltaConnection: new MockEmptyDeltaConnection(),
|
|
126
|
+
objectStorage: new MockStorage(tree),
|
|
127
|
+
};
|
|
128
|
+
const crcFactory = new ConsensusRegisterCollectionFactory();
|
|
129
|
+
await assert.rejects(crcFactory.load(new MockFluidDataStoreRuntime(), collectionId, services, ConsensusRegisterCollectionFactory.Attributes), "SharedObjects contained in ConsensusRegisterCollection can no longer be deserialized");
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
describe("Multiple Clients", () => {
|
|
134
|
+
describe("Local state", () => {
|
|
135
|
+
let containerRuntimeFactory;
|
|
136
|
+
let testCollection1;
|
|
137
|
+
let testCollection2;
|
|
138
|
+
beforeEach(() => {
|
|
139
|
+
containerRuntimeFactory = new MockContainerRuntimeFactoryForReconnection();
|
|
140
|
+
testCollection1 = createLocalCollection("collection1");
|
|
141
|
+
testCollection2 = createLocalCollection("collection2");
|
|
142
|
+
});
|
|
143
|
+
it("should not send ops when the collection is not connected", async () => {
|
|
144
|
+
// Add a listener to the second collection. This is used to verify that the written value reaches
|
|
145
|
+
// the remote client.
|
|
146
|
+
let receivedValue = "";
|
|
147
|
+
testCollection2.on("atomicChanged", (key, value) => {
|
|
148
|
+
receivedValue = value;
|
|
149
|
+
});
|
|
150
|
+
// Write to the first register collection.
|
|
151
|
+
const testValue = "testValue";
|
|
152
|
+
const writeP = testCollection1.write("key", testValue);
|
|
153
|
+
// Process the messages.
|
|
154
|
+
containerRuntimeFactory.processAllMessages();
|
|
155
|
+
// Verify that the first collection successfully writes and is the winner.
|
|
156
|
+
const winner = await writeP;
|
|
157
|
+
assert.equal(winner, true, "Write was not successful");
|
|
158
|
+
// Verify that the remote client does not get this write because the DDS is not connected.
|
|
159
|
+
assert.equal(receivedValue, "", "The remote client should not have received the write");
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
describe("Reconnection", () => {
|
|
163
|
+
const testKey = "testKey";
|
|
164
|
+
const testValue = "testValue";
|
|
165
|
+
let receivedKey = "";
|
|
166
|
+
let receivedValue = "";
|
|
167
|
+
let receivedLocalStatus = true;
|
|
168
|
+
let containerRuntimeFactory;
|
|
169
|
+
let containerRuntime1;
|
|
170
|
+
let testCollection1;
|
|
171
|
+
let testCollection2;
|
|
172
|
+
beforeEach(() => {
|
|
173
|
+
containerRuntimeFactory = new MockContainerRuntimeFactoryForReconnection();
|
|
174
|
+
const response1 = createCollectionForReconnection("collection1", containerRuntimeFactory);
|
|
175
|
+
testCollection1 = response1.collection;
|
|
176
|
+
containerRuntime1 = response1.containerRuntime;
|
|
177
|
+
const response2 = createCollectionForReconnection("collection2", containerRuntimeFactory);
|
|
178
|
+
testCollection2 = response2.collection;
|
|
179
|
+
// Add a listener to the second collection. This is used to verify that the written value reaches
|
|
180
|
+
// the remote client.
|
|
181
|
+
testCollection2.on("atomicChanged", (key, value, local) => {
|
|
182
|
+
receivedKey = key;
|
|
183
|
+
receivedValue = value;
|
|
184
|
+
receivedLocalStatus = local;
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
it("can resend unacked ops on reconnection", async () => {
|
|
188
|
+
// Write to the first register collection.
|
|
189
|
+
const writeP = testCollection1.write(testKey, testValue);
|
|
190
|
+
// Disconnect and reconnect the first collection.
|
|
191
|
+
containerRuntime1.connected = false;
|
|
192
|
+
containerRuntime1.connected = true;
|
|
193
|
+
// Process the messages.
|
|
194
|
+
containerRuntimeFactory.processAllMessages();
|
|
195
|
+
// Verify that the first collection successfully writes and is the winner.
|
|
196
|
+
const winner = await writeP;
|
|
197
|
+
assert.equal(winner, true, "Write was not successful");
|
|
198
|
+
// Verify that the remote register collection received the write.
|
|
199
|
+
assert.equal(receivedKey, testKey, "The remote client did not receive the key");
|
|
200
|
+
assert.equal(receivedValue, testValue, "The remote client did not receive the value");
|
|
201
|
+
assert.equal(receivedLocalStatus, false, "The remote client's value should not be local");
|
|
202
|
+
});
|
|
203
|
+
it("can store ops in disconnected state and resend them on reconnection", async () => {
|
|
204
|
+
// Disconnect the first collection.
|
|
205
|
+
containerRuntime1.connected = false;
|
|
206
|
+
// Write to the first register collection.
|
|
207
|
+
const writeP = testCollection1.write(testKey, testValue);
|
|
208
|
+
// Reconnect the first collection.
|
|
209
|
+
containerRuntime1.connected = true;
|
|
210
|
+
// Process the messages.
|
|
211
|
+
containerRuntimeFactory.processAllMessages();
|
|
212
|
+
// Verify that the first collection successfully writes and is the winner.
|
|
213
|
+
const winner = await writeP;
|
|
214
|
+
assert.equal(winner, true, "Write was not successful");
|
|
215
|
+
// Verify that the remote register collection received the write.
|
|
216
|
+
assert.equal(receivedKey, testKey, "The remote client did not receive the key");
|
|
217
|
+
assert.equal(receivedValue, testValue, "The remote client did not receive the value");
|
|
218
|
+
assert.equal(receivedLocalStatus, false, "The remote client's value should not be local");
|
|
219
|
+
});
|
|
220
|
+
afterEach(() => {
|
|
221
|
+
receivedKey = "";
|
|
222
|
+
receivedValue = "";
|
|
223
|
+
receivedLocalStatus = true;
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
describe("Garbage Collection", () => {
|
|
228
|
+
class GCRegisteredCollectionProvider {
|
|
229
|
+
constructor() {
|
|
230
|
+
this.subCollectionCount = 0;
|
|
231
|
+
this._expectedRoutes = [];
|
|
232
|
+
this.containerRuntimeFactory = new MockContainerRuntimeFactory();
|
|
233
|
+
this.collection1 = createConnectedCollection("collection1", this.containerRuntimeFactory);
|
|
234
|
+
this.collection2 = createConnectedCollection("collection2", this.containerRuntimeFactory);
|
|
235
|
+
}
|
|
236
|
+
async writeAndProcessMsg(key, value) {
|
|
237
|
+
const waitP = this.collection1.write(key, value);
|
|
238
|
+
this.containerRuntimeFactory.processAllMessages();
|
|
239
|
+
return waitP;
|
|
240
|
+
}
|
|
241
|
+
get sharedObject() {
|
|
242
|
+
// Return the remote collection because we want to verify its summary data.
|
|
243
|
+
return this.collection2;
|
|
244
|
+
}
|
|
245
|
+
get expectedOutboundRoutes() {
|
|
246
|
+
return this._expectedRoutes;
|
|
247
|
+
}
|
|
248
|
+
async addOutboundRoutes() {
|
|
249
|
+
const subCollectionId = `subCollection-${++this.subCollectionCount}`;
|
|
250
|
+
const subTestCollection = createLocalCollection(subCollectionId);
|
|
251
|
+
await this.writeAndProcessMsg(subCollectionId, subTestCollection.handle);
|
|
252
|
+
this._expectedRoutes.push(subTestCollection.handle.absolutePath);
|
|
253
|
+
}
|
|
254
|
+
async deleteOutboundRoutes() {
|
|
255
|
+
const subCollectionId = `subCollection-${this.subCollectionCount}`;
|
|
256
|
+
const deletedHandle = this.collection1.read(subCollectionId);
|
|
257
|
+
assert(deletedHandle, "Route must be added before deleting");
|
|
258
|
+
// Delete the last handle that was added.
|
|
259
|
+
await this.writeAndProcessMsg(subCollectionId, "nonHandleValue");
|
|
260
|
+
// Remove deleted handle's route from expected routes.
|
|
261
|
+
this._expectedRoutes = this._expectedRoutes.filter((route) => route !== deletedHandle.absolutePath);
|
|
262
|
+
}
|
|
263
|
+
async addNestedHandles() {
|
|
264
|
+
const subCollectionId1 = `subCollection-${++this.subCollectionCount}`;
|
|
265
|
+
const subCollectionId2 = `subCollection-${++this.subCollectionCount}`;
|
|
266
|
+
const subTestCollection1 = createLocalCollection(subCollectionId1);
|
|
267
|
+
const subTestCollection2 = createLocalCollection(subCollectionId2);
|
|
268
|
+
const containingObject = {
|
|
269
|
+
collection1Handle: subTestCollection1.handle,
|
|
270
|
+
nestedObj: {
|
|
271
|
+
collection2Handle: subTestCollection2.handle,
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
await this.writeAndProcessMsg(subCollectionId2, containingObject);
|
|
275
|
+
this._expectedRoutes.push(subTestCollection1.handle.absolutePath, subTestCollection2.handle.absolutePath);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
runGCTests(GCRegisteredCollectionProvider);
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
//# sourceMappingURL=consensusRegisterCollection.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consensusRegisterCollection.spec.js","sourceRoot":"","sources":["../../src/test/consensusRegisterCollection.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,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MAAM,CAAC,YAAY,EACtC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CACtC,CAAC;YACH,CAAC;SACD;QAED,UAAU,CAAC,8BAA8B,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { BlobTreeEntry } from \"@fluidframework/driver-utils\";\nimport { ISummaryBlob, ITree } from \"@fluidframework/protocol-definitions\";\nimport { IGCTestProvider, runGCTests } from \"@fluid-private/test-dds-utils\";\nimport {\n\tMockContainerRuntimeFactory,\n\tMockContainerRuntimeFactoryForReconnection,\n\tMockContainerRuntimeForReconnection,\n\tMockEmptyDeltaConnection,\n\tMockFluidDataStoreRuntime,\n\tMockStorage,\n} from \"@fluidframework/test-runtime-utils\";\nimport { ConsensusRegisterCollectionFactory } from \"../consensusRegisterCollectionFactory.js\";\nimport { IConsensusRegisterCollection } from \"../interfaces.js\";\n\nfunction createConnectedCollection(id: string, runtimeFactory: MockContainerRuntimeFactory) {\n\tconst dataStoreRuntime = new MockFluidDataStoreRuntime();\n\truntimeFactory.createContainerRuntime(dataStoreRuntime);\n\tconst services = {\n\t\tdeltaConnection: dataStoreRuntime.createDeltaConnection(),\n\t\tobjectStorage: new MockStorage(),\n\t};\n\n\tconst crcFactory = new ConsensusRegisterCollectionFactory();\n\tconst collection = crcFactory.create(dataStoreRuntime, id);\n\tcollection.connect(services);\n\treturn collection;\n}\n\nfunction createLocalCollection(id: string) {\n\tconst factory = new ConsensusRegisterCollectionFactory();\n\treturn factory.create(new MockFluidDataStoreRuntime(), id);\n}\n\nfunction createCollectionForReconnection(\n\tid: string,\n\truntimeFactory: MockContainerRuntimeFactoryForReconnection,\n) {\n\tconst dataStoreRuntime = new MockFluidDataStoreRuntime();\n\tconst containerRuntime = runtimeFactory.createContainerRuntime(dataStoreRuntime);\n\tconst services = {\n\t\tdeltaConnection: dataStoreRuntime.createDeltaConnection(),\n\t\tobjectStorage: new MockStorage(),\n\t};\n\n\tconst crcFactory = new ConsensusRegisterCollectionFactory();\n\tconst collection = crcFactory.create(dataStoreRuntime, id);\n\tcollection.connect(services);\n\treturn { collection, containerRuntime };\n}\n\ndescribe(\"ConsensusRegisterCollection\", () => {\n\tdescribe(\"Single connected client\", () => {\n\t\tconst collectionId = \"consensus-register-collection\";\n\t\tlet crc: IConsensusRegisterCollection;\n\t\tlet containerRuntimeFactory: MockContainerRuntimeFactory;\n\n\t\tbeforeEach(() => {\n\t\t\tcontainerRuntimeFactory = new MockContainerRuntimeFactory();\n\t\t\tcrc = createConnectedCollection(collectionId, containerRuntimeFactory);\n\t\t});\n\n\t\tasync function writeAndProcessMsg(key: string, value: any) {\n\t\t\tconst waitP = crc.write(key, value);\n\t\t\tcontainerRuntimeFactory.processAllMessages();\n\t\t\treturn waitP;\n\t\t}\n\n\t\tdescribe(\"API\", () => {\n\t\t\tit(\"Can create a collection\", () => {\n\t\t\t\tassert.ok(crc);\n\t\t\t});\n\n\t\t\tit(\"Can add and remove data\", async () => {\n\t\t\t\tassert.strictEqual(crc.read(\"key1\"), undefined);\n\t\t\t\tconst writeResult = await writeAndProcessMsg(\"key1\", \"val1\");\n\t\t\t\tassert.strictEqual(crc.read(\"key1\"), \"val1\");\n\t\t\t\tassert.strictEqual(writeResult, true, \"No concurrency expected\");\n\t\t\t});\n\n\t\t\tit(\"Can add and remove a handle\", async () => {\n\t\t\t\tassert.strictEqual(crc.read(\"key1\"), undefined);\n\t\t\t\tconst handle = crc.handle;\n\t\t\t\tif (handle === undefined) {\n\t\t\t\t\tassert.fail(\"Need an actual handle to test this case\");\n\t\t\t\t}\n\t\t\t\tconst writeResult = await writeAndProcessMsg(\"key1\", handle);\n\t\t\t\tconst readValue = crc.read(\"key1\");\n\t\t\t\tassert.strictEqual(readValue.absolutePath, handle.absolutePath);\n\t\t\t\tassert.strictEqual(writeResult, true, \"No concurrency expected\");\n\t\t\t});\n\n\t\t\tit(\"Change events emit the right key/value\", async () => {\n\t\t\t\tcrc.on(\"atomicChanged\", (key: string, value: any, local: boolean) => {\n\t\t\t\t\tassert.strictEqual(key, \"key1\", \"atomicChanged event emitted the wrong key\");\n\t\t\t\t\tassert.strictEqual(\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\"val1\",\n\t\t\t\t\t\t\"atomicChanged event emitted the wrong value\",\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tcrc.on(\"versionChanged\", (key: string, value: any, local: boolean) => {\n\t\t\t\t\tassert.strictEqual(key, \"key1\", \"versionChanged event emitted the wrong key\");\n\t\t\t\t\tassert.strictEqual(\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\"val1\",\n\t\t\t\t\t\t\"versionChanged event emitted the wrong value\",\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tawait writeAndProcessMsg(\"key1\", \"val1\");\n\t\t\t});\n\t\t});\n\n\t\tdescribe(\"Summary\", () => {\n\t\t\tconst snapshotFileName = \"header\";\n\t\t\tconst expectedSerialization = JSON.stringify({\n\t\t\t\tkey1: {\n\t\t\t\t\tatomic: { sequenceNumber: 1, value: { type: \"Plain\", value: \"val1.1\" } },\n\t\t\t\t\tversions: [{ sequenceNumber: 1, value: { type: \"Plain\", value: \"val1.1\" } }],\n\t\t\t\t},\n\t\t\t});\n\t\t\tconst legacySharedObjectSerialization = JSON.stringify({\n\t\t\t\tkey1: {\n\t\t\t\t\tatomic: { sequenceNumber: 1, value: { type: \"Shared\", value: \"sharedObjId\" } },\n\t\t\t\t\tversions: [\n\t\t\t\t\t\t{ sequenceNumber: 1, value: { type: \"Shared\", value: \"sharedObjId\" } },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t});\n\t\t\tconst buildTree = (serialized: string) => ({\n\t\t\t\tentries: [new BlobTreeEntry(snapshotFileName, serialized)],\n\t\t\t});\n\n\t\t\tit(\"summarize\", async () => {\n\t\t\t\tawait writeAndProcessMsg(\"key1\", \"val1.1\");\n\t\t\t\tconst summaryTree = crc.getAttachSummary().summary;\n\t\t\t\tassert(\n\t\t\t\t\tObject.keys(summaryTree.tree).length === 1,\n\t\t\t\t\t\"summarize should return a tree with single blob\",\n\t\t\t\t);\n\t\t\t\tconst serialized = (summaryTree.tree.header as ISummaryBlob)?.content as string;\n\t\t\t\tassert(serialized, \"summarize should return a tree with blob with contents\");\n\t\t\t\tassert.strictEqual(serialized, expectedSerialization);\n\t\t\t});\n\n\t\t\tit(\"load\", async () => {\n\t\t\t\tconst tree: ITree = buildTree(expectedSerialization);\n\t\t\t\tconst services = {\n\t\t\t\t\tdeltaConnection: new MockEmptyDeltaConnection(),\n\t\t\t\t\tobjectStorage: new MockStorage(tree),\n\t\t\t\t};\n\t\t\t\tconst crcFactory = new ConsensusRegisterCollectionFactory();\n\t\t\t\tconst loadedCrc = await crcFactory.load(\n\t\t\t\t\tnew MockFluidDataStoreRuntime(),\n\t\t\t\t\tcollectionId,\n\t\t\t\t\tservices,\n\t\t\t\t\tConsensusRegisterCollectionFactory.Attributes,\n\t\t\t\t);\n\t\t\t\tassert.strictEqual(loadedCrc.read(\"key1\"), \"val1.1\");\n\t\t\t});\n\n\t\t\tit(\"load with SharedObject not supported\", async () => {\n\t\t\t\tconst tree: ITree = buildTree(legacySharedObjectSerialization);\n\t\t\t\tconst services = {\n\t\t\t\t\tdeltaConnection: new MockEmptyDeltaConnection(),\n\t\t\t\t\tobjectStorage: new MockStorage(tree),\n\t\t\t\t};\n\t\t\t\tconst crcFactory = new ConsensusRegisterCollectionFactory();\n\t\t\t\tawait assert.rejects(\n\t\t\t\t\tcrcFactory.load(\n\t\t\t\t\t\tnew MockFluidDataStoreRuntime(),\n\t\t\t\t\t\tcollectionId,\n\t\t\t\t\t\tservices,\n\t\t\t\t\t\tConsensusRegisterCollectionFactory.Attributes,\n\t\t\t\t\t),\n\t\t\t\t\t\"SharedObjects contained in ConsensusRegisterCollection can no longer be deserialized\",\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t});\n\n\tdescribe(\"Multiple Clients\", () => {\n\t\tdescribe(\"Local state\", () => {\n\t\t\tlet containerRuntimeFactory: MockContainerRuntimeFactory;\n\t\t\tlet testCollection1: IConsensusRegisterCollection;\n\t\t\tlet testCollection2: IConsensusRegisterCollection;\n\n\t\t\tbeforeEach(() => {\n\t\t\t\tcontainerRuntimeFactory = new MockContainerRuntimeFactoryForReconnection();\n\t\t\t\ttestCollection1 = createLocalCollection(\"collection1\");\n\t\t\t\ttestCollection2 = createLocalCollection(\"collection2\");\n\t\t\t});\n\n\t\t\tit(\"should not send ops when the collection is not connected\", async () => {\n\t\t\t\t// Add a listener to the second collection. This is used to verify that the written value reaches\n\t\t\t\t// the remote client.\n\t\t\t\tlet receivedValue: string = \"\";\n\t\t\t\ttestCollection2.on(\"atomicChanged\", (key: string, value: string) => {\n\t\t\t\t\treceivedValue = value;\n\t\t\t\t});\n\n\t\t\t\t// Write to the first register collection.\n\t\t\t\tconst testValue = \"testValue\";\n\t\t\t\tconst writeP = testCollection1.write(\"key\", testValue);\n\n\t\t\t\t// Process the messages.\n\t\t\t\tcontainerRuntimeFactory.processAllMessages();\n\n\t\t\t\t// Verify that the first collection successfully writes and is the winner.\n\t\t\t\tconst winner = await writeP;\n\t\t\t\tassert.equal(winner, true, \"Write was not successful\");\n\n\t\t\t\t// Verify that the remote client does not get this write because the DDS is not connected.\n\t\t\t\tassert.equal(\n\t\t\t\t\treceivedValue,\n\t\t\t\t\t\"\",\n\t\t\t\t\t\"The remote client should not have received the write\",\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\n\t\tdescribe(\"Reconnection\", () => {\n\t\t\tconst testKey: string = \"testKey\";\n\t\t\tconst testValue: string = \"testValue\";\n\t\t\tlet receivedKey: string = \"\";\n\t\t\tlet receivedValue: string = \"\";\n\t\t\tlet receivedLocalStatus: boolean = true;\n\n\t\t\tlet containerRuntimeFactory: MockContainerRuntimeFactoryForReconnection;\n\t\t\tlet containerRuntime1: MockContainerRuntimeForReconnection;\n\t\t\tlet testCollection1: IConsensusRegisterCollection;\n\t\t\tlet testCollection2: IConsensusRegisterCollection;\n\n\t\t\tbeforeEach(() => {\n\t\t\t\tcontainerRuntimeFactory = new MockContainerRuntimeFactoryForReconnection();\n\t\t\t\tconst response1 = createCollectionForReconnection(\n\t\t\t\t\t\"collection1\",\n\t\t\t\t\tcontainerRuntimeFactory,\n\t\t\t\t);\n\t\t\t\ttestCollection1 = response1.collection;\n\t\t\t\tcontainerRuntime1 = response1.containerRuntime;\n\n\t\t\t\tconst response2 = createCollectionForReconnection(\n\t\t\t\t\t\"collection2\",\n\t\t\t\t\tcontainerRuntimeFactory,\n\t\t\t\t);\n\t\t\t\ttestCollection2 = response2.collection;\n\n\t\t\t\t// Add a listener to the second collection. This is used to verify that the written value reaches\n\t\t\t\t// the remote client.\n\t\t\t\ttestCollection2.on(\n\t\t\t\t\t\"atomicChanged\",\n\t\t\t\t\t(key: string, value: string, local: boolean) => {\n\t\t\t\t\t\treceivedKey = key;\n\t\t\t\t\t\treceivedValue = value;\n\t\t\t\t\t\treceivedLocalStatus = local;\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tit(\"can resend unacked ops on reconnection\", async () => {\n\t\t\t\t// Write to the first register collection.\n\t\t\t\tconst writeP = testCollection1.write(testKey, testValue);\n\n\t\t\t\t// Disconnect and reconnect the first collection.\n\t\t\t\tcontainerRuntime1.connected = false;\n\t\t\t\tcontainerRuntime1.connected = true;\n\n\t\t\t\t// Process the messages.\n\t\t\t\tcontainerRuntimeFactory.processAllMessages();\n\n\t\t\t\t// Verify that the first collection successfully writes and is the winner.\n\t\t\t\tconst winner = await writeP;\n\t\t\t\tassert.equal(winner, true, \"Write was not successful\");\n\n\t\t\t\t// Verify that the remote register collection received the write.\n\t\t\t\tassert.equal(receivedKey, testKey, \"The remote client did not receive the key\");\n\t\t\t\tassert.equal(\n\t\t\t\t\treceivedValue,\n\t\t\t\t\ttestValue,\n\t\t\t\t\t\"The remote client did not receive the value\",\n\t\t\t\t);\n\t\t\t\tassert.equal(\n\t\t\t\t\treceivedLocalStatus,\n\t\t\t\t\tfalse,\n\t\t\t\t\t\"The remote client's value should not be local\",\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tit(\"can store ops in disconnected state and resend them on reconnection\", async () => {\n\t\t\t\t// Disconnect the first collection.\n\t\t\t\tcontainerRuntime1.connected = false;\n\n\t\t\t\t// Write to the first register collection.\n\t\t\t\tconst writeP = testCollection1.write(testKey, testValue);\n\n\t\t\t\t// Reconnect the first collection.\n\t\t\t\tcontainerRuntime1.connected = true;\n\n\t\t\t\t// Process the messages.\n\t\t\t\tcontainerRuntimeFactory.processAllMessages();\n\n\t\t\t\t// Verify that the first collection successfully writes and is the winner.\n\t\t\t\tconst winner = await writeP;\n\t\t\t\tassert.equal(winner, true, \"Write was not successful\");\n\n\t\t\t\t// Verify that the remote register collection received the write.\n\t\t\t\tassert.equal(receivedKey, testKey, \"The remote client did not receive the key\");\n\t\t\t\tassert.equal(\n\t\t\t\t\treceivedValue,\n\t\t\t\t\ttestValue,\n\t\t\t\t\t\"The remote client did not receive the value\",\n\t\t\t\t);\n\t\t\t\tassert.equal(\n\t\t\t\t\treceivedLocalStatus,\n\t\t\t\t\tfalse,\n\t\t\t\t\t\"The remote client's value should not be local\",\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tafterEach(() => {\n\t\t\t\treceivedKey = \"\";\n\t\t\t\treceivedValue = \"\";\n\t\t\t\treceivedLocalStatus = true;\n\t\t\t});\n\t\t});\n\t});\n\n\tdescribe(\"Garbage Collection\", () => {\n\t\tclass GCRegisteredCollectionProvider implements IGCTestProvider {\n\t\t\tprivate subCollectionCount = 0;\n\t\t\tprivate _expectedRoutes: string[] = [];\n\t\t\tprivate readonly collection1: IConsensusRegisterCollection;\n\t\t\tprivate readonly collection2: IConsensusRegisterCollection;\n\t\t\tprivate readonly containerRuntimeFactory: MockContainerRuntimeFactory;\n\n\t\t\tconstructor() {\n\t\t\t\tthis.containerRuntimeFactory = new MockContainerRuntimeFactory();\n\t\t\t\tthis.collection1 = createConnectedCollection(\n\t\t\t\t\t\"collection1\",\n\t\t\t\t\tthis.containerRuntimeFactory,\n\t\t\t\t);\n\t\t\t\tthis.collection2 = createConnectedCollection(\n\t\t\t\t\t\"collection2\",\n\t\t\t\t\tthis.containerRuntimeFactory,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tprivate async writeAndProcessMsg(key: string, value: any) {\n\t\t\t\tconst waitP = this.collection1.write(key, value);\n\t\t\t\tthis.containerRuntimeFactory.processAllMessages();\n\t\t\t\treturn waitP;\n\t\t\t}\n\n\t\t\tpublic get sharedObject() {\n\t\t\t\t// Return the remote collection because we want to verify its summary data.\n\t\t\t\treturn this.collection2;\n\t\t\t}\n\n\t\t\tpublic get expectedOutboundRoutes() {\n\t\t\t\treturn this._expectedRoutes;\n\t\t\t}\n\n\t\t\tpublic async addOutboundRoutes() {\n\t\t\t\tconst subCollectionId = `subCollection-${++this.subCollectionCount}`;\n\t\t\t\tconst subTestCollection = createLocalCollection(subCollectionId);\n\t\t\t\tawait this.writeAndProcessMsg(subCollectionId, subTestCollection.handle);\n\t\t\t\tthis._expectedRoutes.push(subTestCollection.handle.absolutePath);\n\t\t\t}\n\n\t\t\tpublic async deleteOutboundRoutes() {\n\t\t\t\tconst subCollectionId = `subCollection-${this.subCollectionCount}`;\n\t\t\t\tconst deletedHandle = this.collection1.read(subCollectionId) as IFluidHandle;\n\t\t\t\tassert(deletedHandle, \"Route must be added before deleting\");\n\n\t\t\t\t// Delete the last handle that was added.\n\t\t\t\tawait this.writeAndProcessMsg(subCollectionId, \"nonHandleValue\");\n\t\t\t\t// Remove deleted handle's route from expected routes.\n\t\t\t\tthis._expectedRoutes = this._expectedRoutes.filter(\n\t\t\t\t\t(route) => route !== deletedHandle.absolutePath,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tpublic async addNestedHandles() {\n\t\t\t\tconst subCollectionId1 = `subCollection-${++this.subCollectionCount}`;\n\t\t\t\tconst subCollectionId2 = `subCollection-${++this.subCollectionCount}`;\n\t\t\t\tconst subTestCollection1 = createLocalCollection(subCollectionId1);\n\t\t\t\tconst subTestCollection2 = createLocalCollection(subCollectionId2);\n\t\t\t\tconst containingObject = {\n\t\t\t\t\tcollection1Handle: subTestCollection1.handle,\n\t\t\t\t\tnestedObj: {\n\t\t\t\t\t\tcollection2Handle: subTestCollection2.handle,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tawait this.writeAndProcessMsg(subCollectionId2, containingObject);\n\t\t\t\tthis._expectedRoutes.push(\n\t\t\t\t\tsubTestCollection1.handle.absolutePath,\n\t\t\t\t\tsubTestCollection2.handle.absolutePath,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\trunGCTests(GCRegisteredCollectionProvider);\n\t});\n});\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
use_current_ClassDeclaration_ConsensusRegisterCollection(get_old_ClassDeclaration_ConsensusRegisterCollection());
|
|
2
|
+
use_old_ClassDeclaration_ConsensusRegisterCollection(get_current_ClassDeclaration_ConsensusRegisterCollection());
|
|
3
|
+
use_current_ClassDeclaration_ConsensusRegisterCollectionFactory(get_old_ClassDeclaration_ConsensusRegisterCollectionFactory());
|
|
4
|
+
use_old_ClassDeclaration_ConsensusRegisterCollectionFactory(get_current_ClassDeclaration_ConsensusRegisterCollectionFactory());
|
|
5
|
+
use_current_InterfaceDeclaration_IConsensusRegisterCollection(get_old_InterfaceDeclaration_IConsensusRegisterCollection());
|
|
6
|
+
use_old_InterfaceDeclaration_IConsensusRegisterCollection(get_current_InterfaceDeclaration_IConsensusRegisterCollection());
|
|
7
|
+
use_current_InterfaceDeclaration_IConsensusRegisterCollectionEvents(get_old_InterfaceDeclaration_IConsensusRegisterCollectionEvents());
|
|
8
|
+
use_old_InterfaceDeclaration_IConsensusRegisterCollectionEvents(get_current_InterfaceDeclaration_IConsensusRegisterCollectionEvents());
|
|
9
|
+
use_current_InterfaceDeclaration_IConsensusRegisterCollectionFactory(get_old_InterfaceDeclaration_IConsensusRegisterCollectionFactory());
|
|
10
|
+
use_old_InterfaceDeclaration_IConsensusRegisterCollectionFactory(get_current_InterfaceDeclaration_IConsensusRegisterCollectionFactory());
|
|
11
|
+
use_current_EnumDeclaration_ReadPolicy(get_old_EnumDeclaration_ReadPolicy());
|
|
12
|
+
use_old_EnumDeclaration_ReadPolicy(get_current_EnumDeclaration_ReadPolicy());
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=validateRegisterCollectionPrevious.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateRegisterCollectionPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateRegisterCollectionPrevious.generated.ts"],"names":[],"mappings":"AAgCA,wDAAwD,CACpD,oDAAoD,EAAE,CAAC,CAAC;AAW5D,oDAAoD,CAChD,wDAAwD,EAAE,CAAC,CAAC;AAWhE,+DAA+D,CAC3D,2DAA2D,EAAE,CAAC,CAAC;AAWnE,2DAA2D,CACvD,+DAA+D,EAAE,CAAC,CAAC;AAWvE,6DAA6D,CACzD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,yDAAyD,CACrD,6DAA6D,EAAE,CAAC,CAAC;AAWrE,mEAAmE,CAC/D,+DAA+D,EAAE,CAAC,CAAC;AAWvE,+DAA+D,CAC3D,mEAAmE,EAAE,CAAC,CAAC;AAW3E,oEAAoE,CAChE,gEAAgE,EAAE,CAAC,CAAC;AAWxE,gEAAgE,CAC5D,oEAAoE,EAAE,CAAC,CAAC;AAW5E,sCAAsC,CAClC,kCAAkC,EAAE,CAAC,CAAC;AAW1C,kCAAkC,CAC9B,sCAAsC,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/register-collection-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ConsensusRegisterCollection\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ConsensusRegisterCollection():\n TypeOnly<old.ConsensusRegisterCollection<any>>;\ndeclare function use_current_ClassDeclaration_ConsensusRegisterCollection(\n use: TypeOnly<current.ConsensusRegisterCollection<any>>): void;\nuse_current_ClassDeclaration_ConsensusRegisterCollection(\n get_old_ClassDeclaration_ConsensusRegisterCollection());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ConsensusRegisterCollection\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ConsensusRegisterCollection():\n TypeOnly<current.ConsensusRegisterCollection<any>>;\ndeclare function use_old_ClassDeclaration_ConsensusRegisterCollection(\n use: TypeOnly<old.ConsensusRegisterCollection<any>>): void;\nuse_old_ClassDeclaration_ConsensusRegisterCollection(\n get_current_ClassDeclaration_ConsensusRegisterCollection());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ConsensusRegisterCollectionFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ConsensusRegisterCollectionFactory():\n TypeOnly<old.ConsensusRegisterCollectionFactory>;\ndeclare function use_current_ClassDeclaration_ConsensusRegisterCollectionFactory(\n use: TypeOnly<current.ConsensusRegisterCollectionFactory>): void;\nuse_current_ClassDeclaration_ConsensusRegisterCollectionFactory(\n get_old_ClassDeclaration_ConsensusRegisterCollectionFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ConsensusRegisterCollectionFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ConsensusRegisterCollectionFactory():\n TypeOnly<current.ConsensusRegisterCollectionFactory>;\ndeclare function use_old_ClassDeclaration_ConsensusRegisterCollectionFactory(\n use: TypeOnly<old.ConsensusRegisterCollectionFactory>): void;\nuse_old_ClassDeclaration_ConsensusRegisterCollectionFactory(\n get_current_ClassDeclaration_ConsensusRegisterCollectionFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IConsensusRegisterCollection\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IConsensusRegisterCollection():\n TypeOnly<old.IConsensusRegisterCollection>;\ndeclare function use_current_InterfaceDeclaration_IConsensusRegisterCollection(\n use: TypeOnly<current.IConsensusRegisterCollection>): void;\nuse_current_InterfaceDeclaration_IConsensusRegisterCollection(\n get_old_InterfaceDeclaration_IConsensusRegisterCollection());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IConsensusRegisterCollection\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IConsensusRegisterCollection():\n TypeOnly<current.IConsensusRegisterCollection>;\ndeclare function use_old_InterfaceDeclaration_IConsensusRegisterCollection(\n use: TypeOnly<old.IConsensusRegisterCollection>): void;\nuse_old_InterfaceDeclaration_IConsensusRegisterCollection(\n get_current_InterfaceDeclaration_IConsensusRegisterCollection());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IConsensusRegisterCollectionEvents\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IConsensusRegisterCollectionEvents():\n TypeOnly<old.IConsensusRegisterCollectionEvents>;\ndeclare function use_current_InterfaceDeclaration_IConsensusRegisterCollectionEvents(\n use: TypeOnly<current.IConsensusRegisterCollectionEvents>): void;\nuse_current_InterfaceDeclaration_IConsensusRegisterCollectionEvents(\n get_old_InterfaceDeclaration_IConsensusRegisterCollectionEvents());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IConsensusRegisterCollectionEvents\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IConsensusRegisterCollectionEvents():\n TypeOnly<current.IConsensusRegisterCollectionEvents>;\ndeclare function use_old_InterfaceDeclaration_IConsensusRegisterCollectionEvents(\n use: TypeOnly<old.IConsensusRegisterCollectionEvents>): void;\nuse_old_InterfaceDeclaration_IConsensusRegisterCollectionEvents(\n get_current_InterfaceDeclaration_IConsensusRegisterCollectionEvents());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IConsensusRegisterCollectionFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IConsensusRegisterCollectionFactory():\n TypeOnly<old.IConsensusRegisterCollectionFactory>;\ndeclare function use_current_InterfaceDeclaration_IConsensusRegisterCollectionFactory(\n use: TypeOnly<current.IConsensusRegisterCollectionFactory>): void;\nuse_current_InterfaceDeclaration_IConsensusRegisterCollectionFactory(\n get_old_InterfaceDeclaration_IConsensusRegisterCollectionFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IConsensusRegisterCollectionFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IConsensusRegisterCollectionFactory():\n TypeOnly<current.IConsensusRegisterCollectionFactory>;\ndeclare function use_old_InterfaceDeclaration_IConsensusRegisterCollectionFactory(\n use: TypeOnly<old.IConsensusRegisterCollectionFactory>): void;\nuse_old_InterfaceDeclaration_IConsensusRegisterCollectionFactory(\n get_current_InterfaceDeclaration_IConsensusRegisterCollectionFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"EnumDeclaration_ReadPolicy\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_EnumDeclaration_ReadPolicy():\n TypeOnly<old.ReadPolicy>;\ndeclare function use_current_EnumDeclaration_ReadPolicy(\n use: TypeOnly<current.ReadPolicy>): void;\nuse_current_EnumDeclaration_ReadPolicy(\n get_old_EnumDeclaration_ReadPolicy());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"EnumDeclaration_ReadPolicy\": {\"backCompat\": false}\n*/\ndeclare function get_current_EnumDeclaration_ReadPolicy():\n TypeOnly<current.ReadPolicy>;\ndeclare function use_old_EnumDeclaration_ReadPolicy(\n use: TypeOnly<old.ReadPolicy>): void;\nuse_old_EnumDeclaration_ReadPolicy(\n get_current_EnumDeclaration_ReadPolicy());\n"]}
|