Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: deepscan issues

linonetwo6296cb09100c
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;
}