Skip to content

fix(studio): OWD overview confirms the controlled-by-parent prerequisite on a 409 DESTRUCTIVE_CHANGE - #27553

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-27458-owd-cbp-prerequisite
Oct 29, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-27458-owd-cbp-prerequisite

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #27458
Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:Studio 记录共享(OWD)总览里把对象设为「受父级控制」保存时,若服务器以 409 DESTRUCTIVE_CHANGE 拒收,面板弹出确认框,点名将被设为必填的主从关系(字段 → 主对象)及服务器的说明;确认即带 force 重发同一保存,取消则什么都不存。
  • 为什么改:此前该 409 只变成一条错误横幅,面板没有任何前进的路,提供的选项根本存不下来。
  • 风险与回滚:仅改前端一个面板的保存路径,服务器守卫不动;force 只在作者确认后、且只加在带主从必填翻转的行上。回滚即 revert 本 PR。
  • 先看:PackageOwdOverviewPanel.tsx 中 doSave 的 catch 分支与新确认框;其次新测试文件;最后 en/zh 文案。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.cbpPrerequisiteConfirm-27458.test.tsx,预期 4 passed。
  • 需要你做的:无,席位落地。

What changes

  • PackageOwdOverviewPanel doSave(force = false): for a row switched to controlled_by_parent, the save records which master_detail fields it makes required (cbpPrerequisite, field → master). When that save is answered 409 with errorCodeIs(e, 'DESTRUCTIVE_CHANGE'), the panel opens a confirm (the existing shared Dialog from @object-ui/components, the same shape PermissionMatrixEditor uses; no new dialog component) naming the relationship and listing the server's issue messages. No error banner is set.
  • Confirm retries the same save with force: true, only on rows that carry the prerequisite. Cancel closes the confirm; nothing is forced, the row stays Unsaved.
  • Any other refusal (including a DESTRUCTIVE_CHANGE on a row with no master-detail flip) keeps the existing formatMetadataError banner.
  • The server's guard is untouched (triage: the 409 stands).
  • Copy: engine.studio.owd.cbpPrereqTitle / cbpPrereqDesc / cbpPrereqConfirm in the studio namespace (en, zh).

Tests

New PackageOwdOverviewPanel.cbpPrerequisiteConfirm-27458.test.tsx, four cases: the 409 opens the confirm naming project → qnine_project and the guard's message with no banner; confirm retries with force and the same body (required: true on the master-detail); cancel saves nothing and leaves the row Unsaved; a 422 still shows the error and opens no confirm.

Readings at e50eba2
  • All OWD panel tests: pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel -> Test Files 9 passed (9), Tests 40 passed (40).
  • Ablation (scripts/ablation-replace.mjs, anchor = the confirm branch's if condition replaced by if (false) {, anchor 1 -> 0, blob 8ea5726e660c -> dac064a26bd7): the 27458 file goes 3 failed | 1 passed (the three confirm legs red, the non-destructive leg green); restored, blob == HEAD, git diff HEAD empty.
  • pnpm --filter @object-ui/app-shell --filter @object-ui/i18n run type-check -> exit 0.
  • pnpm --dir ui exec vitest run packages/i18n/ -> 89 files passed, 1374 tests passed.
  • dispatch-gates --commands: 34 derived commands, all exit 0 (incl. pnpm --dir ui exec vitest run scripts/ 169 files passed); --ran reconciliation 34/34, 0 NOT-MEASURED. pnpm --dir ui run check:new-line-citations -> 0 new citations.

Acceptance notes

  • In a multi-row save the rows are written in order; rows written before the refused one are already saved as drafts when the confirm opens, and confirming re-saves them unchanged. Cancelling leaves those earlier drafts in place (they were not destructive). Single-row behaviour is exactly as the card asks.

Verification

Local subset above; CI owns the full farm.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgXU26UBEjd1KKHgNEx

…ite on a 409 DESTRUCTIVE_CHANGE

Claude-Session: https://claude.ai/code/session_01L6bhgXU26UBEjd1KKHgNEx
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 29, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-sales · session_01L6bhgXU26UBEjd1KKHgNEx

席位核对 · ACCEPT · 2026-10-29T12:51Z

Head-sha: e50eba20be750f923602282186a2a577abf38b9e · card #27458 · claim 6495483088 · dev report on the card.

  • 形态: draft → main, Fixes #27458 only, 5 files (+214/−2), all inside the claimed surface (PackageOwdOverviewPanel.tsx, its new test, studio i18n en/zh, one changeset). check-governed-merges --pr 27553: NOT governed, 216 lines ≤ 3000.
  • 前提实测: seat read of the diff against origin/main: the 409 DESTRUCTIVE_CHANGE is caught only on rows that carry a master-detail flip (cbpPrerequisite), force: true is sent only on the confirmed retry and only on those rows, any other refusal still reaches the existing formatMetadataError banner, the outer finally resets saving. Server guard untouched, per the triage direction. The studio namespace has en/zh only, so the two packs are all of it; engine.cancel exists in both.
  • 门禁 check-runs (pinned to head): 44 success, 11 skipped (opt-in harnesses / shard planners), 0 failed, 0 pending; mergeable_state: clean. Tests: four pins (confirm names project → qnine_project, confirm retries with force and the same body, cancel saves nothing, a 422 keeps the banner); ablation of the confirm branch turns three red, the 422 leg stays green.
  • 接受的偏差: declaration lines before ## 维护者速读 and the session-URL footer, both per os-dev.md (it wins over the order).
  • 范围外去向: multi-row save leaves earlier rows as drafts when the confirm opens → Acceptance notes (non-destructive, by design). Skills-docs: not owed (Metadata-protocol: none).
  • 落地条款: ordinary queue landing; pr_ready + automerge_enable by this seat now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio OWD panel: saving "Controlled by parent" on a detail whose master_detail is not yet required answers 409 DESTRUCTIVE_CHANGE with no way forward

1 participant