3D 提交收到无任务状态的成功响应不再静默复位
- 新增 MODEL3D_SUBMISSION_MISSING_QUEUE_STATE_MESSAGE 提示文案 - 空 body 或缺 status 的 2xx 响应改判失败态并保留提示,不再直接回 idle - 补用例断言不再触发排队链路且对话框进入失败态
This commit is contained in:
@@ -14,6 +14,7 @@ import { readEditorModel3dPricingConfig } from '../ImageCanvasGenerationModel';
|
||||
import { isModel3dGenerationMode } from './Model3dGenerationFormModel';
|
||||
import {
|
||||
buildModel3dSubmissionPlan,
|
||||
MODEL3D_SUBMISSION_MISSING_QUEUE_STATE_MESSAGE,
|
||||
model3dQueueStateFromResponse,
|
||||
resolveModel3dGenerationErrorMessage,
|
||||
resolveModel3dResultTitle,
|
||||
@@ -106,9 +107,19 @@ export function useModel3dGenerationTask({
|
||||
idempotencyKey: planResult.plan.requestKey,
|
||||
});
|
||||
const queueState = model3dQueueStateFromResponse(response);
|
||||
if (!queueState) {
|
||||
// 2xx 但没有任务状态(空 body 或缺 status 的 payload)不能当成功静默复位:
|
||||
// 用户既看不到任务也没有任何提示,服务端细节被丢掉。
|
||||
updateCanvasGenerationDialogById(dialogId, (currentDialog) => ({
|
||||
...currentDialog,
|
||||
status: 'failed',
|
||||
composerOpen: true,
|
||||
errorMessage: MODEL3D_SUBMISSION_MISSING_QUEUE_STATE_MESSAGE,
|
||||
}));
|
||||
return;
|
||||
}
|
||||
if (
|
||||
queueState &&
|
||||
(await applyQueuedGeneration(
|
||||
await applyQueuedGeneration(
|
||||
{ queueState },
|
||||
projectId,
|
||||
applyProjectSnapshot,
|
||||
@@ -116,7 +127,7 @@ export function useModel3dGenerationTask({
|
||||
onWalletBalanceMayHaveChanged,
|
||||
onGenerationWarning,
|
||||
dialogId,
|
||||
))
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user