去掉抠图资源编辑调用上冗余的凭据 wrapper
- remove_background_payload 的恢复与派生两处不再套 with_direct_editor_api_credentials_as:整个 payload 已在 bridge_remove_background 的 with_direct_editor_api_credentials 作用域内,内层凭据解析只会命中 override - 因此 ResourceEditError::Other 作为 credentials_error 的分支不可达,删掉以免误导(凭据失败仍按原路径落到 CredentialsUnavailable) - 保留 Box::pin(资源编辑 future 体积问题不变),注释改为同时说明装箱原因与凭据作用域来源
This commit is contained in:
@@ -2568,15 +2568,14 @@ async fn remove_background_payload(
|
||||
return Err(RemoveBackgroundError::DuplicatePendingOperations);
|
||||
}
|
||||
let completed = if let Some(pending) = matching_pending.into_iter().next() {
|
||||
// 资源编辑的 future 很大;装箱后只留一个指针进 `handle_direct_tool_bridge` 的状态机,
|
||||
// 避免把调试测试线程的默认栈顶穿。
|
||||
Box::pin(with_direct_editor_api_credentials_as(
|
||||
resume_local_project_resource_edit_typed(ResumeLocalProjectResourceEditInput {
|
||||
// 资源编辑的 future 很大,装箱避免顶穿 `handle_direct_tool_bridge` 的调试测试线程栈;
|
||||
// 凭据作用域由外层 `with_direct_editor_api_credentials` 覆盖,这里不再套一层。
|
||||
Box::pin(resume_local_project_resource_edit_typed(
|
||||
ResumeLocalProjectResourceEditInput {
|
||||
project_path: state.root.to_string_lossy().into_owned(),
|
||||
expected_project_id: manifest.project_id.clone(),
|
||||
operation_id: pending.operation_id,
|
||||
}),
|
||||
ResourceEditError::Other,
|
||||
},
|
||||
))
|
||||
.await
|
||||
.map_err(RemoveBackgroundError::from_resource_edit_error)?
|
||||
@@ -2610,14 +2609,11 @@ async fn remove_background_payload(
|
||||
background_mode: Some(input.background_mode.clone()),
|
||||
screen_color: input.screen_color.clone(),
|
||||
};
|
||||
// 资源编辑的 future 很大;装箱后只留一个指针进 `handle_direct_tool_bridge` 的状态机,
|
||||
// 避免把调试测试线程的默认栈顶穿。
|
||||
Box::pin(with_direct_editor_api_credentials_as(
|
||||
derive_local_project_resource_typed(request),
|
||||
ResourceEditError::Other,
|
||||
))
|
||||
.await
|
||||
.map_err(RemoveBackgroundError::from_resource_edit_error)?
|
||||
// 资源编辑的 future 很大,装箱避免顶穿 `handle_direct_tool_bridge` 的调试测试线程栈;
|
||||
// 凭据作用域由外层 `with_direct_editor_api_credentials` 覆盖,这里不再套一层。
|
||||
Box::pin(derive_local_project_resource_typed(request))
|
||||
.await
|
||||
.map_err(RemoveBackgroundError::from_resource_edit_error)?
|
||||
};
|
||||
emit_game_creator_manifest_invalidated(&state.root, "direct-background-removal");
|
||||
bridge_completed_resource_result(&state.root, "background-removal", "derive", completed)
|
||||
|
||||
Reference in New Issue
Block a user