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.

chore: catch and ignore page upgrade error (#5373)

Joooye_34ec7f73f1688f
diff --git a/packages/common/infra/src/blocksuite/migration/blocksuite.ts b/packages/common/infra/src/blocksuite/migration/blocksuite.ts
index a5e71013ea..7afe5ca74d 100644
--- a/packages/common/infra/src/blocksuite/migration/blocksuite.ts
+++ b/packages/common/infra/src/blocksuite/migration/blocksuite.ts
@@ -28,7 +28,12 @@ export async function migratePages(
const oldVersions = versions?.toJSON() ?? {};
spaces.forEach((space: YDoc) => {
- schema.upgradePage(0, oldVersions, space);
+ try {
+ // Catch page upgrade error to avoid blocking the whole workspace migration.
+ schema.upgradePage(0, oldVersions, space);
+ } catch (e) {
+ console.error(e);
+ }
});
schema.upgradeWorkspace(rootDoc);