MCPcopy Create free account
hub / github.com/apitable/apitable / deOpBuffer

Method deOpBuffer

packages/core/src/engine/buffer_storage.ts:183–194  ·  view source on GitHub ↗

* @description reads the data of opBuffer and clears the opBuffer, * Considering the delay of the network layer, the front end cannot receive the ack in time, * here will save a copy of the opsBuffer data in the storage * @param {number} revision * @returns * @memberof Engine

(revision: number)

Source from the content-addressed store, hash-verified

181 * @memberof Engine
182 */
183 deOpBuffer(revision: number) {
184 const ops = this.opBuffer;
185 // reset opBuffer
186 this.opBuffer = [];
187
188 // set localChangeset
189 if (!ops.length) {
190 this.localPendingChangeset = undefined;
191 return;
192 }
193 this.localPendingChangeset = BufferStorage.ops2Changeset(ops, revision, this.resourceId, this.resourceType);
194 }
195
196 static ops2Changeset(ops: IOperation[], revision: number, resourceId: string, resourceType: ResourceType): ILocalChangeset {
197 const messageId = generateRandomString();

Callers 2

getNextChangesetMethod · 0.80
checkLocalDiffChangesMethod · 0.80

Calls 1

ops2ChangesetMethod · 0.80

Tested by

no test coverage detected