fix(workspace): fix sync stuck (#5762)

* remove MultipleBatchSyncSender
* add timeout (30 seconds) on socket.emit
This commit is contained in:
EYHN
2024-02-01 06:58:09 +00:00
parent aa33bf60d6
commit 799fa9cfa6
4 changed files with 185 additions and 321 deletions
@@ -32,12 +32,13 @@ export class AffineCloudAwarenessProvider implements AwarenessProvider {
window.addEventListener('beforeunload', this.windowBeforeUnloadHandler);
this.socket.connect();
this.socket.on('connect', () => this.handleConnect());
this.socket.emit('client-handshake-awareness', this.workspaceId);
this.socket.emit('awareness-init', this.workspaceId);
if (this.socket.connected) {
this.handleConnect();
} else {
this.socket.connect();
}
}
disconnect(): void {
removeAwarenessStates(