diff --git a/src/plugins/sync/client/client.ts b/src/plugins/sync/client/client.ts index 7ba39c0a..1b078dc7 100644 --- a/src/plugins/sync/client/client.ts +++ b/src/plugins/sync/client/client.ts @@ -183,13 +183,13 @@ export const connect = (urlInfo: LX.Sync.UrlInfo, keyInfo: LX.Sync.KeyInfo) => { }, onError(error, path, groupName) { const name = groupName ?? '' - log.error(`sync call ${name} ${path.join('.')} error:`, error) - if (groupName == null) return - client?.close(SYNC_CLOSE_CODE.failed) - sendSyncStatus({ - status: false, - message: error.message, - }) + log.r_error(`sync call ${name} ${path.join('.')} error:`, error) + // if (groupName == null) return + // client?.close(SYNC_CLOSE_CODE.failed) + // sendSyncStatus({ + // status: false, + // message: error.message, + // }) }, }) diff --git a/src/plugins/sync/client/modules/dislike/localEvent.ts b/src/plugins/sync/client/modules/dislike/localEvent.ts index 8d6b77ac..6295f46f 100644 --- a/src/plugins/sync/client/modules/dislike/localEvent.ts +++ b/src/plugins/sync/client/modules/dislike/localEvent.ts @@ -1,3 +1,4 @@ +import { SYNC_CLOSE_CODE } from '@/plugins/sync/constants' import { registerDislikeActionEvent } from '../../../dislikeEvent' let unregisterLocalListAction: (() => void) | null @@ -11,7 +12,12 @@ export const registerEvent = (socket: LX.Sync.Socket) => { unregisterEvent() unregisterLocalListAction = registerDislikeActionEvent((action) => { if (!socket.moduleReadys?.dislike) return - void socket.remoteQueueDislike.onDislikeSyncAction(action) + void socket.remoteQueueDislike.onDislikeSyncAction(action).catch(err => { + // TODO send status + socket.moduleReadys.dislike = false + socket.close(SYNC_CLOSE_CODE.failed) + console.log(err.message) + }) }) } diff --git a/src/plugins/sync/client/modules/list/localEvent.ts b/src/plugins/sync/client/modules/list/localEvent.ts index 7987e011..d17d6524 100644 --- a/src/plugins/sync/client/modules/list/localEvent.ts +++ b/src/plugins/sync/client/modules/list/localEvent.ts @@ -1,3 +1,4 @@ +import { SYNC_CLOSE_CODE } from '@/plugins/sync/constants' import { registerListActionEvent } from '../../../listEvent' let unregisterLocalListAction: (() => void) | null @@ -11,7 +12,12 @@ export const registerEvent = (socket: LX.Sync.Socket) => { unregisterEvent() unregisterLocalListAction = registerListActionEvent((action) => { if (!socket.moduleReadys?.list) return - void socket.remoteQueueList.onListSyncAction(action) + void socket.remoteQueueList.onListSyncAction(action).catch(err => { + // TODO send status + socket.moduleReadys.list = false + socket.close(SYNC_CLOSE_CODE.failed) + console.log(err.message) + }) }) }