Skip to content

fix: 节点详情预览图中状态显示错误问题修复 --story=131742471#8210

Merged
luofann merged 2 commits intoTencentBlueKing:masterfrom
Mianhuatang8:master_state_error
Feb 27, 2026
Merged

fix: 节点详情预览图中状态显示错误问题修复 --story=131742471#8210
luofann merged 2 commits intoTencentBlueKing:masterfrom
Mianhuatang8:master_state_error

Conversation

@Mianhuatang8
Copy link
Collaborator

Reviewed, transaction id: 74483

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

代码审查总结

此 PR 修复了节点详情预览图中子流程节点状态显示错误的问题,新增了 getAllChildrenStatus 方法来递归收集所有子节点状态。

⚠️ 逻辑问题 - nodeAddStatus 中使用了固定的全局状态源(约第 1204 行)

当 states[id] 不存在时,递归处理子节点时将传入的 states 参数丢弃,改用 this.nodeDisplayStatus.children 作为状态来源。若调用已处于深层子流程递归中,状态来源将回退至顶层,可能导致跨子流程层级的状态错误混用。建议考虑从当前传入的 states 派生子节点状态,而非重新引用全局数据。

✨ 改进建议 - getAllChildrenStatus 中存在冗余检查(约第 1568 行)

childrenKeys.length === 0 的提前返回可以省略,空数组上的 forEach 本身是无操作的,移除后代码更简洁。


整体逻辑清晰,递归收集子节点状态的思路合理;主要需关注 states 传递链路的状态来源一致性。

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.16%. Comparing base (b380f04) to head (416d153).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8210      +/-   ##
==========================================
- Coverage   58.30%   58.16%   -0.14%     
==========================================
  Files         677      678       +1     
  Lines       37046    37203     +157     
==========================================
+ Hits        21599    21639      +40     
- Misses      15447    15564     +117     

see 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b380f04...416d153. Read the comment docs.

🚀 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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

代码审查总结

此 PR 为子流程节点状态显示问题的修复,新增 getAllChildrenStatus 递归收集子节点状态,思路合理。

已有审查问题状态

上一轮审查中提到的两个问题(状态来源固定为顶层、冗余长度检查)在当前 diff 中尚未修改,问题依然存在。

⚠️ 逻辑问题(第 1202 行)— 仍需关注

nodeAddStatus 调用时始终传入 this.getAllChildrenStatus(this.nodeDisplayStatus.children),即固定引用顶层状态。当节点处于多层嵌套子流程时(如 A->B->C),处理 B 的子节点仍引用 A 的顶层数据,可能导致跨层级状态混用或找不到正确状态。建议传入当前节点自身的 children status 而非始终用顶层数据。

✨ 改进建议(第 1576 行)

getAllChildrenStatus 中 Object.keys(nodeStatus.children).length > 0 的判断可以省略——空对象上的 forEach 本身是无操作的,移除后逻辑不变但代码更简洁。


整体改动范围小,新增方法结构清晰;主要需关注多层嵌套时 states 传递链路的状态来源一致性。

@luofann luofann merged commit 1591c8e into TencentBlueKing:master Feb 27, 2026
8 of 9 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