Skip to content

fix: Fixed the save format error when calling the subprocess and the …#364

Merged
horizon220222 merged 1 commit intoiflytek:mainfrom
chunhuitang:fix/frontend
Jan 12, 2026
Merged

fix: Fixed the save format error when calling the subprocess and the …#364
horizon220222 merged 1 commit intoiflytek:mainfrom
chunhuitang:fix/frontend

Conversation

@chunhuitang
Copy link
Copy Markdown
Contributor

…default value of the configuration parameter is empty

📝 Pull Request 描述 | Description

🎯 变更类型 | Change Type

  • ✨ 新功能 | New Feature
  • 🐛 Bug 修复 | Bug Fix
  • 📚 文档更新 | Documentation
  • 🎨 代码格式/样式 | Code Style
  • ♻️ 重构 | Refactoring
  • ⚡ 性能优化 | Performance
  • ✅ 测试相关 | Tests
  • 🔧 配置变更 | Configuration
  • 🔨 构建/CI | Build/CI
  • 🌐 国际化 | Internationalization
  • ⬆️ 依赖升级 | Dependencies Update

🔗 相关 Issue | Related Issues

  • Closes #
  • Related to #

📋 变更内容 | Changes Made

主要变更 | Main Changes

技术细节 | Technical Details


🧪 测试 | Testing

测试环境 | Test Environment

  • Windows 10/11
  • Linux
  • macOS
  • Docker

测试步骤 | Test Steps

测试结果 | Test Results


📸 截图/录屏 | Screenshots/Recordings

变更前 | Before

变更后 | After


⚠️ 破坏性变更 | Breaking Changes

  • 此 PR 包含破坏性变更 | This PR contains breaking changes
破坏性变更详情 | Breaking Changes Details

✅ 检查清单 | Checklist

代码质量 | Code Quality

  • 代码遵循项目的编码规范 | Code follows project coding standards
  • 已进行自我代码审查 | Self-reviewed the code
  • 代码有适当的注释(特别是复杂逻辑)| Code has appropriate comments (especially for complex logic)
  • 更新了相关文档 | Updated relevant documentation
  • 没有产生新的警告 | No new warnings generated

测试 | Testing

  • 添加了相应的测试用例 | Added corresponding test cases
  • 所有测试通过 | All tests pass
  • 手动测试验证通过 | Manual testing verification passed

文档 | Documentation

  • 更新了 README(如需要)| Updated README (if needed)
  • 更新了 API 文档(如需要)| Updated API documentation (if needed)
  • 更新了用户指南(如需要)| Updated user guide (if needed)
  • 更新了 CHANGELOG(如需要)| Updated CHANGELOG (if needed)

其他 | Others

  • 已与相关利益方沟通 | Communicated with relevant stakeholders
  • 不影响现有功能 | Does not affect existing functionality
  • 考虑了向后兼容性 | Considered backward compatibility
  • 考虑了性能影响 | Considered performance impact
  • 考虑了安全性 | Considered security

📌 额外说明 | Additional Notes


🙏 致谢 | Acknowledgements


📖 提示 | Tips:

  • 确保 PR 标题简洁明了,使用动词开头(例如:Add, Fix, Update, Remove)
  • Ensure PR title is concise and clear, starting with a verb (e.g., Add, Fix, Update, Remove)
  • 尽量保持 PR 的改动范围小而集中,便于审查
  • Try to keep PR changes small and focused for easier review
  • 遵循项目的分支管理策略
  • Follow the project's branch management strategy

/cc @maintainers

…default value of the configuration parameter is empty

Signed-off-by: chunhuitang <chunhui.tang.cn@gmail.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @chunhuitang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves critical data formatting and initialization issues within the application's configuration parameter management. It specifically targets problems arising from subprocess calls and empty default parameter values, ensuring that data is consistently structured and correctly serialized/deserialized. The changes enhance the robustness of parameter handling, preventing errors and improving the reliability of the system's configuration.

Highlights

  • Subprocess Parameter Handling: Fixed a save format error that occurred when calling subprocesses, ensuring that configuration parameters are correctly processed and saved.
  • Default Configuration Parameter Initialization: Addressed issues where default configuration parameters were empty, ensuring they are properly initialized to a structured format.
  • Robust varValue Parsing and Defaulting: Implemented logic to safely parse varValue and ensure it is always an array of objects with type and value properties. If the parsed value is illegal or empty, it now defaults to [{ type: OTHER_IN_TYPE, value: '' }].
  • Consistent Array to String Conversion: Modified the convertArrayToVarValue function to return a default JSON string [{ type: OTHER_IN_TYPE, value: '' }] instead of an empty string when the input array is empty or invalid, preventing unexpected empty string values.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a bug concerning the data format of subprocess configuration parameters, particularly when dealing with empty or default values. The changes correctly enforce a consistent, structured array format for these parameters. In ProcessParam.vue, new logic has been introduced to parse, validate, and normalize parameter values, ensuring that any invalid or empty values are wrapped in a default structure. Correspondingly, VarValueEditor.vue has been updated to serialize empty values into this new default structure, moving away from using an empty string.

My review has identified a potential issue within the new validation logic. It appears that non-string illegal values might not be handled correctly, which could lead to downstream errors. I have provided a suggestion to rectify this by ensuring that such values are properly stringified.

Comment on lines +79 to +87
gridData.value = list.filter(item => item.varDirection === 0).map(item => {
const varValue = safeParse(currentParamMap.get(item.id) || defaultParamMap.get(item.id))
const illegal = !isArray(varValue) || isEmpty(varValue) || some(varValue, item => !has(item, 'type') || !has(item, 'value'))

return {
...item,
varValue: illegal ? [{ type: OTHER_IN_TYPE, value: varValue || '' }] : varValue
}
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

When varValue is considered illegal because it's an object or array with an incorrect structure (e.g., [{}]), the expression varValue || '' on line 85 will resolve to the object/array itself. This results in a non-string value for the value property, which might cause rendering issues or unexpected behavior in the VarValueEditor component, as it likely expects a primitive value for OTHER_IN_TYPE.

To ensure the value is always a string in this fallback case, you should stringify object values to prevent potential downstream errors.

  gridData.value = list.filter(item => item.varDirection === 0).map(item => {
    const varValue = safeParse(currentParamMap.get(item.id) || defaultParamMap.get(item.id))
    const illegal = !isArray(varValue) || isEmpty(varValue) || some(varValue, item => !has(item, 'type') || !has(item, 'value'))

    return {
      ...item,
      varValue: illegal ? [{ type: OTHER_IN_TYPE, value: typeof varValue === 'object' && varValue !== null ? JSON.stringify(varValue) : (varValue || '') }] : varValue
    }
  })

@horizon220222 horizon220222 merged commit 8c68f0e into iflytek:main Jan 12, 2026
7 checks passed
maomeideliu pushed a commit to maomeideliu/astron-rpa that referenced this pull request Apr 20, 2026
…default value of the configuration parameter is empty (iflytek#364)

Signed-off-by: chunhuitang <chunhui.tang.cn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants