Skip to content

fix(frontend): 处理 WorkflowRun 乐观锁与跨资源冲突对账 - #356

Merged
minorcell merged 11 commits into
1024XEngineer:mainfrom
xyh202131:fix/frontend-workflow-run-optimistic-lock
Aug 18, 2026
Merged

fix(frontend): 处理 WorkflowRun 乐观锁与跨资源冲突对账#356
minorcell merged 11 commits into
1024XEngineer:mainfrom
xyh202131:fix/frontend-workflow-run-optimistic-lock

Conversation

@xyh202131

@xyh202131 xyh202131 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

改动内容

  • WorkflowRun 更新请求回传当前 version,并把后端业务 409 映射为明确的乐观锁冲突错误
  • Quick Start 与 Workflow Editor 统一展示冲突提示、阻止继续修改,并提供整页加载最新版本入口
  • 修复自动推进、路由切换、StrictMode 重放及旧 Session 异步回调造成的状态污染
  • 角色母版确认与 Character 绑定合并为一次 WorkflowRun 保存,避免第二次保存冲突后流程卡死
  • Workflow Editor 的审核发布并入同一个 Session 命令;资产写入失败时按最新 WorkflowRun 状态精确补偿
  • 对“后端已保存但响应丢失”和“另一客户端已完成同一目标”进行回读对账,避免误报冲突或误删有效资产

对齐依据

配合后端 PR #345 的 WorkflowRun 乐观锁契约,前端以后端返回的版本号为准。

验证

  • npm run lint -- --deny-warnings
  • npm run typecheck
  • npm run test:coverage:51 个测试文件,561 项通过,4 项跳过
  • npm run build
  • 本次改动文件通过 oxfmt --check
  • 按 Codecov patch 口径本地估算约 88.28%

Closes #205

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 18, 2026 2:37am

@github-actions

Copy link
Copy Markdown

⚠️ @xyh202131,此 PR 尚未关联 issue。请在 PR 描述中使用 Closes #123 等关闭关键字,或通过 Development 侧栏关联对应 issue。

fennoai[bot]

This comment was marked as outdated.

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

@minorcell

minorcell commented Aug 18, 2026

Copy link
Copy Markdown
Member

⚠️ @xyh202131,此 PR 尚未关联 issue。请在 PR 描述中使用 Closes #123 等关闭关键字,或通过 Development 侧栏关联对应 issue。

@xyh202131 修改下你的 PR Body,这样才会在PR合并时自动关闭 issue。Close #123

Comment thread frontend/src/entities/workflow-run/api.ts
Comment thread frontend/src/pages/workflow-editor/index.tsx Outdated
Comment thread frontend/src/pages/workflow-editor/runtime.ts Outdated
@minorcell

Copy link
Copy Markdown
Member

/review

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the fixed PR diff across the WorkflowRun API/controller, Quick Start recovery flow, and Workflow Editor session/view orchestration. The optimistic-lock reconciliation paths are generally coherent, but the editor still leaves one asset-upload path active after a conflict.

Verification: targeted frontend tests could not run because the checkout has no usable Vitest installation (vitest: Permission denied, and the package module is absent).

Comment thread frontend/src/pages/workflow-editor/index.tsx
@minorcell
minorcell merged commit 63e4d77 into 1024XEngineer:main Aug 18, 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.

fix(frontend): workflow-run PATCH 请求未携带 version,后端乐观锁形同虚设

2 participants