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(core): fix ios sync (#9782)

EYHNcc2958203b9a
diff --git a/packages/common/nbstore/src/worker/consumer.ts b/packages/common/nbstore/src/worker/consumer.ts
index 0cd2d0b775..409cab58d9 100644
--- a/packages/common/nbstore/src/worker/consumer.ts
+++ b/packages/common/nbstore/src/worker/consumer.ts
@@ -75,6 +75,9 @@ export class WorkerConsumer {
local: new SpaceStorage(
Object.fromEntries(
Object.entries(init.local).map(([type, opt]) => {
+ if (opt === undefined) {
+ return [type, undefined];
+ }
const Storage = this.availableStorageImplementations.find(
impl => impl.identifier === opt.name
);
@@ -92,6 +95,9 @@ export class WorkerConsumer {
new SpaceStorage(
Object.fromEntries(
Object.entries(opts).map(([type, opt]) => {
+ if (opt === undefined) {
+ return [type, undefined];
+ }
const Storage = this.availableStorageImplementations.find(
impl => impl.identifier === opt.name
);
diff --git a/packages/frontend/apps/ios/src/plugins/nbstore/definitions.ts b/packages/frontend/apps/ios/src/plugins/nbstore/definitions.ts
index faf31b3d73..e5347730c5 100644
--- a/packages/frontend/apps/ios/src/plugins/nbstore/definitions.ts
+++ b/packages/frontend/apps/ios/src/plugins/nbstore/definitions.ts
@@ -91,7 +91,7 @@ export interface NbStorePlugin {
permanently: boolean;
}) => Promise<void>;
releaseBlobs: (options: { id: string }) => Promise<void>;
- listBlobs: (options: { id: string }) => Promise<Array<ListedBlob>>;
+ listBlobs: (options: { id: string }) => Promise<{ blobs: Array<ListedBlob> }>;
getPeerRemoteClocks: (options: {
id: string;
peer: string;
diff --git a/packages/frontend/apps/ios/src/plugins/nbstore/index.ts b/packages/frontend/apps/ios/src/plugins/nbstore/index.ts
index 230a9f50c8..23ff58b55c 100644
--- a/packages/frontend/apps/ios/src/plugins/nbstore/index.ts
+++ b/packages/frontend/apps/ios/src/plugins/nbstore/index.ts
@@ -167,7 +167,7 @@ export const NbStoreNativeDBApis: NativeDBApis = {
const listed = await NbStore.listBlobs({
id,
});
- return listed.map(b => ({
+ return listed.blobs.map(b => ({
key: b.key,
mime: b.mime,
size: b.size,