fix(core): upload binary after migration (#4241)
This commit is contained in:
@@ -83,6 +83,27 @@ export const MigrationFallback = function MigrationFallback() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const uploadRecursively = async (doc: YDoc) => {
|
||||||
|
{
|
||||||
|
await localProvider.datasource.sendDocUpdate(
|
||||||
|
doc.guid,
|
||||||
|
encodeStateAsUpdate(doc)
|
||||||
|
);
|
||||||
|
console.log('upload indexeddb', doc.guid);
|
||||||
|
if (remoteProvider) {
|
||||||
|
await remoteProvider.datasource.sendDocUpdate(
|
||||||
|
doc.guid,
|
||||||
|
encodeStateAsUpdate(doc)
|
||||||
|
);
|
||||||
|
console.log('upload remote', doc.guid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await Promise.all(
|
||||||
|
[...doc.subdocs].map(async subdoc => {
|
||||||
|
await uploadRecursively(subdoc);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
await downloadRecursively(workspace.blockSuiteWorkspace.doc);
|
await downloadRecursively(workspace.blockSuiteWorkspace.doc);
|
||||||
console.log('download done');
|
console.log('download done');
|
||||||
@@ -92,6 +113,7 @@ export const MigrationFallback = function MigrationFallback() {
|
|||||||
getCurrentRootDoc: async () => workspace.blockSuiteWorkspace.doc,
|
getCurrentRootDoc: async () => workspace.blockSuiteWorkspace.doc,
|
||||||
getSchema: () => workspace.blockSuiteWorkspace.schema,
|
getSchema: () => workspace.blockSuiteWorkspace.schema,
|
||||||
});
|
});
|
||||||
|
await uploadRecursively(workspace.blockSuiteWorkspace.doc);
|
||||||
console.log('migration done');
|
console.log('migration done');
|
||||||
setDone(true);
|
setDone(true);
|
||||||
}, [
|
}, [
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ test.describe('basic', () => {
|
|||||||
timeout: 60000,
|
timeout: 60000,
|
||||||
});
|
});
|
||||||
await page.goto(
|
await page.goto(
|
||||||
`${coreUrl}/workspace/${workspaceId}/gc5FeppNDv-hello-world`
|
// page 'F1SX6cgNxy' has edgeless mode
|
||||||
|
`${coreUrl}/workspace/${workspaceId}/F1SX6cgNxy`
|
||||||
);
|
);
|
||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
await clickEdgelessModeButton(page);
|
await clickEdgelessModeButton(page);
|
||||||
|
|||||||
Reference in New Issue
Block a user