* This is the first message that is sent over a newly established socket connection. And we need * to wait for the response before this client can be used.
()
| 645 | * to wait for the response before this client can be used. |
| 646 | */ |
| 647 | private sendConnectMessage() { |
| 648 | if (this.isConnectedToRoom) { |
| 649 | console.error('sendConnectMessage called while already connected') |
| 650 | return |
| 651 | } |
| 652 | this.debug('sending connect message') |
| 653 | this.latestConnectRequestId = uniqueId() |
| 654 | this.socket.sendMessage({ |
| 655 | type: 'connect', |
| 656 | connectRequestId: this.latestConnectRequestId, |
| 657 | schema: this.store.schema.serialize(), |
| 658 | protocolVersion: getTlsyncProtocolVersion(), |
| 659 | lastServerClock: this.lastServerClock, |
| 660 | }) |
| 661 | } |
| 662 | |
| 663 | /** Switch to offline mode */ |
| 664 | private resetConnection(hard = false) { |
no test coverage detected