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(electron): incorrect db rows docId when doing trim (#7008)

pengx1796cdb041c67b
diff --git a/packages/frontend/electron/src/helper/db/workspace-db-adapter.ts b/packages/frontend/electron/src/helper/db/workspace-db-adapter.ts
index 1802f076fb..328b5cd98c 100644
--- a/packages/frontend/electron/src/helper/db/workspace-db-adapter.ts
+++ b/packages/frontend/electron/src/helper/db/workspace-db-adapter.ts
@@ -107,7 +107,7 @@ export class WorkspaceSQLiteDB {
logger.debug(`trim ${this.workspaceId}:${dbID} ${count}`);
const updates = await this.adapter.getUpdates(dbID);
const update = mergeUpdate(updates.map(row => row.data));
- const insertRows = [{ data: update, dbID }];
+ const insertRows = [{ data: update, docId: dbID }];
await this.adapter?.replaceUpdates(dbID, insertRows);
logger.debug(`trim ${this.workspaceId}:${dbID} successfully`);
return update;