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

Method handleAcceptCommit

packages/core/src/sync/room.ts:565–582  ·  view source on GitHub ↗
(changesets: IRemoteChangeset[])

Source from the content-addressed store, hash-verified

563
564 @errorCapture<RoomService>()
565 async handleAcceptCommit(changesets: IRemoteChangeset[]) {
566 for (const cs of changesets) {
567 const collaEngine = this.collaEngineMap.get(cs.resourceId)!;
568 if (!collaEngine) {
569 console.log('The room has been switched, the collaEngine is updated');
570 continue;
571 }
572 await collaEngine.handleAcceptCommit(cs);
573 // TODO: There are cookies in changesets to be removed in the middle layer
574 console.log('Data returned successfully: ', cs);
575 if (isClient()) {
576 const customEvent = new CustomEvent(cs.messageId);
577 window.dispatchEvent(customEvent);
578 }
579 }
580
581 this.nextSend();
582 }
583
584 @errorCapture<RoomService>()
585 @socketGuard()

Callers 1

RoomServiceClass · 0.95

Calls 4

isClientFunction · 0.90
getMethod · 0.65
dispatchEventMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected