调整项目资源初始化时序
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 4m45s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 4m55s
Project CI / AI game creator shell Rust shard 3/4 (push) Failing after 4m14s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m40s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m24s
Project CI / AI game creator shell Rust crates (push) Successful in 2m26s
Project CI / Native shell tests (push) Failing after 2m2s
Project CI / AI game creator shell web tests (push) Failing after 47s
Project CI / Backend tests (push) Successful in 6m34s
Project CI / Frontend tests (push) Failing after 25m51s
Project CI / Repository checks (push) Failing after 26m1s

延后资源读取调用,避免阻塞 Direct Codex 首回合
This commit is contained in:
2026-09-16 00:28:58 +08:00
parent 2a9035ce20
commit 2e2ff552f7
@@ -2183,14 +2183,17 @@ export default function ProjectDevelopmentView({
hasSnapshot: canReuseSnapshot,
};
});
void invoke<ProjectResourceGraphReadModel>(
'read_local_project_resource_graph',
{
projectPath,
expectedProjectId: manifest.projectId,
resources: resourceGraphInputs,
},
)
const readResourceGraph = () =>
invoke<ProjectResourceGraphReadModel>(
'read_local_project_resource_graph',
{
projectPath,
expectedProjectId: manifest.projectId,
resources: resourceGraphInputs,
},
);
void new Promise<void>((resolve) => setTimeout(resolve, 0))
.then(readResourceGraph)
.then((readModel) => {
if (!cancelled) {
setResourceGraphState({
@@ -7199,41 +7202,42 @@ export default function ProjectDevelopmentView({
setResourceAssetGenerationTasksPanelOpen(false);
resourceAssetGenerationPanelSubmissionRef.current = null;
setResourceAssetGenerationPanelReopen(null);
void (async () => {
const reportUnavailable = () => {
if (!cancelled) {
setResourceWorkbenchNotice(
'生成任务列表读取失败,暂时无法恢复历史任务',
);
}
};
let records: LocalProjectAssetGenerationTaskRecord[];
try {
const response = await invoke<LocalProjectAssetGenerationTaskRecord[]>(
'list_local_project_asset_generations',
{ projectPath },
);
if (!Array.isArray(response)) {
void new Promise<void>((resolve) => setTimeout(resolve, 0)).then(
async () => {
const reportUnavailable = () => {
if (!cancelled) {
setResourceWorkbenchNotice(
'生成任务列表读取失败,暂时无法恢复历史任务',
);
}
};
let records: LocalProjectAssetGenerationTaskRecord[];
try {
const response = await invoke<
LocalProjectAssetGenerationTaskRecord[]
>('list_local_project_asset_generations', { projectPath });
if (!Array.isArray(response)) {
reportUnavailable();
return;
}
records = response;
} catch {
reportUnavailable();
return;
}
records = response;
} catch {
reportUnavailable();
return;
}
if (cancelled) {
return;
}
const restored = mergeResourceCanvasAssetGenerationTasksWithRecords(
resourceAssetGenerationTasksRef.current.filter(
(task) => task.projectId === projectId,
),
records,
);
resourceAssetGenerationTasksRef.current = restored;
setResourceAssetGenerationTasks(restored);
})();
if (cancelled) {
return;
}
const restored = mergeResourceCanvasAssetGenerationTasksWithRecords(
resourceAssetGenerationTasksRef.current.filter(
(task) => task.projectId === projectId,
),
records,
);
resourceAssetGenerationTasksRef.current = restored;
setResourceAssetGenerationTasks(restored);
},
)();
return () => {
cancelled = true;
};