Skip to content

fix: 节点丢失outgoing和incoming导致流程保存失败 --story=134904270#753

Merged
luofann merged 2 commits into
TencentBlueKing:masterfrom
Mianhuatang8:master_callback_node_no_incoming
Jun 4, 2026
Merged

fix: 节点丢失outgoing和incoming导致流程保存失败 --story=134904270#753
luofann merged 2 commits into
TencentBlueKing:masterfrom
Mianhuatang8:master_callback_node_no_incoming

Conversation

@Mianhuatang8

Copy link
Copy Markdown
Collaborator

Reviewed, transaction id: 81469

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

本次 PR 修复了节点类型为 tasknode 时在 onLocationChange 中无法匹配 switch 分支(case 'task')导致 outgoing/incoming 丢失的问题。修复逻辑正确,变更范围小且聚焦。

有一个小建议关于直接修改 data.type 的副作用风险,详见行内评论。

整体评价:✅ 改动合理,可合入。

end: 'end',
};
if (data.type === 'tasknode') {
data.type = 'task';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ 此处直接修改了 data.typedata 来自 node 参数的解构),会改变源对象的值。如果画布组件在事件触发后仍依赖 node.data.type === 'tasknode' 做其他判断,可能产生副作用。建议改为局部变量:

const normalizedType = data.type === 'tasknode' ? 'task' : data.type;

然后在后续 typeMap[normalizedType]switch(normalizedType) 中使用,避免突变源数据。如果已确认上游不会再读取该字段则可忽略。

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@f8e0e75). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #753   +/-   ##
=========================================
  Coverage          ?   83.10%           
=========================================
  Files             ?      307           
  Lines             ?    18167           
  Branches          ?        0           
=========================================
  Hits              ?    15098           
  Misses            ?     3069           
  Partials          ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

✅ 此问题已在最新提交中解决

上次审查指出的直接修改 data.type 导致源对象突变的问题,已按建议方案修复:使用局部变量 const normalizedType = data.type === 'tasknode' ? 'task' : data.type,避免了副作用风险。

新代码逻辑清晰,变更范围聚焦,无新增问题。

整体评价:✅ 改动合理,可合入。

@luofann luofann merged commit e241eed into TencentBlueKing:master Jun 4, 2026
7 checks passed
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.

3 participants