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

This commit is contained in:
Joooye_34 2023-12-21 14:27:07 +00:00
parent cfb77e8243
commit ec7f73f168
No known key found for this signature in database
GPG Key ID: 3645F0B246B8EFC7

View File

@ -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);