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

Method fetchMissVersion

packages/core/src/engine/engine.ts:291–305  ·  view source on GitHub ↗

* @param startRevision inclusive * @param endRevision exclusive

(startRevision: number, endRevision: number)

Source from the content-addressed store, hash-verified

289 * @param endRevision exclusive
290 */
291 private async fetchMissVersion(startRevision: number, endRevision: number): Promise<IRemoteChangeset[]> {
292 console.log('fetchingMissVersion', this.resourceId, startRevision, endRevision);
293 const result = await DatasheetApi.fetchChangesets<IChangesetPack>(this.resourceId, this.resourceType,
294 startRevision, endRevision, this.getState().pageParams.nodeId, this.getState().pageParams.shareId);
295 if (result.data.success) {
296 console.log('fetchMissVersion success: ', result.data.data);
297
298 if (endRevision - startRevision !== result.data.data.length) {
299 throw new Error(t(Strings.error_the_length_of_changeset_is_inconsistent));
300 }
301 return result.data.data;
302 }
303
304 throw new Error(t(Strings.error_occurred_while_requesting_the_missing_version));
305 }
306
307 /**
308 * The backend actively pushes changesets submitted by others

Callers 2

checkMissChangesMethod · 0.95
checkLocalDiffChangesMethod · 0.95

Calls 2

tFunction · 0.90
logMethod · 0.45

Tested by

no test coverage detected