From 6296cb09100ca5561c0319775f4eff028a2fa346 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Fri, 10 Feb 2023 17:33:47 +0800 Subject: [PATCH] fix: deepscan issues --- .../provider/tauri-ipc/blocksuite-provider/blob.ts | 12 +++++------- packages/data-center/src/provider/tauri-ipc/index.ts | 3 +++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/data-center/src/provider/tauri-ipc/blocksuite-provider/blob.ts b/packages/data-center/src/provider/tauri-ipc/blocksuite-provider/blob.ts index 6791983998..23994590e8 100644 --- a/packages/data-center/src/provider/tauri-ipc/blocksuite-provider/blob.ts +++ b/packages/data-center/src/provider/tauri-ipc/blocksuite-provider/blob.ts @@ -1,6 +1,6 @@ import { BlobSyncState } from '@blocksuite/store'; import * as ipcMethods from '../ipc/methods.js'; -import { BlobOptionsGetter, Signal } from '@blocksuite/store'; +import { Signal } from '@blocksuite/store'; import type { BlobProvider, BlobSyncStateChangeEvent, @@ -41,12 +41,10 @@ export class IPCBlobProvider implements BlobProvider { }); // Make a Blob from the bytes const blob = new Blob([new Uint8Array(blobArray)], { type: 'image/bmp' }); - if (blob) { - this.signals.onBlobSyncStateChange.emit({ - id, - state: BlobSyncState.Success, - }); - } + this.signals.onBlobSyncStateChange.emit({ + id, + state: BlobSyncState.Success, + }); return window.URL.createObjectURL(blob); } diff --git a/packages/data-center/src/provider/tauri-ipc/index.ts b/packages/data-center/src/provider/tauri-ipc/index.ts index 32739f385d..2b4f4637d5 100644 --- a/packages/data-center/src/provider/tauri-ipc/index.ts +++ b/packages/data-center/src/provider/tauri-ipc/index.ts @@ -163,6 +163,9 @@ export class TauriIPCProvider extends LocalProvider { update: Array.from(update), id, }); + if (!success) { + throw new Error(`YDoc update failed, id: ${id}`); + } } return workspaceUnit; }