mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
fix(core): make e2e more stable (#4987)
This commit is contained in:
@@ -43,15 +43,12 @@ export const loader: LoaderFunction = async args => {
|
|||||||
if (!args.params.pageId) {
|
if (!args.params.pageId) {
|
||||||
rootStore.set(currentPageIdAtom, null);
|
rootStore.set(currentPageIdAtom, null);
|
||||||
}
|
}
|
||||||
if (currentMetadata.flavour === WorkspaceFlavour.AFFINE_CLOUD) {
|
const [workspaceAtom] = getBlockSuiteWorkspaceAtom(currentMetadata.id);
|
||||||
const [workspaceAtom] = getBlockSuiteWorkspaceAtom(currentMetadata.id);
|
workspaceLoaderLogger.info('get cloud workspace atom');
|
||||||
workspaceLoaderLogger.info('get cloud workspace atom');
|
|
||||||
|
|
||||||
const workspace = await rootStore.get(workspaceAtom);
|
const workspace = await rootStore.get(workspaceAtom);
|
||||||
if (!workspace.doc.isLoaded) {
|
workspaceLoaderLogger.info('workspace loaded');
|
||||||
await workspace.doc.whenLoaded;
|
if (currentMetadata.flavour === WorkspaceFlavour.AFFINE_CLOUD) {
|
||||||
}
|
|
||||||
workspaceLoaderLogger.info('workspace loaded');
|
|
||||||
return (() => {
|
return (() => {
|
||||||
guidCompatibilityFix(workspace.doc);
|
guidCompatibilityFix(workspace.doc);
|
||||||
const blockVersions = workspace.meta.blockVersions;
|
const blockVersions = workspace.meta.blockVersions;
|
||||||
@@ -66,8 +63,6 @@ export const loader: LoaderFunction = async args => {
|
|||||||
return false;
|
return false;
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
workspaceLoaderLogger.info('done');
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,14 @@ export const createLocalProviders = (): DocProviderCreator[] => {
|
|||||||
return engine.waitForLoadedRootDoc();
|
return engine.waitForLoadedRootDoc();
|
||||||
},
|
},
|
||||||
connect() {
|
connect() {
|
||||||
// TODO: actually connect
|
if (!connected) {
|
||||||
|
engine.start();
|
||||||
|
|
||||||
|
for (const provider of awarenessProviders) {
|
||||||
|
provider.connect();
|
||||||
|
}
|
||||||
|
connected = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
disconnect() {
|
disconnect() {
|
||||||
// TODO: actually disconnect
|
// TODO: actually disconnect
|
||||||
@@ -109,7 +116,14 @@ export const createAffineProviders = (): DocProviderCreator[] => {
|
|||||||
return engine.waitForLoadedRootDoc();
|
return engine.waitForLoadedRootDoc();
|
||||||
},
|
},
|
||||||
connect() {
|
connect() {
|
||||||
// TODO: actually connect
|
if (!connected) {
|
||||||
|
engine.start();
|
||||||
|
|
||||||
|
for (const provider of awarenessProviders) {
|
||||||
|
provider.connect();
|
||||||
|
}
|
||||||
|
connected = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
disconnect() {
|
disconnect() {
|
||||||
// TODO: actually disconnect
|
// TODO: actually disconnect
|
||||||
|
|||||||
Reference in New Issue
Block a user