mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
feat(server): cleanup gateway code (#6118)
This commit is contained in:
@@ -104,7 +104,7 @@ export class AffineCloudAwarenessProvider implements AwarenessProvider {
|
||||
uint8ArrayToBase64(awarenessUpdate)
|
||||
.then(encodedAwarenessUpdate => {
|
||||
this.socket.emit('awareness-update', {
|
||||
guid: this.workspaceId,
|
||||
workspaceId: this.workspaceId,
|
||||
awarenessUpdate: encodedAwarenessUpdate,
|
||||
});
|
||||
})
|
||||
@@ -120,11 +120,19 @@ export class AffineCloudAwarenessProvider implements AwarenessProvider {
|
||||
};
|
||||
|
||||
handleConnect = () => {
|
||||
this.socket.emit('client-handshake-awareness', {
|
||||
workspaceId: this.workspaceId,
|
||||
version: runtimeConfig.appVersion,
|
||||
});
|
||||
this.socket.emit('awareness-init', this.workspaceId);
|
||||
this.socket.emit(
|
||||
'client-handshake-awareness',
|
||||
{
|
||||
workspaceId: this.workspaceId,
|
||||
version: runtimeConfig.appVersion,
|
||||
},
|
||||
(res: any) => {
|
||||
logger.debug('awareness handshake finished', res);
|
||||
this.socket.emit('awareness-init', this.workspaceId, (res: any) => {
|
||||
logger.debug('awareness-init finished', res);
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
handleReject = (_msg: RejectByVersion) => {
|
||||
|
||||
@@ -42,10 +42,16 @@ export class AffineSyncStorage implements SyncStorage {
|
||||
}
|
||||
|
||||
handleConnect = () => {
|
||||
this.socket.emit('client-handshake-sync', {
|
||||
workspaceId: this.workspaceId,
|
||||
version: runtimeConfig.appVersion,
|
||||
});
|
||||
this.socket.emit(
|
||||
'client-handshake-sync',
|
||||
{
|
||||
workspaceId: this.workspaceId,
|
||||
version: runtimeConfig.appVersion,
|
||||
},
|
||||
(res: any) => {
|
||||
logger.debug('client handshake finished', res);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
handleReject = (message: RejectByVersion) => {
|
||||
|
||||
Reference in New Issue
Block a user