diff --git a/apps/core/src/components/migration-fallback.tsx b/apps/core/src/components/migration-fallback.tsx index af8f04719..ee2863d87 100644 --- a/apps/core/src/components/migration-fallback.tsx +++ b/apps/core/src/components/migration-fallback.tsx @@ -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); console.log('download done'); @@ -92,6 +113,7 @@ export const MigrationFallback = function MigrationFallback() { getCurrentRootDoc: async () => workspace.blockSuiteWorkspace.doc, getSchema: () => workspace.blockSuiteWorkspace.schema, }); + await uploadRecursively(workspace.blockSuiteWorkspace.doc); console.log('migration done'); setDone(true); }, [ diff --git a/tests/affine-cloud/e2e/basic.spec.ts b/tests/affine-cloud/e2e/basic.spec.ts index f6c0c29f4..3c080593a 100644 --- a/tests/affine-cloud/e2e/basic.spec.ts +++ b/tests/affine-cloud/e2e/basic.spec.ts @@ -100,7 +100,8 @@ test.describe('basic', () => { timeout: 60000, }); await page.goto( - `${coreUrl}/workspace/${workspaceId}/gc5FeppNDv-hello-world` + // page 'F1SX6cgNxy' has edgeless mode + `${coreUrl}/workspace/${workspaceId}/F1SX6cgNxy` ); await waitForEditorLoad(page); await clickEdgelessModeButton(page);