@fluid-experimental/ot 2.70.0-361248 → 2.70.0-361788
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ot.d.ts +6 -3
- package/dist/ot.d.ts.map +1 -1
- package/dist/ot.js +14 -5
- package/dist/ot.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/ot.d.ts +6 -3
- package/lib/ot.d.ts.map +1 -1
- package/lib/ot.js +14 -5
- package/lib/ot.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +11 -11
- package/src/ot.ts +25 -7
- package/src/packageVersion.ts +1 -1
package/dist/ot.d.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
6
|
-
import {
|
|
7
|
-
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
|
|
6
|
+
import { ISummaryTreeWithStats, type IRuntimeMessageCollection } from "@fluidframework/runtime-definitions/internal";
|
|
8
7
|
import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base/internal";
|
|
9
8
|
/**
|
|
10
9
|
* @internal
|
|
@@ -43,7 +42,11 @@ export declare abstract class SharedOT<TState, TOp> extends SharedObject {
|
|
|
43
42
|
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
|
|
44
43
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
45
44
|
protected onDisconnect(): void;
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}
|
|
47
|
+
*/
|
|
48
|
+
protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void;
|
|
49
|
+
private processMessage;
|
|
47
50
|
protected get state(): TState;
|
|
48
51
|
protected applyStashedOp(): void;
|
|
49
52
|
}
|
package/dist/ot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ot.d.ts","sourceRoot":"","sources":["../src/ot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"ot.d.ts","sourceRoot":"","sources":["../src/ot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,qBAAqB,EACrB,KAAK,yBAAyB,EAG9B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,gBAAgB,EAChB,YAAY,EAEZ,MAAM,6CAA6C,CAAC;AAQrD;;GAEG;AACH,8BAAsB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAE,SAAQ,YAAY;IAC/D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA+B;IAE5D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC,sEAAsE;IACtE,OAAO,CAAC,MAAM,CAAS;IAEvB;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,UAAU,CAAS;gBAG1B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,kBAAkB,EAC9B,YAAY,EAAE,MAAM;IAOrB,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG;IAavB;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,MAAM;IAE5D;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,GAAG;IAE7D,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;cAS5D,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxE,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,yBAAyB,GAAG,IAAI;IAOlF,OAAO,CAAC,cAAc;IAsDtB,SAAS,KAAK,KAAK,WAclB;IAED,SAAS,CAAC,cAAc,IAAI,IAAI;CAGhC"}
|
package/dist/ot.js
CHANGED
|
@@ -49,16 +49,25 @@ class SharedOT extends internal_2.SharedObject {
|
|
|
49
49
|
this.global = this.local = this.serializer.parse(rawContent);
|
|
50
50
|
}
|
|
51
51
|
onDisconnect() { }
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}
|
|
54
|
+
*/
|
|
55
|
+
processMessagesCore(messagesCollection) {
|
|
56
|
+
const { envelope, local, messagesContent } = messagesCollection;
|
|
57
|
+
for (const messageContent of messagesContent) {
|
|
58
|
+
this.processMessage(envelope, messageContent, local);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
processMessage(messageEnvelope, messagesContent, local) {
|
|
53
62
|
// Discard any sequenced ops that are now below the minimum sequence number.
|
|
54
63
|
const minSeq = this.deltaManager.minimumSequenceNumber;
|
|
55
64
|
while (this.sequencedOps[0]?.seq < minSeq) {
|
|
56
65
|
this.sequencedOps.shift();
|
|
57
66
|
}
|
|
58
|
-
let remoteOp =
|
|
59
|
-
const messageSeq =
|
|
60
|
-
const remoteRefSeq =
|
|
61
|
-
const remoteClient =
|
|
67
|
+
let remoteOp = messagesContent.contents;
|
|
68
|
+
const messageSeq = messageEnvelope.sequenceNumber;
|
|
69
|
+
const remoteRefSeq = messageEnvelope.referenceSequenceNumber;
|
|
70
|
+
const remoteClient = messageEnvelope.clientId;
|
|
62
71
|
// Adjust the incoming sequenced op to account for prior sequenced ops that the
|
|
63
72
|
// sender hadn't yet seen at the time they sent the op.
|
|
64
73
|
for (const { op, seq, client } of this.sequencedOps) {
|
package/dist/ot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ot.js","sourceRoot":"","sources":["../src/ot.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,kEAA6D;
|
|
1
|
+
{"version":3,"file":"ot.js","sourceRoot":"","sources":["../src/ot.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,kEAA6D;AAY7D,0EAIqD;AAQrD;;GAEG;AACH,MAAsB,QAAsB,SAAQ,uBAAY;IAyB/D,YACC,EAAU,EACV,OAA+B,EAC/B,UAA8B,EAC9B,YAAoB;QAEpB,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QA9B7C;;;;WAIG;QACc,iBAAY,GAA4B,EAAE,CAAC;QAE5D;;;;WAIG;QACc,eAAU,GAAU,EAAE,CAAC;QAUhC,eAAU,GAAG,KAAK,CAAC;QAU1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC;IACzC,CAAC;IAES,KAAK,CAAC,EAAO;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAE5C,+CAA+C;QAC/C,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,OAAO;QACR,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzB,IAAI,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C;QACF,CAAC;IACF,CAAC;IAED,IAAc,KAAK;QAClB,qFAAqF;QACrF,sCAAsC;QACtC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YAEzB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC7C,CAAC;YAED,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACzB,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AA/JD,4BA+JC","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 } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tISummaryTreeWithStats,\n\ttype IRuntimeMessageCollection,\n\ttype IRuntimeMessagesContent,\n\ttype ISequencedMessageEnvelope,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tIFluidSerializer,\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\ninterface ISequencedOpInfo<TOp> {\n\tclient: string;\n\tseq: number;\n\top: TOp;\n}\n\n/**\n * @internal\n */\nexport abstract class SharedOT<TState, TOp> extends SharedObject {\n\t/**\n\t * Queue of sequenced ops that are above minSeq. Used by 'processCore' to\n\t * adjust incoming ops to account for prior ops that the sender didn't know about\n\t * at the time they submitted their op.\n\t */\n\tprivate readonly sequencedOps: ISequencedOpInfo<TOp>[] = [];\n\n\t/**\n\t * Queue of local pending ops that have not yet been ACKed by the service. Used\n\t * to lazily rebuild the \"local\" state cache when it is invalidated by interleaved\n\t * remote ops.\n\t */\n\tprivate readonly pendingOps: TOp[] = [];\n\n\t/** The \"global\" state is the result of applying all sequenced ops. */\n\tprivate global: TState;\n\n\t/**\n\t * Lazily cached result of optimistically applying pendingOps on top of the current\n\t * \"global\" state.\n\t */\n\tprivate local: TState;\n\tprivate localDirty = false;\n\n\tconstructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\tinitialValue: TState,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_ot_\");\n\n\t\tthis.global = this.local = initialValue;\n\t}\n\n\tprotected apply(op: TOp) {\n\t\tthis.local = this.applyCore(this.state, op);\n\n\t\t// If we are not attached, don't submit the op.\n\t\tif (!this.isAttached()) {\n\t\t\tthis.global = this.local;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pendingOps.push(op);\n\t\tthis.submitLocalMessage(op);\n\t}\n\n\t/**\n\t * Apply the given 'op' to the provided 'state', producing a new instance of state.\n\t */\n\tprotected abstract applyCore(state: TState, op: TOp): TState;\n\n\t/**\n\t * Transform the 'input' op to adjust for the earlier 'transform' op.\n\t */\n\tprotected abstract transform(input: TOp, transform: TOp): TOp;\n\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tassert(\n\t\t\tthis.pendingOps.length === 0,\n\t\t\t0x5f6 /* Summarizer must not have locally pending changes. */,\n\t\t);\n\n\t\treturn createSingleBlobSummary(\"header\", serializer.stringify(this.global, this.handle));\n\t}\n\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst blob = await storage.readBlob(\"header\");\n\t\tconst rawContent = bufferToString(blob, \"utf8\");\n\t\tthis.global = this.local = this.serializer.parse(rawContent) as TState;\n\t}\n\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}\n\t */\n\tprotected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, local, messagesContent } = messagesCollection;\n\t\tfor (const messageContent of messagesContent) {\n\t\t\tthis.processMessage(envelope, messageContent, local);\n\t\t}\n\t}\n\n\tprivate processMessage(\n\t\tmessageEnvelope: ISequencedMessageEnvelope,\n\t\tmessagesContent: IRuntimeMessagesContent,\n\t\tlocal: boolean,\n\t) {\n\t\t// Discard any sequenced ops that are now below the minimum sequence number.\n\t\tconst minSeq = this.deltaManager.minimumSequenceNumber;\n\t\twhile (this.sequencedOps[0]?.seq < minSeq) {\n\t\t\tthis.sequencedOps.shift();\n\t\t}\n\n\t\tlet remoteOp = messagesContent.contents;\n\t\tconst messageSeq = messageEnvelope.sequenceNumber;\n\t\tconst remoteRefSeq = messageEnvelope.referenceSequenceNumber;\n\t\tconst remoteClient = messageEnvelope.clientId;\n\n\t\t// Adjust the incoming sequenced op to account for prior sequenced ops that the\n\t\t// sender hadn't yet seen at the time they sent the op.\n\t\tfor (const { op, seq, client } of this.sequencedOps) {\n\t\t\tif (remoteRefSeq < seq && remoteClient !== client) {\n\t\t\t\tremoteOp = this.transform(remoteOp as TOp, op);\n\t\t\t}\n\t\t}\n\n\t\t// Retain the adjusted op in order to adjust future remote ops.\n\t\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t\tthis.sequencedOps.push({\n\t\t\tseq: messageSeq,\n\n\t\t\tclient: remoteClient as string,\n\t\t\top: remoteOp as TOp,\n\t\t});\n\n\t\t// The incoming sequenced op is now part of the \"global\" state. Apply it to \"this.global\"\n\t\t// now.\n\t\t//\n\t\t// TODO: If the op is local, we could defer applying the remoteOp and wait and see if\n\t\t// the global state catches up with our local state.\n\t\tthis.global = this.applyCore(this.global, remoteOp as TOp);\n\n\t\tif (local) {\n\t\t\tthis.pendingOps.shift();\n\t\t} else {\n\t\t\t// Our optimistic local cache (if any) did not account for the incoming op.\n\t\t\tthis.localDirty = true;\n\n\t\t\t// Adjust our queue of locally pending ops to account for the incoming op so that they\n\t\t\t// may be reapplied to the global state if needed.\n\t\t\tfor (let i = 0; i < this.pendingOps.length; i++) {\n\t\t\t\tthis.pendingOps[i] = this.transform(this.pendingOps[i], remoteOp as TOp);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected get state() {\n\t\t// If the locally cached state is dirty, reset it to the global state and reapply our\n\t\t// pending ops to bring it up to date.\n\t\tif (this.localDirty) {\n\t\t\tthis.local = this.global;\n\n\t\t\tfor (const op of this.pendingOps) {\n\t\t\t\tthis.local = this.applyCore(this.local, op);\n\t\t\t}\n\n\t\t\tthis.localDirty = false;\n\t\t}\n\n\t\treturn this.local;\n\t}\n\n\tprotected applyStashedOp(): void {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluid-experimental/ot";
|
|
8
|
-
export declare const pkgVersion = "2.70.0-
|
|
8
|
+
export declare const pkgVersion = "2.70.0-361788";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluid-experimental/ot";
|
|
11
|
-
exports.pkgVersion = "2.70.0-
|
|
11
|
+
exports.pkgVersion = "2.70.0-361788";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,wBAAwB,CAAC;AACnC,QAAA,UAAU,GAAG,eAAe,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 = \"@fluid-experimental/ot\";\nexport const pkgVersion = \"2.70.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,wBAAwB,CAAC;AACnC,QAAA,UAAU,GAAG,eAAe,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 = \"@fluid-experimental/ot\";\nexport const pkgVersion = \"2.70.0-361788\";\n"]}
|
package/lib/ot.d.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
6
|
-
import {
|
|
7
|
-
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
|
|
6
|
+
import { ISummaryTreeWithStats, type IRuntimeMessageCollection } from "@fluidframework/runtime-definitions/internal";
|
|
8
7
|
import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base/internal";
|
|
9
8
|
/**
|
|
10
9
|
* @internal
|
|
@@ -43,7 +42,11 @@ export declare abstract class SharedOT<TState, TOp> extends SharedObject {
|
|
|
43
42
|
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
|
|
44
43
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
45
44
|
protected onDisconnect(): void;
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}
|
|
47
|
+
*/
|
|
48
|
+
protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void;
|
|
49
|
+
private processMessage;
|
|
47
50
|
protected get state(): TState;
|
|
48
51
|
protected applyStashedOp(): void;
|
|
49
52
|
}
|
package/lib/ot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ot.d.ts","sourceRoot":"","sources":["../src/ot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"ot.d.ts","sourceRoot":"","sources":["../src/ot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,qBAAqB,EACrB,KAAK,yBAAyB,EAG9B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,gBAAgB,EAChB,YAAY,EAEZ,MAAM,6CAA6C,CAAC;AAQrD;;GAEG;AACH,8BAAsB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAE,SAAQ,YAAY;IAC/D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA+B;IAE5D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC,sEAAsE;IACtE,OAAO,CAAC,MAAM,CAAS;IAEvB;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,UAAU,CAAS;gBAG1B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,kBAAkB,EAC9B,YAAY,EAAE,MAAM;IAOrB,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG;IAavB;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,MAAM;IAE5D;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,GAAG;IAE7D,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;cAS5D,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxE,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,yBAAyB,GAAG,IAAI;IAOlF,OAAO,CAAC,cAAc;IAsDtB,SAAS,KAAK,KAAK,WAclB;IAED,SAAS,CAAC,cAAc,IAAI,IAAI;CAGhC"}
|
package/lib/ot.js
CHANGED
|
@@ -46,16 +46,25 @@ export class SharedOT extends SharedObject {
|
|
|
46
46
|
this.global = this.local = this.serializer.parse(rawContent);
|
|
47
47
|
}
|
|
48
48
|
onDisconnect() { }
|
|
49
|
-
|
|
49
|
+
/**
|
|
50
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}
|
|
51
|
+
*/
|
|
52
|
+
processMessagesCore(messagesCollection) {
|
|
53
|
+
const { envelope, local, messagesContent } = messagesCollection;
|
|
54
|
+
for (const messageContent of messagesContent) {
|
|
55
|
+
this.processMessage(envelope, messageContent, local);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
processMessage(messageEnvelope, messagesContent, local) {
|
|
50
59
|
// Discard any sequenced ops that are now below the minimum sequence number.
|
|
51
60
|
const minSeq = this.deltaManager.minimumSequenceNumber;
|
|
52
61
|
while (this.sequencedOps[0]?.seq < minSeq) {
|
|
53
62
|
this.sequencedOps.shift();
|
|
54
63
|
}
|
|
55
|
-
let remoteOp =
|
|
56
|
-
const messageSeq =
|
|
57
|
-
const remoteRefSeq =
|
|
58
|
-
const remoteClient =
|
|
64
|
+
let remoteOp = messagesContent.contents;
|
|
65
|
+
const messageSeq = messageEnvelope.sequenceNumber;
|
|
66
|
+
const remoteRefSeq = messageEnvelope.referenceSequenceNumber;
|
|
67
|
+
const remoteClient = messageEnvelope.clientId;
|
|
59
68
|
// Adjust the incoming sequenced op to account for prior sequenced ops that the
|
|
60
69
|
// sender hadn't yet seen at the time they sent the op.
|
|
61
70
|
for (const { op, seq, client } of this.sequencedOps) {
|
package/lib/ot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ot.js","sourceRoot":"","sources":["../src/ot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"ot.js","sourceRoot":"","sources":["../src/ot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAY7D,OAAO,EAEN,YAAY,EACZ,uBAAuB,GACvB,MAAM,6CAA6C,CAAC;AAQrD;;GAEG;AACH,MAAM,OAAgB,QAAsB,SAAQ,YAAY;IAyB/D,YACC,EAAU,EACV,OAA+B,EAC/B,UAA8B,EAC9B,YAAoB;QAEpB,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QA9B7C;;;;WAIG;QACc,iBAAY,GAA4B,EAAE,CAAC;QAE5D;;;;WAIG;QACc,eAAU,GAAU,EAAE,CAAC;QAUhC,eAAU,GAAG,KAAK,CAAC;QAU1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC;IACzC,CAAC;IAES,KAAK,CAAC,EAAO;QACtB,IAAI,CAAC,KAAK,GAAG,IA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kD;YAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACjD,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAe,CAAC,CAAC;YAC1E,CAAC;QACF,CAAC;IACF,CAAC;IAED,IAAc,KAAK;QAClB,qFAAqF;QACrF,sCAAsC;QACtC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YAEzB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC7C,CAAC;YAED,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACzB,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,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 } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tISummaryTreeWithStats,\n\ttype IRuntimeMessageCollection,\n\ttype IRuntimeMessagesContent,\n\ttype ISequencedMessageEnvelope,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tIFluidSerializer,\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\ninterface ISequencedOpInfo<TOp> {\n\tclient: string;\n\tseq: number;\n\top: TOp;\n}\n\n/**\n * @internal\n */\nexport abstract class SharedOT<TState, TOp> extends SharedObject {\n\t/**\n\t * Queue of sequenced ops that are above minSeq. Used by 'processCore' to\n\t * adjust incoming ops to account for prior ops that the sender didn't know about\n\t * at the time they submitted their op.\n\t */\n\tprivate readonly sequencedOps: ISequencedOpInfo<TOp>[] = [];\n\n\t/**\n\t * Queue of local pending ops that have not yet been ACKed by the service. Used\n\t * to lazily rebuild the \"local\" state cache when it is invalidated by interleaved\n\t * remote ops.\n\t */\n\tprivate readonly pendingOps: TOp[] = [];\n\n\t/** The \"global\" state is the result of applying all sequenced ops. */\n\tprivate global: TState;\n\n\t/**\n\t * Lazily cached result of optimistically applying pendingOps on top of the current\n\t * \"global\" state.\n\t */\n\tprivate local: TState;\n\tprivate localDirty = false;\n\n\tconstructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\tinitialValue: TState,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_ot_\");\n\n\t\tthis.global = this.local = initialValue;\n\t}\n\n\tprotected apply(op: TOp) {\n\t\tthis.local = this.applyCore(this.state, op);\n\n\t\t// If we are not attached, don't submit the op.\n\t\tif (!this.isAttached()) {\n\t\t\tthis.global = this.local;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pendingOps.push(op);\n\t\tthis.submitLocalMessage(op);\n\t}\n\n\t/**\n\t * Apply the given 'op' to the provided 'state', producing a new instance of state.\n\t */\n\tprotected abstract applyCore(state: TState, op: TOp): TState;\n\n\t/**\n\t * Transform the 'input' op to adjust for the earlier 'transform' op.\n\t */\n\tprotected abstract transform(input: TOp, transform: TOp): TOp;\n\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tassert(\n\t\t\tthis.pendingOps.length === 0,\n\t\t\t0x5f6 /* Summarizer must not have locally pending changes. */,\n\t\t);\n\n\t\treturn createSingleBlobSummary(\"header\", serializer.stringify(this.global, this.handle));\n\t}\n\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst blob = await storage.readBlob(\"header\");\n\t\tconst rawContent = bufferToString(blob, \"utf8\");\n\t\tthis.global = this.local = this.serializer.parse(rawContent) as TState;\n\t}\n\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}\n\t */\n\tprotected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, local, messagesContent } = messagesCollection;\n\t\tfor (const messageContent of messagesContent) {\n\t\t\tthis.processMessage(envelope, messageContent, local);\n\t\t}\n\t}\n\n\tprivate processMessage(\n\t\tmessageEnvelope: ISequencedMessageEnvelope,\n\t\tmessagesContent: IRuntimeMessagesContent,\n\t\tlocal: boolean,\n\t) {\n\t\t// Discard any sequenced ops that are now below the minimum sequence number.\n\t\tconst minSeq = this.deltaManager.minimumSequenceNumber;\n\t\twhile (this.sequencedOps[0]?.seq < minSeq) {\n\t\t\tthis.sequencedOps.shift();\n\t\t}\n\n\t\tlet remoteOp = messagesContent.contents;\n\t\tconst messageSeq = messageEnvelope.sequenceNumber;\n\t\tconst remoteRefSeq = messageEnvelope.referenceSequenceNumber;\n\t\tconst remoteClient = messageEnvelope.clientId;\n\n\t\t// Adjust the incoming sequenced op to account for prior sequenced ops that the\n\t\t// sender hadn't yet seen at the time they sent the op.\n\t\tfor (const { op, seq, client } of this.sequencedOps) {\n\t\t\tif (remoteRefSeq < seq && remoteClient !== client) {\n\t\t\t\tremoteOp = this.transform(remoteOp as TOp, op);\n\t\t\t}\n\t\t}\n\n\t\t// Retain the adjusted op in order to adjust future remote ops.\n\t\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t\tthis.sequencedOps.push({\n\t\t\tseq: messageSeq,\n\n\t\t\tclient: remoteClient as string,\n\t\t\top: remoteOp as TOp,\n\t\t});\n\n\t\t// The incoming sequenced op is now part of the \"global\" state. Apply it to \"this.global\"\n\t\t// now.\n\t\t//\n\t\t// TODO: If the op is local, we could defer applying the remoteOp and wait and see if\n\t\t// the global state catches up with our local state.\n\t\tthis.global = this.applyCore(this.global, remoteOp as TOp);\n\n\t\tif (local) {\n\t\t\tthis.pendingOps.shift();\n\t\t} else {\n\t\t\t// Our optimistic local cache (if any) did not account for the incoming op.\n\t\t\tthis.localDirty = true;\n\n\t\t\t// Adjust our queue of locally pending ops to account for the incoming op so that they\n\t\t\t// may be reapplied to the global state if needed.\n\t\t\tfor (let i = 0; i < this.pendingOps.length; i++) {\n\t\t\t\tthis.pendingOps[i] = this.transform(this.pendingOps[i], remoteOp as TOp);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected get state() {\n\t\t// If the locally cached state is dirty, reset it to the global state and reapply our\n\t\t// pending ops to bring it up to date.\n\t\tif (this.localDirty) {\n\t\t\tthis.local = this.global;\n\n\t\t\tfor (const op of this.pendingOps) {\n\t\t\t\tthis.local = this.applyCore(this.local, op);\n\t\t\t}\n\n\t\t\tthis.localDirty = false;\n\t\t}\n\n\t\treturn this.local;\n\t}\n\n\tprotected applyStashedOp(): void {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluid-experimental/ot";
|
|
8
|
-
export declare const pkgVersion = "2.70.0-
|
|
8
|
+
export declare const pkgVersion = "2.70.0-361788";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,wBAAwB,CAAC;AAChD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,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 = \"@fluid-experimental/ot\";\nexport const pkgVersion = \"2.70.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,wBAAwB,CAAC;AAChD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,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 = \"@fluid-experimental/ot\";\nexport const pkgVersion = \"2.70.0-361788\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/ot",
|
|
3
|
-
"version": "2.70.0-
|
|
3
|
+
"version": "2.70.0-361788",
|
|
4
4
|
"description": "Distributed data structure for hosting ottypes",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -49,24 +49,24 @@
|
|
|
49
49
|
"temp-directory": "nyc/.nyc_output"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@fluid-internal/client-utils": "2.70.0-
|
|
53
|
-
"@fluidframework/core-interfaces": "2.70.0-
|
|
54
|
-
"@fluidframework/core-utils": "2.70.0-
|
|
55
|
-
"@fluidframework/datastore-definitions": "2.70.0-
|
|
56
|
-
"@fluidframework/driver-definitions": "2.70.0-
|
|
57
|
-
"@fluidframework/runtime-definitions": "2.70.0-
|
|
58
|
-
"@fluidframework/shared-object-base": "2.70.0-
|
|
52
|
+
"@fluid-internal/client-utils": "2.70.0-361788",
|
|
53
|
+
"@fluidframework/core-interfaces": "2.70.0-361788",
|
|
54
|
+
"@fluidframework/core-utils": "2.70.0-361788",
|
|
55
|
+
"@fluidframework/datastore-definitions": "2.70.0-361788",
|
|
56
|
+
"@fluidframework/driver-definitions": "2.70.0-361788",
|
|
57
|
+
"@fluidframework/runtime-definitions": "2.70.0-361788",
|
|
58
|
+
"@fluidframework/shared-object-base": "2.70.0-361788"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
62
62
|
"@biomejs/biome": "~1.9.3",
|
|
63
|
-
"@fluid-internal/mocha-test-setup": "2.70.0-
|
|
64
|
-
"@fluid-private/test-dds-utils": "2.70.0-
|
|
63
|
+
"@fluid-internal/mocha-test-setup": "2.70.0-361788",
|
|
64
|
+
"@fluid-private/test-dds-utils": "2.70.0-361788",
|
|
65
65
|
"@fluid-tools/build-cli": "^0.58.3",
|
|
66
66
|
"@fluidframework/build-common": "^2.0.3",
|
|
67
67
|
"@fluidframework/build-tools": "^0.58.3",
|
|
68
68
|
"@fluidframework/eslint-config-fluid": "^6.1.0",
|
|
69
|
-
"@fluidframework/test-runtime-utils": "2.70.0-
|
|
69
|
+
"@fluidframework/test-runtime-utils": "2.70.0-361788",
|
|
70
70
|
"@microsoft/api-extractor": "7.52.11",
|
|
71
71
|
"@types/mocha": "^10.0.10",
|
|
72
72
|
"@types/node": "^18.19.0",
|
package/src/ot.ts
CHANGED
|
@@ -10,8 +10,12 @@ import {
|
|
|
10
10
|
IFluidDataStoreRuntime,
|
|
11
11
|
IChannelStorageService,
|
|
12
12
|
} from "@fluidframework/datastore-definitions/internal";
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
ISummaryTreeWithStats,
|
|
15
|
+
type IRuntimeMessageCollection,
|
|
16
|
+
type IRuntimeMessagesContent,
|
|
17
|
+
type ISequencedMessageEnvelope,
|
|
18
|
+
} from "@fluidframework/runtime-definitions/internal";
|
|
15
19
|
import {
|
|
16
20
|
IFluidSerializer,
|
|
17
21
|
SharedObject,
|
|
@@ -103,17 +107,31 @@ export abstract class SharedOT<TState, TOp> extends SharedObject {
|
|
|
103
107
|
|
|
104
108
|
protected onDisconnect() {}
|
|
105
109
|
|
|
106
|
-
|
|
110
|
+
/**
|
|
111
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}
|
|
112
|
+
*/
|
|
113
|
+
protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {
|
|
114
|
+
const { envelope, local, messagesContent } = messagesCollection;
|
|
115
|
+
for (const messageContent of messagesContent) {
|
|
116
|
+
this.processMessage(envelope, messageContent, local);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
private processMessage(
|
|
121
|
+
messageEnvelope: ISequencedMessageEnvelope,
|
|
122
|
+
messagesContent: IRuntimeMessagesContent,
|
|
123
|
+
local: boolean,
|
|
124
|
+
) {
|
|
107
125
|
// Discard any sequenced ops that are now below the minimum sequence number.
|
|
108
126
|
const minSeq = this.deltaManager.minimumSequenceNumber;
|
|
109
127
|
while (this.sequencedOps[0]?.seq < minSeq) {
|
|
110
128
|
this.sequencedOps.shift();
|
|
111
129
|
}
|
|
112
130
|
|
|
113
|
-
let remoteOp =
|
|
114
|
-
const messageSeq =
|
|
115
|
-
const remoteRefSeq =
|
|
116
|
-
const remoteClient =
|
|
131
|
+
let remoteOp = messagesContent.contents;
|
|
132
|
+
const messageSeq = messageEnvelope.sequenceNumber;
|
|
133
|
+
const remoteRefSeq = messageEnvelope.referenceSequenceNumber;
|
|
134
|
+
const remoteClient = messageEnvelope.clientId;
|
|
117
135
|
|
|
118
136
|
// Adjust the incoming sequenced op to account for prior sequenced ops that the
|
|
119
137
|
// sender hadn't yet seen at the time they sent the op.
|
package/src/packageVersion.ts
CHANGED