锁定桌面文件路径错误响应

桌面文件导出路径转换失败转为稳定不可用响应

桌面文件导入路径转换失败转为稳定不可用响应

桌面壳配置检查禁止暴露原生路径错误
This commit is contained in:
2026-06-20 12:32:45 +08:00
parent 12ab5ef064
commit 6ded19d018
2 changed files with 21 additions and 7 deletions
@@ -1086,6 +1086,20 @@ function assertDesktopDialogBoundary(method, functionName, filterLabel, expected
if (fileFunctionBody.includes(blockedDialogAction)) {
throw new Error(`desktop shell ${method} must not use ${blockedDialogAction}`);
}
const unavailableResponse =
action === 'save'
? 'Err(_) => return file_export_unavailable_response(request)'
: 'Err(_) => return file_import_unavailable_response(request)';
if (!fileFunctionBody.includes(unavailableResponse)) {
throw new Error(`desktop shell ${method} must hide native path conversion errors`);
}
if (
fileFunctionBody.includes(
'return failed(request.id.clone(), "host_error", error.to_string())',
)
) {
throw new Error(`desktop shell ${method} must not expose native path errors`);
}
}
function assertNoRawHostContextUrl(urlValue, label) {