fix: edge case when upgrading page (#4283)

This commit is contained in:
X1a0t 2023-09-08 15:43:18 +08:00 committed by GitHub
parent f9eea85577
commit 157ce7ac69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -506,7 +506,11 @@ export async function forceUpgradePages(
const schema = options.getSchema();
const oldVersions = versions.toJSON();
spaces.forEach((space: Doc) => {
schema.upgradePage(oldVersions, space);
try {
schema.upgradePage(oldVersions, space);
} catch (e) {
console.error(`page ${space.guid} upgrade failed`, e);
}
});
const newVersions = getLatestVersions(schema);
meta.set('blockVersions', new YMap(Object.entries(newVersions)));