@fluidframework/replay-driver 0.59.4002 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/replayController.d.ts +0 -1
- package/dist/replayController.d.ts.map +1 -1
- package/dist/replayController.js +0 -3
- package/dist/replayController.js.map +1 -1
- package/dist/replayDocumentDeltaConnection.js +1 -1
- package/dist/replayDocumentDeltaConnection.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/replayController.d.ts +0 -1
- package/lib/replayController.d.ts.map +1 -1
- package/lib/replayController.js +0 -3
- package/lib/replayController.js.map +1 -1
- package/lib/replayDocumentDeltaConnection.js +1 -1
- package/lib/replayDocumentDeltaConnection.js.map +1 -1
- package/lib/test/types/validateReplayDriverPrevious.js +15 -5
- package/lib/test/types/validateReplayDriverPrevious.js.map +1 -1
- package/package.json +26 -24
- package/src/packageVersion.ts +1 -1
- package/src/replayController.ts +0 -4
- package/src/replayDocumentDeltaConnection.ts +1 -1
package/.eslintrc.js
CHANGED
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/replay-driver";
|
|
8
|
-
export declare const pkgVersion = "0.
|
|
8
|
+
export declare const pkgVersion = "1.0.2";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,kCAAkC,CAAC;AACvD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,kCAAkC,CAAC;AACvD,eAAO,MAAM,UAAU,UAAU,CAAC"}
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/replay-driver";
|
|
11
|
-
exports.pkgVersion = "0.
|
|
11
|
+
exports.pkgVersion = "1.0.2";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,+BAA+B,CAAC;AAC1C,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,+BAA+B,CAAC;AAC1C,QAAA,UAAU,GAAG,OAAO,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/replay-driver\";\nexport const pkgVersion = \"1.0.2\";\n"]}
|
|
@@ -12,7 +12,6 @@ export declare abstract class ReadDocumentStorageServiceBase implements IDocumen
|
|
|
12
12
|
abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
13
13
|
abstract readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
14
14
|
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
15
|
-
write(tree: api.ITree, parents: string[], message: string, ref: string): Promise<api.IVersion>;
|
|
16
15
|
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
17
16
|
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
18
17
|
get repositoryUrl(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayController.d.ts","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAE5D;;GAEG;AACH,8BAAsB,8BAA+B,YAAW,uBAAuB;aACnE,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;aAC7E,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC;aAC1E,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAErD,wBAAwB,CAAC,OAAO,EAAE,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAI9F,
|
|
1
|
+
{"version":3,"file":"replayController.d.ts","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAE5D;;GAEG;AACH,8BAAsB,8BAA+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 @@ class ReadDocumentStorageServiceBase {
|
|
|
12
12
|
async uploadSummaryWithContext(summary, context) {
|
|
13
13
|
return Promise.reject(new Error("Invalid operation"));
|
|
14
14
|
}
|
|
15
|
-
async write(tree, parents, message, ref) {
|
|
16
|
-
return Promise.reject(new Error("Invalid operation"));
|
|
17
|
-
}
|
|
18
15
|
async createBlob(file) {
|
|
19
16
|
return Promise.reject(new Error("Invalid operation"));
|
|
20
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayController.js","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;GAEG;AACH,MAAsB,8BAA8B;IAKzC,KAAK,CAAC,wBAAwB,CAAC,OAAyB,EAAE,OAAwB;QACrF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"replayController.js","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;GAEG;AACH,MAAsB,8BAA8B;IAKzC,KAAK,CAAC,wBAAwB,CAAC,OAAyB,EAAE,OAAwB;QACrF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QACzC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAA0B;QACnD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAW,aAAa;QACpB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC;CACJ;AApBD,wEAoBC;AAED;;;;GAIG;AACH,MAAsB,gBAAiB,SAAQ,8BAA8B;CA0C5E;AA1CD,4CA0CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IDocumentService,\n IDocumentStorageService,\n ISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport * as api from \"@fluidframework/protocol-definitions\";\n\n/**\n * Partial implementation of IDocumentStorageService\n */\nexport abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {\n public abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;\n public abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;\n public abstract readBlob(blobId: string): Promise<ArrayBufferLike>;\n\n public async uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public get repositoryUrl(): string {\n throw new Error(\"Invalid operation\");\n }\n}\n\n/**\n * Replay controller object\n * It controls where we start (snapshot, local file, no snapshots)\n * As well as dispatch of ops\n */\nexport abstract class ReplayController extends ReadDocumentStorageServiceBase {\n /**\n * Initialize reply controller\n * @param documentService - the real document service\n * @returns - Boolean, indicating if controller should be used.\n * If false is returned, caller should fallback to original storage.\n */\n public abstract initStorage(documentService: IDocumentService): Promise<boolean>;\n\n /**\n * Returns sequence number to start processing ops\n * Should be zero if not using snapshot, and snapshot seq# otherwise\n */\n public abstract getStartingOpSequence(): Promise<number>;\n\n /**\n * Returns last op number to fetch from current op\n * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel\n * @param currentOp - current op\n */\n public abstract fetchTo(currentOp: number): number | undefined;\n\n /**\n * Returns true if no more ops should be processed (or downloaded for future processing).\n * It's called at end of each batch with latest op timestamp.\n * Also it's called when there are no more ops available (lastTimeStamp === undefined).\n * If false is returned and there are no more ops, request for more ops is made every 2 seconds.\n * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel\n * @param currentOp - current op\n * @param lastTimeStamp - timestamp of last op (if more ops are available). Undefined otherwise.\n */\n public abstract isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;\n\n /**\n * Replay batch of ops\n * NOTE: new batch of ops is fetched (fetchTo() & isDoneFetch() APIs are called) while this call is in flights\n * @param emitter - callback to emit ops\n * @param fetchedOps - ops to process\n */\n public abstract replay(\n emitter: (op: api.ISequencedDocumentMessage[]) => void,\n fetchedOps: api.ISequencedDocumentMessage[]): Promise<void>;\n}\n"]}
|
|
@@ -170,8 +170,8 @@ class ReplayDocumentDeltaConnection extends common_utils_1.TypedEventEmitter {
|
|
|
170
170
|
maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,
|
|
171
171
|
summary: {
|
|
172
172
|
idleTime: 5000,
|
|
173
|
-
maxOps: 1000,
|
|
174
173
|
maxTime: 5000 * 12,
|
|
174
|
+
maxOps: 1000,
|
|
175
175
|
maxAckWaitTime: 600000,
|
|
176
176
|
},
|
|
177
177
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,+EAW8C;AAC9C,+DAAwE;AACxE,yDAAsD;AAEtD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAa,sBAAuB,SAAQ,mCAAgB;IAMxD,gDAAgD;IAEhD;;;;;;OAMG;IACH,YACoB,UAAkB,EAClB,QAAgB,EAChB,UAAoB;QACpC,KAAK,EAAE,CAAC;QAHQ,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAU;QAbhC,k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DAAqB,GAAG,QAAQ,CAAC;AACzD,qFAAqF;AAC7D,kDAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjC,oCAAM,GAAiB;IAC3C,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,gCAAS,CAAC,OAAO,CAAC;IAC3B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACF,EAAE,EAAE,EAAE;KACT;IACD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5C,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;IACtD,GAAG,EAAE,KAAK;CACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n IDocumentDeltaConnection,\n IDocumentDeltaStorageService,\n IDocumentDeltaConnectionEvents,\n IDocumentService,\n} from \"@fluidframework/driver-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IConnected,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n IVersion,\n ScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { delay, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { ReplayController } from \"./replayController\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n private static readonly DelayInterval = 50;\n private static readonly ReplayResolution = 15;\n\n private firstTimeStamp: number | undefined;\n private replayCurrent = 0;\n // Simulated delay interval for emitting the ops\n\n /**\n * Helper class\n *\n * @param replayFrom - First op to be played on socket.\n * @param replayTo - Last op number to be played on socket.\n * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n */\n public constructor(\n public readonly replayFrom: number,\n public readonly replayTo: number,\n public readonly unitIsTime?: boolean) {\n super();\n if (unitIsTime !== true) {\n // There is no code in here to start with snapshot, thus we have to start with op #0.\n this.replayTo = 0;\n }\n }\n\n public async initStorage(documentService: IDocumentService) {\n return true;\n }\n\n public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n return [];\n }\n\n public async getSnapshotTree(version?: IVersion) {\n return version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n }\n\n public async readBlob(blobId: string): Promise<ArrayBufferLike> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public async getStartingOpSequence(): Promise<number> {\n return 0;\n }\n\n public fetchTo(currentOp: number) {\n if (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n return undefined;\n }\n return this.replayTo;\n }\n\n public isDoneFetch(currentOp: number, lastTimeStamp?: number) {\n if (this.replayTo >= 0) {\n if (this.unitIsTime === true) {\n return (\n lastTimeStamp !== undefined\n && this.firstTimeStamp !== undefined\n && lastTimeStamp - this.firstTimeStamp >= this.replayTo);\n }\n return currentOp >= this.replayTo;\n }\n return lastTimeStamp === undefined; // No more ops\n }\n\n public skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {\n if (this.replayFrom <= 0) {\n return 0;\n }\n if (this.unitIsTime === true) {\n for (let i = 0; i < fetchedOps.length; i += 1) {\n const timeStamp = fetchedOps[i].timestamp;\n if (timeStamp !== undefined) {\n if (this.firstTimeStamp === undefined) {\n this.firstTimeStamp = timeStamp;\n }\n if (timeStamp - this.firstTimeStamp >= this.replayFrom) {\n return i;\n }\n }\n }\n } else if (this.replayFrom > this.replayCurrent) {\n return this.replayFrom - this.replayCurrent;\n }\n return 0;\n }\n\n public async replay(\n emitter: (op: ISequencedDocumentMessage[]) => void,\n fetchedOps: ISequencedDocumentMessage[]): Promise<void> {\n let current = this.skipToIndex(fetchedOps);\n\n return new Promise((resolve) => {\n const replayNextOps = () => {\n // Emit the ops from replay to the end every \"deltainterval\" milliseconds\n // to simulate the socket stream\n const currentOp = fetchedOps[current];\n const playbackOps = [currentOp];\n let nextInterval = ReplayControllerStatic.DelayInterval;\n current += 1;\n\n if (this.unitIsTime === true) {\n const currentTimeStamp = currentOp.timestamp;\n if (currentTimeStamp !== undefined) {\n // Emit more ops that is in the ReplayResolution window\n\n while (current < fetchedOps.length) {\n const op = fetchedOps[current];\n if (op.timestamp === undefined) {\n // Missing timestamp, just delay the standard amount of time\n break;\n }\n const timeDiff = op.timestamp - currentTimeStamp;\n if (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n // Time exceeded the resolution window, break out the loop\n // and delay for the time difference.\n nextInterval = timeDiff;\n break;\n }\n if (timeDiff < 0) {\n // Time have regressed, just delay the standard amount of time\n break;\n }\n\n // The op is within the ReplayResolution emit it now\n playbackOps.push(op);\n current += 1;\n }\n\n if (this.firstTimeStamp !== undefined\n && this.replayTo >= 0\n && currentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo) {\n nextInterval = -1;\n }\n }\n }\n scheduleNext(nextInterval);\n emitter(playbackOps);\n };\n const scheduleNext = (nextInterval: number) => {\n if (nextInterval >= 0 && current < fetchedOps.length) {\n setTimeout(replayNextOps, nextInterval);\n } else {\n this.replayCurrent += current;\n resolve();\n }\n };\n scheduleNext(ReplayControllerStatic.DelayInterval);\n });\n }\n}\n\nexport class ReplayDocumentDeltaConnection\n extends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n implements IDocumentDeltaConnection, IDisposable {\n /**\n * Creates a new delta connection and mimics the delta connection to replay ops on it.\n * @param documentService - The document service to be used to get underlying endpoints.\n */\n public static create(\n documentStorageService: IDocumentDeltaStorageService,\n controller: ReplayController): IDocumentDeltaConnection {\n const connection: IConnected = {\n claims: ReplayDocumentDeltaConnection.claims,\n clientId: \"PseudoClientId\",\n existing: true,\n initialMessages: [],\n initialSignals: [],\n initialClients: [],\n maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n mode: \"read\",\n serviceConfiguration: {\n blockSize: 64436,\n maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n summary: {\n idleTime: 5000,\n maxOps: 1000,\n maxTime: 5000 * 12,\n maxAckWaitTime: 600000,\n },\n },\n supportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n version: ReplayDocumentDeltaConnection.replayProtocolVersion,\n };\n const deltaConnection = new ReplayDocumentDeltaConnection(connection);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n deltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n return deltaConnection;\n }\n\n private static readonly replayProtocolVersion = \"^0.1.0\";\n // Since the replay service never actually sends messages the size below is arbitrary\n private static readonly ReplayMaxMessageSize = 16 * 1024;\n\n private static readonly claims: ITokenClaims = {\n documentId: ReplayDocumentId,\n scopes: [ScopeType.DocRead],\n tenantId: \"\",\n user: {\n id: \"\",\n },\n iat: Math.round(new Date().getTime() / 1000),\n exp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n ver: \"1.0\",\n };\n\n public get clientId(): string {\n return this.details.clientId;\n }\n\n public get mode(): ConnectionMode {\n return this.details.mode;\n }\n\n public get claims(): ITokenClaims {\n return this.details.claims;\n }\n\n public get existing(): boolean {\n return this.details.existing;\n }\n\n public get version(): string {\n return this.details.version;\n }\n\n public get initialMessages(): ISequencedDocumentMessage[] {\n return this.details.initialMessages;\n }\n\n public get initialSignals(): ISignalMessage[] {\n return this.details.initialSignals;\n }\n\n public get initialClients(): ISignalClient[] {\n return this.details.initialClients;\n }\n\n public get serviceConfiguration(): IClientConfiguration {\n return this.details.serviceConfiguration;\n }\n\n public readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n constructor(\n public details: IConnected,\n ) {\n super();\n }\n\n public submit(documentMessage: IDocumentMessage[]): void {\n // ReplayDocumentDeltaConnection.submit() can't be called - client never sees its own join on,\n // and thus can never move to sending ops.\n throw new Error(\"ReplayDocumentDeltaConnection.submit() can't be called\");\n }\n\n public async submitSignal(message: any) {\n }\n\n private _disposed = false;\n public get disposed() { return this._disposed; }\n public dispose() { this._disposed = true; }\n\n /**\n * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n */\n private async fetchAndEmitOps(\n documentStorageService: IDocumentDeltaStorageService,\n controller: ReplayController,\n ): Promise<void> {\n let done;\n let replayPromiseChain = Promise.resolve();\n\n let currentOp = await controller.getStartingOpSequence();\n\n do {\n const fetchTo = controller.fetchTo(currentOp);\n\n const abortController = new AbortController();\n const stream = documentStorageService.fetchMessages(currentOp + 1, fetchTo, abortController.signal);\n do {\n const result = await stream.read();\n\n if (result.done) {\n // No more ops. But, they can show up later, either because document was just created,\n // or because another client keeps submitting new ops.\n done = controller.isDoneFetch(currentOp, undefined);\n if (!done) {\n await delay(2000);\n }\n break;\n }\n replayPromiseChain = replayPromiseChain.then(\n async () => controller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages));\n\n const messages = result.value;\n currentOp += messages.length;\n done = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n } while (!done);\n\n abortController.abort();\n } while (!done);\n return replayPromiseChain;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"replayDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,+EAW8C;AAC9C,+DAAwE;AACxE,yDAAsD;AAEtD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAa,sBAAuB,SAAQ,mCAAgB;IAMxD,gDAAgD;IAEhD;;;;;;OAMG;IACH,YACoB,UAAkB,EAClB,QAAgB,EAChB,UAAoB;QACpC,KAAK,EAAE,CAAC;QAHQ,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAU;QAbhC,kBAAa,GAAG,CAAC,CAAC;QAetB,IAAI,UAAU,KAAK,IAAI,EAAE;YACrB,qFAAqF;YACrF,IAAI,CAAC,QAAQ,GA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AAiB;IAC3C,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,gCAAS,CAAC,OAAO,CAAC;IAC3B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACF,EAAE,EAAE,EAAE;KACT;IACD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5C,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;IACtD,GAAG,EAAE,KAAK;CACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n IDocumentDeltaConnection,\n IDocumentDeltaStorageService,\n IDocumentDeltaConnectionEvents,\n IDocumentService,\n} from \"@fluidframework/driver-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IConnected,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n IVersion,\n ScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { delay, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { ReplayController } from \"./replayController\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n private static readonly DelayInterval = 50;\n private static readonly ReplayResolution = 15;\n\n private firstTimeStamp: number | undefined;\n private replayCurrent = 0;\n // Simulated delay interval for emitting the ops\n\n /**\n * Helper class\n *\n * @param replayFrom - First op to be played on socket.\n * @param replayTo - Last op number to be played on socket.\n * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n */\n public constructor(\n public readonly replayFrom: number,\n public readonly replayTo: number,\n public readonly unitIsTime?: boolean) {\n super();\n if (unitIsTime !== true) {\n // There is no code in here to start with snapshot, thus we have to start with op #0.\n this.replayTo = 0;\n }\n }\n\n public async initStorage(documentService: IDocumentService) {\n return true;\n }\n\n public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n return [];\n }\n\n public async getSnapshotTree(version?: IVersion) {\n return version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n }\n\n public async readBlob(blobId: string): Promise<ArrayBufferLike> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public async getStartingOpSequence(): Promise<number> {\n return 0;\n }\n\n public fetchTo(currentOp: number) {\n if (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n return undefined;\n }\n return this.replayTo;\n }\n\n public isDoneFetch(currentOp: number, lastTimeStamp?: number) {\n if (this.replayTo >= 0) {\n if (this.unitIsTime === true) {\n return (\n lastTimeStamp !== undefined\n && this.firstTimeStamp !== undefined\n && lastTimeStamp - this.firstTimeStamp >= this.replayTo);\n }\n return currentOp >= this.replayTo;\n }\n return lastTimeStamp === undefined; // No more ops\n }\n\n public skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {\n if (this.replayFrom <= 0) {\n return 0;\n }\n if (this.unitIsTime === true) {\n for (let i = 0; i < fetchedOps.length; i += 1) {\n const timeStamp = fetchedOps[i].timestamp;\n if (timeStamp !== undefined) {\n if (this.firstTimeStamp === undefined) {\n this.firstTimeStamp = timeStamp;\n }\n if (timeStamp - this.firstTimeStamp >= this.replayFrom) {\n return i;\n }\n }\n }\n } else if (this.replayFrom > this.replayCurrent) {\n return this.replayFrom - this.replayCurrent;\n }\n return 0;\n }\n\n public async replay(\n emitter: (op: ISequencedDocumentMessage[]) => void,\n fetchedOps: ISequencedDocumentMessage[]): Promise<void> {\n let current = this.skipToIndex(fetchedOps);\n\n return new Promise((resolve) => {\n const replayNextOps = () => {\n // Emit the ops from replay to the end every \"deltainterval\" milliseconds\n // to simulate the socket stream\n const currentOp = fetchedOps[current];\n const playbackOps = [currentOp];\n let nextInterval = ReplayControllerStatic.DelayInterval;\n current += 1;\n\n if (this.unitIsTime === true) {\n const currentTimeStamp = currentOp.timestamp;\n if (currentTimeStamp !== undefined) {\n // Emit more ops that is in the ReplayResolution window\n\n while (current < fetchedOps.length) {\n const op = fetchedOps[current];\n if (op.timestamp === undefined) {\n // Missing timestamp, just delay the standard amount of time\n break;\n }\n const timeDiff = op.timestamp - currentTimeStamp;\n if (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n // Time exceeded the resolution window, break out the loop\n // and delay for the time difference.\n nextInterval = timeDiff;\n break;\n }\n if (timeDiff < 0) {\n // Time have regressed, just delay the standard amount of time\n break;\n }\n\n // The op is within the ReplayResolution emit it now\n playbackOps.push(op);\n current += 1;\n }\n\n if (this.firstTimeStamp !== undefined\n && this.replayTo >= 0\n && currentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo) {\n nextInterval = -1;\n }\n }\n }\n scheduleNext(nextInterval);\n emitter(playbackOps);\n };\n const scheduleNext = (nextInterval: number) => {\n if (nextInterval >= 0 && current < fetchedOps.length) {\n setTimeout(replayNextOps, nextInterval);\n } else {\n this.replayCurrent += current;\n resolve();\n }\n };\n scheduleNext(ReplayControllerStatic.DelayInterval);\n });\n }\n}\n\nexport class ReplayDocumentDeltaConnection\n extends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n implements IDocumentDeltaConnection, IDisposable {\n /**\n * Creates a new delta connection and mimics the delta connection to replay ops on it.\n * @param documentService - The document service to be used to get underlying endpoints.\n */\n public static create(\n documentStorageService: IDocumentDeltaStorageService,\n controller: ReplayController): IDocumentDeltaConnection {\n const connection: IConnected = {\n claims: ReplayDocumentDeltaConnection.claims,\n clientId: \"PseudoClientId\",\n existing: true,\n initialMessages: [],\n initialSignals: [],\n initialClients: [],\n maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n mode: \"read\",\n serviceConfiguration: {\n blockSize: 64436,\n maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n summary: {\n idleTime: 5000,\n maxTime: 5000 * 12,\n maxOps: 1000,\n maxAckWaitTime: 600000,\n },\n },\n supportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n version: ReplayDocumentDeltaConnection.replayProtocolVersion,\n };\n const deltaConnection = new ReplayDocumentDeltaConnection(connection);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n deltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n return deltaConnection;\n }\n\n private static readonly replayProtocolVersion = \"^0.1.0\";\n // Since the replay service never actually sends messages the size below is arbitrary\n private static readonly ReplayMaxMessageSize = 16 * 1024;\n\n private static readonly claims: ITokenClaims = {\n documentId: ReplayDocumentId,\n scopes: [ScopeType.DocRead],\n tenantId: \"\",\n user: {\n id: \"\",\n },\n iat: Math.round(new Date().getTime() / 1000),\n exp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n ver: \"1.0\",\n };\n\n public get clientId(): string {\n return this.details.clientId;\n }\n\n public get mode(): ConnectionMode {\n return this.details.mode;\n }\n\n public get claims(): ITokenClaims {\n return this.details.claims;\n }\n\n public get existing(): boolean {\n return this.details.existing;\n }\n\n public get version(): string {\n return this.details.version;\n }\n\n public get initialMessages(): ISequencedDocumentMessage[] {\n return this.details.initialMessages;\n }\n\n public get initialSignals(): ISignalMessage[] {\n return this.details.initialSignals;\n }\n\n public get initialClients(): ISignalClient[] {\n return this.details.initialClients;\n }\n\n public get serviceConfiguration(): IClientConfiguration {\n return this.details.serviceConfiguration;\n }\n\n public readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n constructor(\n public details: IConnected,\n ) {\n super();\n }\n\n public submit(documentMessage: IDocumentMessage[]): void {\n // ReplayDocumentDeltaConnection.submit() can't be called - client never sees its own join on,\n // and thus can never move to sending ops.\n throw new Error(\"ReplayDocumentDeltaConnection.submit() can't be called\");\n }\n\n public async submitSignal(message: any) {\n }\n\n private _disposed = false;\n public get disposed() { return this._disposed; }\n public dispose() { this._disposed = true; }\n\n /**\n * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n */\n private async fetchAndEmitOps(\n documentStorageService: IDocumentDeltaStorageService,\n controller: ReplayController,\n ): Promise<void> {\n let done;\n let replayPromiseChain = Promise.resolve();\n\n let currentOp = await controller.getStartingOpSequence();\n\n do {\n const fetchTo = controller.fetchTo(currentOp);\n\n const abortController = new AbortController();\n const stream = documentStorageService.fetchMessages(currentOp + 1, fetchTo, abortController.signal);\n do {\n const result = await stream.read();\n\n if (result.done) {\n // No more ops. But, they can show up later, either because document was just created,\n // or because another client keeps submitting new ops.\n done = controller.isDoneFetch(currentOp, undefined);\n if (!done) {\n await delay(2000);\n }\n break;\n }\n replayPromiseChain = replayPromiseChain.then(\n async () => controller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages));\n\n const messages = result.value;\n currentOp += messages.length;\n done = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n } while (!done);\n\n abortController.abort();\n } while (!done);\n return replayPromiseChain;\n }\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/replay-driver";
|
|
8
|
-
export declare const pkgVersion = "0.
|
|
8
|
+
export declare const pkgVersion = "1.0.2";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,kCAAkC,CAAC;AACvD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,kCAAkC,CAAC;AACvD,eAAO,MAAM,UAAU,UAAU,CAAC"}
|
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,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,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/replay-driver\";\nexport const pkgVersion = \"1.0.2\";\n"]}
|
|
@@ -12,7 +12,6 @@ export declare abstract class ReadDocumentStorageServiceBase implements IDocumen
|
|
|
12
12
|
abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
13
13
|
abstract readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
14
14
|
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
15
|
-
write(tree: api.ITree, parents: string[], message: string, ref: string): Promise<api.IVersion>;
|
|
16
15
|
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
17
16
|
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
18
17
|
get repositoryUrl(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayController.d.ts","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EAClB,MAAM,oCAAoC,CAA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,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAInE,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAInF,IAAW,aAAa,IAAI,MAAM,CAEjC;CACJ;AAED;;;;GAIG;AACH,8BAAsB,gBAAiB,SAAQ,8BAA8B;IACzE;;;;;OAKG;aACa,WAAW,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAEhF;;;OAGG;aACa,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC;IAExD;;;;OAIG;aACa,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAE9D;;;;;;;;OAQG;aACa,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO;IAE/E;;;;;OAKG;aACa,MAAM,CAClB,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,yBAAyB,EAAE,KAAK,IAAI,EACtD,UAAU,EAAE,GAAG,CAAC,yBAAyB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAClE"}
|
package/lib/replayController.js
CHANGED
|
@@ -9,9 +9,6 @@ export class ReadDocumentStorageServiceBase {
|
|
|
9
9
|
async uploadSummaryWithContext(summary, context) {
|
|
10
10
|
return Promise.reject(new Error("Invalid operation"));
|
|
11
11
|
}
|
|
12
|
-
async write(tree, parents, message, ref) {
|
|
13
|
-
return Promise.reject(new Error("Invalid operation"));
|
|
14
|
-
}
|
|
15
12
|
async createBlob(file) {
|
|
16
13
|
return Promise.reject(new Error("Invalid operation"));
|
|
17
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayController.js","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;GAEG;AACH,MAAM,OAAgB,8BAA8B;IAKzC,KAAK,CAAC,wBAAwB,CAAC,OAAyB,EAAE,OAAwB;QACrF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"replayController.js","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;GAEG;AACH,MAAM,OAAgB,8BAA8B;IAKzC,KAAK,CAAC,wBAAwB,CAAC,OAAyB,EAAE,OAAwB;QACrF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QACzC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAA0B;QACnD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAW,aAAa;QACpB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,OAAgB,gBAAiB,SAAQ,8BAA8B;CA0C5E","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IDocumentService,\n IDocumentStorageService,\n ISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport * as api from \"@fluidframework/protocol-definitions\";\n\n/**\n * Partial implementation of IDocumentStorageService\n */\nexport abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {\n public abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;\n public abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;\n public abstract readBlob(blobId: string): Promise<ArrayBufferLike>;\n\n public async uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public get repositoryUrl(): string {\n throw new Error(\"Invalid operation\");\n }\n}\n\n/**\n * Replay controller object\n * It controls where we start (snapshot, local file, no snapshots)\n * As well as dispatch of ops\n */\nexport abstract class ReplayController extends ReadDocumentStorageServiceBase {\n /**\n * Initialize reply controller\n * @param documentService - the real document service\n * @returns - Boolean, indicating if controller should be used.\n * If false is returned, caller should fallback to original storage.\n */\n public abstract initStorage(documentService: IDocumentService): Promise<boolean>;\n\n /**\n * Returns sequence number to start processing ops\n * Should be zero if not using snapshot, and snapshot seq# otherwise\n */\n public abstract getStartingOpSequence(): Promise<number>;\n\n /**\n * Returns last op number to fetch from current op\n * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel\n * @param currentOp - current op\n */\n public abstract fetchTo(currentOp: number): number | undefined;\n\n /**\n * Returns true if no more ops should be processed (or downloaded for future processing).\n * It's called at end of each batch with latest op timestamp.\n * Also it's called when there are no more ops available (lastTimeStamp === undefined).\n * If false is returned and there are no more ops, request for more ops is made every 2 seconds.\n * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel\n * @param currentOp - current op\n * @param lastTimeStamp - timestamp of last op (if more ops are available). Undefined otherwise.\n */\n public abstract isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;\n\n /**\n * Replay batch of ops\n * NOTE: new batch of ops is fetched (fetchTo() & isDoneFetch() APIs are called) while this call is in flights\n * @param emitter - callback to emit ops\n * @param fetchedOps - ops to process\n */\n public abstract replay(\n emitter: (op: api.ISequencedDocumentMessage[]) => void,\n fetchedOps: api.ISequencedDocumentMessage[]): Promise<void>;\n}\n"]}
|
|
@@ -166,8 +166,8 @@ export class ReplayDocumentDeltaConnection extends TypedEventEmitter {
|
|
|
166
166
|
maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,
|
|
167
167
|
summary: {
|
|
168
168
|
idleTime: 5000,
|
|
169
|
-
maxOps: 1000,
|
|
170
169
|
maxTime: 5000 * 12,
|
|
170
|
+
maxOps: 1000,
|
|
171
171
|
maxAckWaitTime: 600000,
|
|
172
172
|
},
|
|
173
173
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAUH,SAAS,GACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAM,OAAO,sBAAuB,SAAQ,gBAAgB;IAMxD,gDAAgD;IAEhD;;;;;;OAMG;IACH,YACoB,UAAkB,EAClB,QAAgB,EAChB,UAAoB;QACpC,KAAK,EAAE,CAAC;QAHQ,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAU;QAbhC,kBAAa,GAAG,CAAC,CAAC;QAetB,IAAI,UAAU,KAAK,IAAI,EAAE;YACrB,qFAAqF;YACrF,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;SACrB;IACL,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,eAAiC;QACtD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,KAAa;QAC5D,OAAO,EAAE,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAAkB;QAC3C,OAAO,OAAO,CAAC,CAAC,CA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I,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;IACtD,GAAG,EAAE,KAAK;CACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n IDocumentDeltaConnection,\n IDocumentDeltaStorageService,\n IDocumentDeltaConnectionEvents,\n IDocumentService,\n} from \"@fluidframework/driver-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IConnected,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n IVersion,\n ScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { delay, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { ReplayController } from \"./replayController\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n private static readonly DelayInterval = 50;\n private static readonly ReplayResolution = 15;\n\n private firstTimeStamp: number | undefined;\n private replayCurrent = 0;\n // Simulated delay interval for emitting the ops\n\n /**\n * Helper class\n *\n * @param replayFrom - First op to be played on socket.\n * @param replayTo - Last op number to be played on socket.\n * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n */\n public constructor(\n public readonly replayFrom: number,\n public readonly replayTo: number,\n public readonly unitIsTime?: boolean) {\n super();\n if (unitIsTime !== true) {\n // There is no code in here to start with snapshot, thus we have to start with op #0.\n this.replayTo = 0;\n }\n }\n\n public async initStorage(documentService: IDocumentService) {\n return true;\n }\n\n public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n return [];\n }\n\n public async getSnapshotTree(version?: IVersion) {\n return version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n }\n\n public async readBlob(blobId: string): Promise<ArrayBufferLike> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public async getStartingOpSequence(): Promise<number> {\n return 0;\n }\n\n public fetchTo(currentOp: number) {\n if (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n return undefined;\n }\n return this.replayTo;\n }\n\n public isDoneFetch(currentOp: number, lastTimeStamp?: number) {\n if (this.replayTo >= 0) {\n if (this.unitIsTime === true) {\n return (\n lastTimeStamp !== undefined\n && this.firstTimeStamp !== undefined\n && lastTimeStamp - this.firstTimeStamp >= this.replayTo);\n }\n return currentOp >= this.replayTo;\n }\n return lastTimeStamp === undefined; // No more ops\n }\n\n public skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {\n if (this.replayFrom <= 0) {\n return 0;\n }\n if (this.unitIsTime === true) {\n for (let i = 0; i < fetchedOps.length; i += 1) {\n const timeStamp = fetchedOps[i].timestamp;\n if (timeStamp !== undefined) {\n if (this.firstTimeStamp === undefined) {\n this.firstTimeStamp = timeStamp;\n }\n if (timeStamp - this.firstTimeStamp >= this.replayFrom) {\n return i;\n }\n }\n }\n } else if (this.replayFrom > this.replayCurrent) {\n return this.replayFrom - this.replayCurrent;\n }\n return 0;\n }\n\n public async replay(\n emitter: (op: ISequencedDocumentMessage[]) => void,\n fetchedOps: ISequencedDocumentMessage[]): Promise<void> {\n let current = this.skipToIndex(fetchedOps);\n\n return new Promise((resolve) => {\n const replayNextOps = () => {\n // Emit the ops from replay to the end every \"deltainterval\" milliseconds\n // to simulate the socket stream\n const currentOp = fetchedOps[current];\n const playbackOps = [currentOp];\n let nextInterval = ReplayControllerStatic.DelayInterval;\n current += 1;\n\n if (this.unitIsTime === true) {\n const currentTimeStamp = currentOp.timestamp;\n if (currentTimeStamp !== undefined) {\n // Emit more ops that is in the ReplayResolution window\n\n while (current < fetchedOps.length) {\n const op = fetchedOps[current];\n if (op.timestamp === undefined) {\n // Missing timestamp, just delay the standard amount of time\n break;\n }\n const timeDiff = op.timestamp - currentTimeStamp;\n if (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n // Time exceeded the resolution window, break out the loop\n // and delay for the time difference.\n nextInterval = timeDiff;\n break;\n }\n if (timeDiff < 0) {\n // Time have regressed, just delay the standard amount of time\n break;\n }\n\n // The op is within the ReplayResolution emit it now\n playbackOps.push(op);\n current += 1;\n }\n\n if (this.firstTimeStamp !== undefined\n && this.replayTo >= 0\n && currentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo) {\n nextInterval = -1;\n }\n }\n }\n scheduleNext(nextInterval);\n emitter(playbackOps);\n };\n const scheduleNext = (nextInterval: number) => {\n if (nextInterval >= 0 && current < fetchedOps.length) {\n setTimeout(replayNextOps, nextInterval);\n } else {\n this.replayCurrent += current;\n resolve();\n }\n };\n scheduleNext(ReplayControllerStatic.DelayInterval);\n });\n }\n}\n\nexport class ReplayDocumentDeltaConnection\n extends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n implements IDocumentDeltaConnection, IDisposable {\n /**\n * Creates a new delta connection and mimics the delta connection to replay ops on it.\n * @param documentService - The document service to be used to get underlying endpoints.\n */\n public static create(\n documentStorageService: IDocumentDeltaStorageService,\n controller: ReplayController): IDocumentDeltaConnection {\n const connection: IConnected = {\n claims: ReplayDocumentDeltaConnection.claims,\n clientId: \"PseudoClientId\",\n existing: true,\n initialMessages: [],\n initialSignals: [],\n initialClients: [],\n maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n mode: \"read\",\n serviceConfiguration: {\n blockSize: 64436,\n maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n summary: {\n idleTime: 5000,\n maxOps: 1000,\n maxTime: 5000 * 12,\n maxAckWaitTime: 600000,\n },\n },\n supportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n version: ReplayDocumentDeltaConnection.replayProtocolVersion,\n };\n const deltaConnection = new ReplayDocumentDeltaConnection(connection);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n deltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n return deltaConnection;\n }\n\n private static readonly replayProtocolVersion = \"^0.1.0\";\n // Since the replay service never actually sends messages the size below is arbitrary\n private static readonly ReplayMaxMessageSize = 16 * 1024;\n\n private static readonly claims: ITokenClaims = {\n documentId: ReplayDocumentId,\n scopes: [ScopeType.DocRead],\n tenantId: \"\",\n user: {\n id: \"\",\n },\n iat: Math.round(new Date().getTime() / 1000),\n exp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n ver: \"1.0\",\n };\n\n public get clientId(): string {\n return this.details.clientId;\n }\n\n public get mode(): ConnectionMode {\n return this.details.mode;\n }\n\n public get claims(): ITokenClaims {\n return this.details.claims;\n }\n\n public get existing(): boolean {\n return this.details.existing;\n }\n\n public get version(): string {\n return this.details.version;\n }\n\n public get initialMessages(): ISequencedDocumentMessage[] {\n return this.details.initialMessages;\n }\n\n public get initialSignals(): ISignalMessage[] {\n return this.details.initialSignals;\n }\n\n public get initialClients(): ISignalClient[] {\n return this.details.initialClients;\n }\n\n public get serviceConfiguration(): IClientConfiguration {\n return this.details.serviceConfiguration;\n }\n\n public readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n constructor(\n public details: IConnected,\n ) {\n super();\n }\n\n public submit(documentMessage: IDocumentMessage[]): void {\n // ReplayDocumentDeltaConnection.submit() can't be called - client never sees its own join on,\n // and thus can never move to sending ops.\n throw new Error(\"ReplayDocumentDeltaConnection.submit() can't be called\");\n }\n\n public async submitSignal(message: any) {\n }\n\n private _disposed = false;\n public get disposed() { return this._disposed; }\n public dispose() { this._disposed = true; }\n\n /**\n * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n */\n private async fetchAndEmitOps(\n documentStorageService: IDocumentDeltaStorageService,\n controller: ReplayController,\n ): Promise<void> {\n let done;\n let replayPromiseChain = Promise.resolve();\n\n let currentOp = await controller.getStartingOpSequence();\n\n do {\n const fetchTo = controller.fetchTo(currentOp);\n\n const abortController = new AbortController();\n const stream = documentStorageService.fetchMessages(currentOp + 1, fetchTo, abortController.signal);\n do {\n const result = await stream.read();\n\n if (result.done) {\n // No more ops. But, they can show up later, either because document was just created,\n // or because another client keeps submitting new ops.\n done = controller.isDoneFetch(currentOp, undefined);\n if (!done) {\n await delay(2000);\n }\n break;\n }\n replayPromiseChain = replayPromiseChain.then(\n async () => controller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages));\n\n const messages = result.value;\n currentOp += messages.length;\n done = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n } while (!done);\n\n abortController.abort();\n } while (!done);\n return replayPromiseChain;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"replayDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAUH,SAAS,GACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAM,OAAO,sBAAuB,SAAQ,gBAAgB;IAMxD,gDAAgD;IAEhD;;;;;;OAMG;IACH,YACoB,UAAkB,EAClB,QAAgB,EAChB,UAAoB;QACpC,KAAK,EAAE,CAAC;QAHQ,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAU;QAbhC,kBAAa,GAAG,CAAC,CAAC;QAetB,IAAI,UAAU,KAAK,IAAI,EAAE;YACrB,qFAAqF;YACrF,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;SACrB;IACL,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,eAAiC;QACtD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,KAAa;QAC5D,OAAO,EAAE,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAAkB;QAC3C,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,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AAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;IACtD,GAAG,EAAE,KAAK;CACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n IDocumentDeltaConnection,\n IDocumentDeltaStorageService,\n IDocumentDeltaConnectionEvents,\n IDocumentService,\n} from \"@fluidframework/driver-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IConnected,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n IVersion,\n ScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { delay, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { ReplayController } from \"./replayController\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n private static readonly DelayInterval = 50;\n private static readonly ReplayResolution = 15;\n\n private firstTimeStamp: number | undefined;\n private replayCurrent = 0;\n // Simulated delay interval for emitting the ops\n\n /**\n * Helper class\n *\n * @param replayFrom - First op to be played on socket.\n * @param replayTo - Last op number to be played on socket.\n * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n */\n public constructor(\n public readonly replayFrom: number,\n public readonly replayTo: number,\n public readonly unitIsTime?: boolean) {\n super();\n if (unitIsTime !== true) {\n // There is no code in here to start with snapshot, thus we have to start with op #0.\n this.replayTo = 0;\n }\n }\n\n public async initStorage(documentService: IDocumentService) {\n return true;\n }\n\n public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n return [];\n }\n\n public async getSnapshotTree(version?: IVersion) {\n return version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n }\n\n public async readBlob(blobId: string): Promise<ArrayBufferLike> {\n return Promise.reject(new Error(\"Invalid operation\"));\n }\n\n public async getStartingOpSequence(): Promise<number> {\n return 0;\n }\n\n public fetchTo(currentOp: number) {\n if (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n return undefined;\n }\n return this.replayTo;\n }\n\n public isDoneFetch(currentOp: number, lastTimeStamp?: number) {\n if (this.replayTo >= 0) {\n if (this.unitIsTime === true) {\n return (\n lastTimeStamp !== undefined\n && this.firstTimeStamp !== undefined\n && lastTimeStamp - this.firstTimeStamp >= this.replayTo);\n }\n return currentOp >= this.replayTo;\n }\n return lastTimeStamp === undefined; // No more ops\n }\n\n public skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {\n if (this.replayFrom <= 0) {\n return 0;\n }\n if (this.unitIsTime === true) {\n for (let i = 0; i < fetchedOps.length; i += 1) {\n const timeStamp = fetchedOps[i].timestamp;\n if (timeStamp !== undefined) {\n if (this.firstTimeStamp === undefined) {\n this.firstTimeStamp = timeStamp;\n }\n if (timeStamp - this.firstTimeStamp >= this.replayFrom) {\n return i;\n }\n }\n }\n } else if (this.replayFrom > this.replayCurrent) {\n return this.replayFrom - this.replayCurrent;\n }\n return 0;\n }\n\n public async replay(\n emitter: (op: ISequencedDocumentMessage[]) => void,\n fetchedOps: ISequencedDocumentMessage[]): Promise<void> {\n let current = this.skipToIndex(fetchedOps);\n\n return new Promise((resolve) => {\n const replayNextOps = () => {\n // Emit the ops from replay to the end every \"deltainterval\" milliseconds\n // to simulate the socket stream\n const currentOp = fetchedOps[current];\n const playbackOps = [currentOp];\n let nextInterval = ReplayControllerStatic.DelayInterval;\n current += 1;\n\n if (this.unitIsTime === true) {\n const currentTimeStamp = currentOp.timestamp;\n if (currentTimeStamp !== undefined) {\n // Emit more ops that is in the ReplayResolution window\n\n while (current < fetchedOps.length) {\n const op = fetchedOps[current];\n if (op.timestamp === undefined) {\n // Missing timestamp, just delay the standard amount of time\n break;\n }\n const timeDiff = op.timestamp - currentTimeStamp;\n if (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n // Time exceeded the resolution window, break out the loop\n // and delay for the time difference.\n nextInterval = timeDiff;\n break;\n }\n if (timeDiff < 0) {\n // Time have regressed, just delay the standard amount of time\n break;\n }\n\n // The op is within the ReplayResolution emit it now\n playbackOps.push(op);\n current += 1;\n }\n\n if (this.firstTimeStamp !== undefined\n && this.replayTo >= 0\n && currentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo) {\n nextInterval = -1;\n }\n }\n }\n scheduleNext(nextInterval);\n emitter(playbackOps);\n };\n const scheduleNext = (nextInterval: number) => {\n if (nextInterval >= 0 && current < fetchedOps.length) {\n setTimeout(replayNextOps, nextInterval);\n } else {\n this.replayCurrent += current;\n resolve();\n }\n };\n scheduleNext(ReplayControllerStatic.DelayInterval);\n });\n }\n}\n\nexport class ReplayDocumentDeltaConnection\n extends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n implements IDocumentDeltaConnection, IDisposable {\n /**\n * Creates a new delta connection and mimics the delta connection to replay ops on it.\n * @param documentService - The document service to be used to get underlying endpoints.\n */\n public static create(\n documentStorageService: IDocumentDeltaStorageService,\n controller: ReplayController): IDocumentDeltaConnection {\n const connection: IConnected = {\n claims: ReplayDocumentDeltaConnection.claims,\n clientId: \"PseudoClientId\",\n existing: true,\n initialMessages: [],\n initialSignals: [],\n initialClients: [],\n maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n mode: \"read\",\n serviceConfiguration: {\n blockSize: 64436,\n maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n summary: {\n idleTime: 5000,\n maxTime: 5000 * 12,\n maxOps: 1000,\n maxAckWaitTime: 600000,\n },\n },\n supportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n version: ReplayDocumentDeltaConnection.replayProtocolVersion,\n };\n const deltaConnection = new ReplayDocumentDeltaConnection(connection);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n deltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n return deltaConnection;\n }\n\n private static readonly replayProtocolVersion = \"^0.1.0\";\n // Since the replay service never actually sends messages the size below is arbitrary\n private static readonly ReplayMaxMessageSize = 16 * 1024;\n\n private static readonly claims: ITokenClaims = {\n documentId: ReplayDocumentId,\n scopes: [ScopeType.DocRead],\n tenantId: \"\",\n user: {\n id: \"\",\n },\n iat: Math.round(new Date().getTime() / 1000),\n exp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n ver: \"1.0\",\n };\n\n public get clientId(): string {\n return this.details.clientId;\n }\n\n public get mode(): ConnectionMode {\n return this.details.mode;\n }\n\n public get claims(): ITokenClaims {\n return this.details.claims;\n }\n\n public get existing(): boolean {\n return this.details.existing;\n }\n\n public get version(): string {\n return this.details.version;\n }\n\n public get initialMessages(): ISequencedDocumentMessage[] {\n return this.details.initialMessages;\n }\n\n public get initialSignals(): ISignalMessage[] {\n return this.details.initialSignals;\n }\n\n public get initialClients(): ISignalClient[] {\n return this.details.initialClients;\n }\n\n public get serviceConfiguration(): IClientConfiguration {\n return this.details.serviceConfiguration;\n }\n\n public readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n constructor(\n public details: IConnected,\n ) {\n super();\n }\n\n public submit(documentMessage: IDocumentMessage[]): void {\n // ReplayDocumentDeltaConnection.submit() can't be called - client never sees its own join on,\n // and thus can never move to sending ops.\n throw new Error(\"ReplayDocumentDeltaConnection.submit() can't be called\");\n }\n\n public async submitSignal(message: any) {\n }\n\n private _disposed = false;\n public get disposed() { return this._disposed; }\n public dispose() { this._disposed = true; }\n\n /**\n * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n */\n private async fetchAndEmitOps(\n documentStorageService: IDocumentDeltaStorageService,\n controller: ReplayController,\n ): Promise<void> {\n let done;\n let replayPromiseChain = Promise.resolve();\n\n let currentOp = await controller.getStartingOpSequence();\n\n do {\n const fetchTo = controller.fetchTo(currentOp);\n\n const abortController = new AbortController();\n const stream = documentStorageService.fetchMessages(currentOp + 1, fetchTo, abortController.signal);\n do {\n const result = await stream.read();\n\n if (result.done) {\n // No more ops. But, they can show up later, either because document was just created,\n // or because another client keeps submitting new ops.\n done = controller.isDoneFetch(currentOp, undefined);\n if (!done) {\n await delay(2000);\n }\n break;\n }\n replayPromiseChain = replayPromiseChain.then(\n async () => controller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages));\n\n const messages = result.value;\n currentOp += messages.length;\n done = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n } while (!done);\n\n abortController.abort();\n } while (!done);\n return replayPromiseChain;\n }\n}\n"]}
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
use_current_ClassDeclaration_FileSnapshotReader(get_old_ClassDeclaration_FileSnapshotReader());
|
|
2
|
-
use_old_ClassDeclaration_FileSnapshotReader(
|
|
2
|
+
use_old_ClassDeclaration_FileSnapshotReader(
|
|
3
|
+
// @ts-expect-error compatibility expected to be broken
|
|
4
|
+
get_current_ClassDeclaration_FileSnapshotReader());
|
|
3
5
|
use_current_InterfaceDeclaration_IFileSnapshot(get_old_InterfaceDeclaration_IFileSnapshot());
|
|
4
6
|
use_old_InterfaceDeclaration_IFileSnapshot(get_current_InterfaceDeclaration_IFileSnapshot());
|
|
5
7
|
use_current_ClassDeclaration_OpStorage(get_old_ClassDeclaration_OpStorage());
|
|
6
|
-
use_old_ClassDeclaration_OpStorage(
|
|
8
|
+
use_old_ClassDeclaration_OpStorage(
|
|
9
|
+
// @ts-expect-error compatibility expected to be broken
|
|
10
|
+
get_current_ClassDeclaration_OpStorage());
|
|
7
11
|
use_current_ClassDeclaration_ReadDocumentStorageServiceBase(get_old_ClassDeclaration_ReadDocumentStorageServiceBase());
|
|
8
|
-
use_old_ClassDeclaration_ReadDocumentStorageServiceBase(
|
|
12
|
+
use_old_ClassDeclaration_ReadDocumentStorageServiceBase(
|
|
13
|
+
// @ts-expect-error compatibility expected to be broken
|
|
14
|
+
get_current_ClassDeclaration_ReadDocumentStorageServiceBase());
|
|
9
15
|
use_current_ClassDeclaration_ReplayController(get_old_ClassDeclaration_ReplayController());
|
|
10
|
-
use_old_ClassDeclaration_ReplayController(
|
|
16
|
+
use_old_ClassDeclaration_ReplayController(
|
|
17
|
+
// @ts-expect-error compatibility expected to be broken
|
|
18
|
+
get_current_ClassDeclaration_ReplayController());
|
|
11
19
|
use_current_ClassDeclaration_ReplayDocumentService(get_old_ClassDeclaration_ReplayDocumentService());
|
|
12
20
|
use_old_ClassDeclaration_ReplayDocumentService(get_current_ClassDeclaration_ReplayDocumentService());
|
|
13
21
|
use_current_ClassDeclaration_ReplayDocumentServiceFactory(get_old_ClassDeclaration_ReplayDocumentServiceFactory());
|
|
14
22
|
use_old_ClassDeclaration_ReplayDocumentServiceFactory(get_current_ClassDeclaration_ReplayDocumentServiceFactory());
|
|
15
23
|
use_current_ClassDeclaration_SnapshotStorage(get_old_ClassDeclaration_SnapshotStorage());
|
|
16
|
-
use_old_ClassDeclaration_SnapshotStorage(
|
|
24
|
+
use_old_ClassDeclaration_SnapshotStorage(
|
|
25
|
+
// @ts-expect-error compatibility expected to be broken
|
|
26
|
+
get_current_ClassDeclaration_SnapshotStorage());
|
|
17
27
|
use_current_ClassDeclaration_StaticStorageDocumentService(get_old_ClassDeclaration_StaticStorageDocumentService());
|
|
18
28
|
use_old_ClassDeclaration_StaticStorageDocumentService(get_current_ClassDeclaration_StaticStorageDocumentService());
|
|
19
29
|
use_current_ClassDeclaration_StaticStorageDocumentServiceFactory(get_old_ClassDeclaration_StaticStorageDocumentServiceFactory());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateReplayDriverPrevious.js","sourceRoot":"","sources":["../../../src/test/types/validateReplayDriverPrevious.ts"],"names":[],"mappings":"AAwBA,+CAA+C,CAC3C,2CAA2C,EAAE,CAAC,CAAC;AAWnD,2CAA2C,CACvC,+CAA+C,EAAE,CAAC,CAAC;AAWvD,8CAA8C,CAC1C,0CAA0C,EAAE,CAAC,CAAC;AAWlD,0CAA0C,CACtC,8CAA8C,EAAE,CAAC,CAAC;AAWtD,sCAAsC,CAClC,kCAAkC,EAAE,CAAC,CAAC;AAW1C,kCAAkC,CAC9B,sCAAsC,EAAE,CAAC,CAAC;AAW9C,2DAA2D,CACvD,uDAAuD,EAAE,CAAC,CAAC;AAW/D,uDAAuD,CACnD,2DAA2D,EAAE,CAAC,CAAC;AAWnE,6CAA6C,CACzC,yCAAyC,EAAE,CAAC,CAAC;AAWjD,yCAAyC,CACrC,6CAA6C,EAAE,CAAC,CAAC;AAWrD,kDAAkD,CAC9C,8CAA8C,EAAE,CAAC,CAAC;AAWtD,8CAA8C,CAC1C,kDAAkD,EAAE,CAAC,CAAC;AAW1D,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,4CAA4C,CACxC,wCAAwC,EAAE,CAAC,CAAC;AAWhD,wCAAwC,CACpC,4CAA4C,EAAE,CAAC,CAAC;AAWpD,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,gEAAgE,CAC5D,4DAA4D,EAAE,CAAC,CAAC;AAWpE,4DAA4D,CACxD,gEAAgE,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-validator in @fluidframework/build-tools.\n */\nimport * as old from \"@fluidframework/replay-driver-previous\";\nimport * as current from \"../../index\";\n\ntype TypeOnly<T> = {\n [P in keyof T]: TypeOnly<T[P]>;\n};\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_FileSnapshotReader\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FileSnapshotReader():\n TypeOnly<old.FileSnapshotReader>;\ndeclare function use_current_ClassDeclaration_FileSnapshotReader(\n use: TypeOnly<current.FileSnapshotReader>);\nuse_current_ClassDeclaration_FileSnapshotReader(\n get_old_ClassDeclaration_FileSnapshotReader());\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_FileSnapshotReader\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FileSnapshotReader():\n TypeOnly<current.FileSnapshotReader>;\ndeclare function use_old_ClassDeclaration_FileSnapshotReader(\n use: TypeOnly<old.FileSnapshotReader>);\nuse_old_ClassDeclaration_FileSnapshotReader(\n get_current_ClassDeclaration_FileSnapshotReader());\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_IFileSnapshot\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IFileSnapshot():\n TypeOnly<old.IFileSnapshot>;\ndeclare function use_current_InterfaceDeclaration_IFileSnapshot(\n use: TypeOnly<current.IFileSnapshot>);\nuse_current_InterfaceDeclaration_IFileSnapshot(\n get_old_InterfaceDeclaration_IFileSnapshot());\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_IFileSnapshot\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IFileSnapshot():\n TypeOnly<current.IFileSnapshot>;\ndeclare function use_old_InterfaceDeclaration_IFileSnapshot(\n use: TypeOnly<old.IFileSnapshot>);\nuse_old_InterfaceDeclaration_IFileSnapshot(\n get_current_InterfaceDeclaration_IFileSnapshot());\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_OpStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_OpStorage():\n TypeOnly<old.OpStorage>;\ndeclare function use_current_ClassDeclaration_OpStorage(\n use: TypeOnly<current.OpStorage>);\nuse_current_ClassDeclaration_OpStorage(\n get_old_ClassDeclaration_OpStorage());\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_OpStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_OpStorage():\n TypeOnly<current.OpStorage>;\ndeclare function use_old_ClassDeclaration_OpStorage(\n use: TypeOnly<old.OpStorage>);\nuse_old_ClassDeclaration_OpStorage(\n get_current_ClassDeclaration_OpStorage());\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_ReadDocumentStorageServiceBase\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReadDocumentStorageServiceBase():\n TypeOnly<old.ReadDocumentStorageServiceBase>;\ndeclare function use_current_ClassDeclaration_ReadDocumentStorageServiceBase(\n use: TypeOnly<current.ReadDocumentStorageServiceBase>);\nuse_current_ClassDeclaration_ReadDocumentStorageServiceBase(\n get_old_ClassDeclaration_ReadDocumentStorageServiceBase());\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_ReadDocumentStorageServiceBase\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReadDocumentStorageServiceBase():\n TypeOnly<current.ReadDocumentStorageServiceBase>;\ndeclare function use_old_ClassDeclaration_ReadDocumentStorageServiceBase(\n use: TypeOnly<old.ReadDocumentStorageServiceBase>);\nuse_old_ClassDeclaration_ReadDocumentStorageServiceBase(\n get_current_ClassDeclaration_ReadDocumentStorageServiceBase());\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_ReplayController\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayController():\n TypeOnly<old.ReplayController>;\ndeclare function use_current_ClassDeclaration_ReplayController(\n use: TypeOnly<current.ReplayController>);\nuse_current_ClassDeclaration_ReplayController(\n get_old_ClassDeclaration_ReplayController());\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_ReplayController\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayController():\n TypeOnly<current.ReplayController>;\ndeclare function use_old_ClassDeclaration_ReplayController(\n use: TypeOnly<old.ReplayController>);\nuse_old_ClassDeclaration_ReplayController(\n get_current_ClassDeclaration_ReplayController());\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_ReplayDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayDocumentService():\n TypeOnly<old.ReplayDocumentService>;\ndeclare function use_current_ClassDeclaration_ReplayDocumentService(\n use: TypeOnly<current.ReplayDocumentService>);\nuse_current_ClassDeclaration_ReplayDocumentService(\n get_old_ClassDeclaration_ReplayDocumentService());\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_ReplayDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayDocumentService():\n TypeOnly<current.ReplayDocumentService>;\ndeclare function use_old_ClassDeclaration_ReplayDocumentService(\n use: TypeOnly<old.ReplayDocumentService>);\nuse_old_ClassDeclaration_ReplayDocumentService(\n get_current_ClassDeclaration_ReplayDocumentService());\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_ReplayDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayDocumentServiceFactory():\n TypeOnly<old.ReplayDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_ReplayDocumentServiceFactory(\n use: TypeOnly<current.ReplayDocumentServiceFactory>);\nuse_current_ClassDeclaration_ReplayDocumentServiceFactory(\n get_old_ClassDeclaration_ReplayDocumentServiceFactory());\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_ReplayDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayDocumentServiceFactory():\n TypeOnly<current.ReplayDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_ReplayDocumentServiceFactory(\n use: TypeOnly<old.ReplayDocumentServiceFactory>);\nuse_old_ClassDeclaration_ReplayDocumentServiceFactory(\n get_current_ClassDeclaration_ReplayDocumentServiceFactory());\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_SnapshotStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_SnapshotStorage():\n TypeOnly<old.SnapshotStorage>;\ndeclare function use_current_ClassDeclaration_SnapshotStorage(\n use: TypeOnly<current.SnapshotStorage>);\nuse_current_ClassDeclaration_SnapshotStorage(\n get_old_ClassDeclaration_SnapshotStorage());\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_SnapshotStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_SnapshotStorage():\n TypeOnly<current.SnapshotStorage>;\ndeclare function use_old_ClassDeclaration_SnapshotStorage(\n use: TypeOnly<old.SnapshotStorage>);\nuse_old_ClassDeclaration_SnapshotStorage(\n get_current_ClassDeclaration_SnapshotStorage());\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_StaticStorageDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_StaticStorageDocumentService():\n TypeOnly<old.StaticStorageDocumentService>;\ndeclare function use_current_ClassDeclaration_StaticStorageDocumentService(\n use: TypeOnly<current.StaticStorageDocumentService>);\nuse_current_ClassDeclaration_StaticStorageDocumentService(\n get_old_ClassDeclaration_StaticStorageDocumentService());\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_StaticStorageDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_StaticStorageDocumentService():\n TypeOnly<current.StaticStorageDocumentService>;\ndeclare function use_old_ClassDeclaration_StaticStorageDocumentService(\n use: TypeOnly<old.StaticStorageDocumentService>);\nuse_old_ClassDeclaration_StaticStorageDocumentService(\n get_current_ClassDeclaration_StaticStorageDocumentService());\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_StaticStorageDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_StaticStorageDocumentServiceFactory():\n TypeOnly<old.StaticStorageDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_StaticStorageDocumentServiceFactory(\n use: TypeOnly<current.StaticStorageDocumentServiceFactory>);\nuse_current_ClassDeclaration_StaticStorageDocumentServiceFactory(\n get_old_ClassDeclaration_StaticStorageDocumentServiceFactory());\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_StaticStorageDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_StaticStorageDocumentServiceFactory():\n TypeOnly<current.StaticStorageDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_StaticStorageDocumentServiceFactory(\n use: TypeOnly<old.StaticStorageDocumentServiceFactory>);\nuse_old_ClassDeclaration_StaticStorageDocumentServiceFactory(\n get_current_ClassDeclaration_StaticStorageDocumentServiceFactory());\n"]}
|
|
1
|
+
{"version":3,"file":"validateReplayDriverPrevious.js","sourceRoot":"","sources":["../../../src/test/types/validateReplayDriverPrevious.ts"],"names":[],"mappings":"AAwBA,+CAA+C,CAC3C,2CAA2C,EAAE,CAAC,CAAC;AAWnD,2CAA2C;AACvC,uDAAuD;AACvD,+CAA+C,EAAE,CAAC,CAAC;AAWvD,8CAA8C,CAC1C,0CAA0C,EAAE,CAAC,CAAC;AAWlD,0CAA0C,CACtC,8CAA8C,EAAE,CAAC,CAAC;AAWtD,sCAAsC,CAClC,kCAAkC,EAAE,CAAC,CAAC;AAW1C,kCAAkC;AAC9B,uDAAuD;AACvD,sCAAsC,EAAE,CAAC,CAAC;AAW9C,2DAA2D,CACvD,uDAAuD,EAAE,CAAC,CAAC;AAW/D,uDAAuD;AACnD,uDAAuD;AACvD,2DAA2D,EAAE,CAAC,CAAC;AAWnE,6CAA6C,CACzC,yCAAyC,EAAE,CAAC,CAAC;AAWjD,yCAAyC;AACrC,uDAAuD;AACvD,6CAA6C,EAAE,CAAC,CAAC;AAWrD,kDAAkD,CAC9C,8CAA8C,EAAE,CAAC,CAAC;AAWtD,8CAA8C,CAC1C,kDAAkD,EAAE,CAAC,CAAC;AAW1D,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,4CAA4C,CACxC,wCAAwC,EAAE,CAAC,CAAC;AAWhD,wCAAwC;AACpC,uDAAuD;AACvD,4CAA4C,EAAE,CAAC,CAAC;AAWpD,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,gEAAgE,CAC5D,4DAA4D,EAAE,CAAC,CAAC;AAWpE,4DAA4D,CACxD,gEAAgE,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-validator in @fluidframework/build-tools.\n */\nimport * as old from \"@fluidframework/replay-driver-previous\";\nimport * as current from \"../../index\";\n\ntype TypeOnly<T> = {\n [P in keyof T]: TypeOnly<T[P]>;\n};\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_FileSnapshotReader\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FileSnapshotReader():\n TypeOnly<old.FileSnapshotReader>;\ndeclare function use_current_ClassDeclaration_FileSnapshotReader(\n use: TypeOnly<current.FileSnapshotReader>);\nuse_current_ClassDeclaration_FileSnapshotReader(\n get_old_ClassDeclaration_FileSnapshotReader());\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_FileSnapshotReader\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FileSnapshotReader():\n TypeOnly<current.FileSnapshotReader>;\ndeclare function use_old_ClassDeclaration_FileSnapshotReader(\n use: TypeOnly<old.FileSnapshotReader>);\nuse_old_ClassDeclaration_FileSnapshotReader(\n // @ts-expect-error compatibility expected to be broken\n get_current_ClassDeclaration_FileSnapshotReader());\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_IFileSnapshot\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IFileSnapshot():\n TypeOnly<old.IFileSnapshot>;\ndeclare function use_current_InterfaceDeclaration_IFileSnapshot(\n use: TypeOnly<current.IFileSnapshot>);\nuse_current_InterfaceDeclaration_IFileSnapshot(\n get_old_InterfaceDeclaration_IFileSnapshot());\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_IFileSnapshot\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IFileSnapshot():\n TypeOnly<current.IFileSnapshot>;\ndeclare function use_old_InterfaceDeclaration_IFileSnapshot(\n use: TypeOnly<old.IFileSnapshot>);\nuse_old_InterfaceDeclaration_IFileSnapshot(\n get_current_InterfaceDeclaration_IFileSnapshot());\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_OpStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_OpStorage():\n TypeOnly<old.OpStorage>;\ndeclare function use_current_ClassDeclaration_OpStorage(\n use: TypeOnly<current.OpStorage>);\nuse_current_ClassDeclaration_OpStorage(\n get_old_ClassDeclaration_OpStorage());\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_OpStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_OpStorage():\n TypeOnly<current.OpStorage>;\ndeclare function use_old_ClassDeclaration_OpStorage(\n use: TypeOnly<old.OpStorage>);\nuse_old_ClassDeclaration_OpStorage(\n // @ts-expect-error compatibility expected to be broken\n get_current_ClassDeclaration_OpStorage());\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_ReadDocumentStorageServiceBase\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReadDocumentStorageServiceBase():\n TypeOnly<old.ReadDocumentStorageServiceBase>;\ndeclare function use_current_ClassDeclaration_ReadDocumentStorageServiceBase(\n use: TypeOnly<current.ReadDocumentStorageServiceBase>);\nuse_current_ClassDeclaration_ReadDocumentStorageServiceBase(\n get_old_ClassDeclaration_ReadDocumentStorageServiceBase());\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_ReadDocumentStorageServiceBase\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReadDocumentStorageServiceBase():\n TypeOnly<current.ReadDocumentStorageServiceBase>;\ndeclare function use_old_ClassDeclaration_ReadDocumentStorageServiceBase(\n use: TypeOnly<old.ReadDocumentStorageServiceBase>);\nuse_old_ClassDeclaration_ReadDocumentStorageServiceBase(\n // @ts-expect-error compatibility expected to be broken\n get_current_ClassDeclaration_ReadDocumentStorageServiceBase());\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_ReplayController\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayController():\n TypeOnly<old.ReplayController>;\ndeclare function use_current_ClassDeclaration_ReplayController(\n use: TypeOnly<current.ReplayController>);\nuse_current_ClassDeclaration_ReplayController(\n get_old_ClassDeclaration_ReplayController());\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_ReplayController\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayController():\n TypeOnly<current.ReplayController>;\ndeclare function use_old_ClassDeclaration_ReplayController(\n use: TypeOnly<old.ReplayController>);\nuse_old_ClassDeclaration_ReplayController(\n // @ts-expect-error compatibility expected to be broken\n get_current_ClassDeclaration_ReplayController());\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_ReplayDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayDocumentService():\n TypeOnly<old.ReplayDocumentService>;\ndeclare function use_current_ClassDeclaration_ReplayDocumentService(\n use: TypeOnly<current.ReplayDocumentService>);\nuse_current_ClassDeclaration_ReplayDocumentService(\n get_old_ClassDeclaration_ReplayDocumentService());\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_ReplayDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayDocumentService():\n TypeOnly<current.ReplayDocumentService>;\ndeclare function use_old_ClassDeclaration_ReplayDocumentService(\n use: TypeOnly<old.ReplayDocumentService>);\nuse_old_ClassDeclaration_ReplayDocumentService(\n get_current_ClassDeclaration_ReplayDocumentService());\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_ReplayDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayDocumentServiceFactory():\n TypeOnly<old.ReplayDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_ReplayDocumentServiceFactory(\n use: TypeOnly<current.ReplayDocumentServiceFactory>);\nuse_current_ClassDeclaration_ReplayDocumentServiceFactory(\n get_old_ClassDeclaration_ReplayDocumentServiceFactory());\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_ReplayDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayDocumentServiceFactory():\n TypeOnly<current.ReplayDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_ReplayDocumentServiceFactory(\n use: TypeOnly<old.ReplayDocumentServiceFactory>);\nuse_old_ClassDeclaration_ReplayDocumentServiceFactory(\n get_current_ClassDeclaration_ReplayDocumentServiceFactory());\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_SnapshotStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_SnapshotStorage():\n TypeOnly<old.SnapshotStorage>;\ndeclare function use_current_ClassDeclaration_SnapshotStorage(\n use: TypeOnly<current.SnapshotStorage>);\nuse_current_ClassDeclaration_SnapshotStorage(\n get_old_ClassDeclaration_SnapshotStorage());\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_SnapshotStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_SnapshotStorage():\n TypeOnly<current.SnapshotStorage>;\ndeclare function use_old_ClassDeclaration_SnapshotStorage(\n use: TypeOnly<old.SnapshotStorage>);\nuse_old_ClassDeclaration_SnapshotStorage(\n // @ts-expect-error compatibility expected to be broken\n get_current_ClassDeclaration_SnapshotStorage());\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_StaticStorageDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_StaticStorageDocumentService():\n TypeOnly<old.StaticStorageDocumentService>;\ndeclare function use_current_ClassDeclaration_StaticStorageDocumentService(\n use: TypeOnly<current.StaticStorageDocumentService>);\nuse_current_ClassDeclaration_StaticStorageDocumentService(\n get_old_ClassDeclaration_StaticStorageDocumentService());\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_StaticStorageDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_StaticStorageDocumentService():\n TypeOnly<current.StaticStorageDocumentService>;\ndeclare function use_old_ClassDeclaration_StaticStorageDocumentService(\n use: TypeOnly<old.StaticStorageDocumentService>);\nuse_old_ClassDeclaration_StaticStorageDocumentService(\n get_current_ClassDeclaration_StaticStorageDocumentService());\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_StaticStorageDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_StaticStorageDocumentServiceFactory():\n TypeOnly<old.StaticStorageDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_StaticStorageDocumentServiceFactory(\n use: TypeOnly<current.StaticStorageDocumentServiceFactory>);\nuse_current_ClassDeclaration_StaticStorageDocumentServiceFactory(\n get_old_ClassDeclaration_StaticStorageDocumentServiceFactory());\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_StaticStorageDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_StaticStorageDocumentServiceFactory():\n TypeOnly<current.StaticStorageDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_StaticStorageDocumentServiceFactory(\n use: TypeOnly<old.StaticStorageDocumentServiceFactory>);\nuse_old_ClassDeclaration_StaticStorageDocumentServiceFactory(\n get_current_ClassDeclaration_StaticStorageDocumentServiceFactory());\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/replay-driver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Document replay version of Socket.IO implementation",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
19
|
-
"build:compile": "concurrently npm:
|
|
19
|
+
"build:compile": "concurrently npm:tsc npm:build:esnext",
|
|
20
20
|
"build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
21
21
|
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
22
22
|
"build:full": "npm run build",
|
|
@@ -30,43 +30,29 @@
|
|
|
30
30
|
"lint:fix": "npm run eslint:fix",
|
|
31
31
|
"tsc": "tsc",
|
|
32
32
|
"tsfmt": "tsfmt --verify",
|
|
33
|
-
"tsfmt:fix": "tsfmt --replace"
|
|
34
|
-
"typetests:gen": "fluid-type-validator -g -d ."
|
|
33
|
+
"tsfmt:fix": "tsfmt --replace"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
38
37
|
"@fluidframework/common-utils": "^0.32.1",
|
|
39
|
-
"@fluidframework/driver-definitions": "^0.
|
|
40
|
-
"@fluidframework/driver-utils": "^0.
|
|
38
|
+
"@fluidframework/driver-definitions": "^1.0.2",
|
|
39
|
+
"@fluidframework/driver-utils": "^1.0.2",
|
|
41
40
|
"@fluidframework/protocol-definitions": "^0.1028.2000",
|
|
42
|
-
"@fluidframework/telemetry-utils": "^0.
|
|
41
|
+
"@fluidframework/telemetry-utils": "^1.0.2"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
44
|
"@fluidframework/build-common": "^0.23.0",
|
|
46
|
-
"@fluidframework/build-tools": "^0.2.
|
|
45
|
+
"@fluidframework/build-tools": "^0.2.71273",
|
|
47
46
|
"@fluidframework/eslint-config-fluid": "^0.28.2000",
|
|
48
|
-
"@fluidframework/replay-driver-previous": "npm:@fluidframework/replay-driver
|
|
47
|
+
"@fluidframework/replay-driver-previous": "npm:@fluidframework/replay-driver@^0.59.0",
|
|
49
48
|
"@microsoft/api-extractor": "^7.22.2",
|
|
50
49
|
"@rushstack/eslint-config": "^2.5.1",
|
|
51
50
|
"@types/mocha": "^9.1.1",
|
|
52
51
|
"@types/nock": "^9.3.0",
|
|
53
52
|
"@types/node": "^14.18.0",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "~5.9.0",
|
|
55
|
-
"@typescript-eslint/parser": "~5.9.0",
|
|
56
53
|
"concurrently": "^6.2.0",
|
|
57
54
|
"copyfiles": "^2.1.0",
|
|
58
55
|
"eslint": "~8.6.0",
|
|
59
|
-
"eslint-plugin-editorconfig": "~3.2.0",
|
|
60
|
-
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
61
|
-
"eslint-plugin-import": "~2.25.4",
|
|
62
|
-
"eslint-plugin-jest": "~26.1.3",
|
|
63
|
-
"eslint-plugin-jsdoc": "~39.3.0",
|
|
64
|
-
"eslint-plugin-mocha": "~10.0.3",
|
|
65
|
-
"eslint-plugin-promise": "~6.0.0",
|
|
66
|
-
"eslint-plugin-react": "~7.28.0",
|
|
67
|
-
"eslint-plugin-tsdoc": "~0.2.14",
|
|
68
|
-
"eslint-plugin-unicorn": "~40.0.0",
|
|
69
|
-
"eslint-plugin-unused-imports": "~2.0.0",
|
|
70
56
|
"mocha": "^10.0.0",
|
|
71
57
|
"nock": "^10.0.1",
|
|
72
58
|
"rimraf": "^2.6.2",
|
|
@@ -74,7 +60,23 @@
|
|
|
74
60
|
"typescript-formatter": "7.1.0"
|
|
75
61
|
},
|
|
76
62
|
"typeValidation": {
|
|
77
|
-
"version": "0.
|
|
78
|
-
"broken": {
|
|
63
|
+
"version": "1.0.0",
|
|
64
|
+
"broken": {
|
|
65
|
+
"ClassDeclaration_FileSnapshotReader": {
|
|
66
|
+
"backCompat": false
|
|
67
|
+
},
|
|
68
|
+
"ClassDeclaration_OpStorage": {
|
|
69
|
+
"backCompat": false
|
|
70
|
+
},
|
|
71
|
+
"ClassDeclaration_ReadDocumentStorageServiceBase": {
|
|
72
|
+
"backCompat": false
|
|
73
|
+
},
|
|
74
|
+
"ClassDeclaration_ReplayController": {
|
|
75
|
+
"backCompat": false
|
|
76
|
+
},
|
|
77
|
+
"ClassDeclaration_SnapshotStorage": {
|
|
78
|
+
"backCompat": false
|
|
79
|
+
}
|
|
80
|
+
}
|
|
79
81
|
}
|
|
80
82
|
}
|
package/src/packageVersion.ts
CHANGED
package/src/replayController.ts
CHANGED
|
@@ -22,10 +22,6 @@ export abstract class ReadDocumentStorageServiceBase implements IDocumentStorage
|
|
|
22
22
|
return Promise.reject(new Error("Invalid operation"));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
public async write(tree: api.ITree, parents: string[], message: string, ref: string): Promise<api.IVersion> {
|
|
26
|
-
return Promise.reject(new Error("Invalid operation"));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
25
|
public async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {
|
|
30
26
|
return Promise.reject(new Error("Invalid operation"));
|
|
31
27
|
}
|
|
@@ -204,8 +204,8 @@ export class ReplayDocumentDeltaConnection
|
|
|
204
204
|
maxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,
|
|
205
205
|
summary: {
|
|
206
206
|
idleTime: 5000,
|
|
207
|
-
maxOps: 1000,
|
|
208
207
|
maxTime: 5000 * 12,
|
|
208
|
+
maxOps: 1000,
|
|
209
209
|
maxAckWaitTime: 600000,
|
|
210
210
|
},
|
|
211
211
|
},
|