(changesets: IRemoteChangeset[])
| 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() |
no test coverage detected