fix(infra): avoid data loss (#6111)

This commit is contained in:
EYHN
2024-03-14 06:27:49 +00:00
parent d2bad68b74
commit b9fc848824
6 changed files with 106 additions and 6 deletions

View File

@@ -13,6 +13,9 @@ export function fixWorkspaceVersion(rootDoc: YDoc) {
* Blocksuite just set the value, do nothing else.
*/
function doFix() {
if (meta.size === 0) {
return;
}
const workspaceVersion = meta.get('workspaceVersion');
if (typeof workspaceVersion !== 'number' || workspaceVersion < 2) {
transact(