Repository navigation
fix(app-shell): Studio opens no buffer over a dashboard draft the server refuses to read - #29132
Merged
Merged
Conversation
…s to read A pending draft whose audience gate names a capability the author does not hold reads 403. readDraftForSave took that for "no draft", so the Interfaces pillar seeded the leaf from the published layer and the next autosave overwrote the draft unpinned, dropping its gate. The reader now hands a 403 back as `refused`, and the leaf load shows a refusal naming the cause instead of installing a buffer. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jT5xpWAfUCpLoqcxaT
This was referenced Nov 2, 2026
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T08:23ZHead-sha:
|
This was referenced Nov 2, 2026
This was referenced Nov 2, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steedos · project thread
Fixes #29015
Clause-②: no
Metadata-protocol: none
The two lines are copied from the claim (comment 6571613254) and its amendment (comment 6571673304).
维护者速读
requiredPermissions)回 403 的草稿,不再被当成"没有草稿"。Interfaces 里这个项不再打开已发布版本供编辑,改为显示一条拒绝说明,自动保存因此没有可发送的内容。StudioDesignSurface.tsx叶子加载处新增的'refused' in draftRead分支;DraftConflictDialog.tsx的readDraftForSave与isDraftReadRefused;新测试StudioDesignSurface.draftUnreadable-29015.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.draftUnreadable-29015.test.tsx,预期 2 个用例通过。What changes
readDraftForSave(metadata-admin/DraftConflictDialog.tsx) keeps its answer and pin for every outcome, and now also hands a draft read refused403back asrefused.isDraftReadRefusedtells that refusal apart by status. A403on the draft read means the row is there and withheld (the read gate's audience refusal,PERMISSION_DENIED, by design), so it is no absence. Any other failure is handled exactly as before: no answer, no pin, norefused.StudioDesignSurface.tsx) installs no buffer when the draft read carriesrefused. It does not read the published layer to stand in for the draft, so the canvas and inspector show nothing to edit anduseDraftAutoSavehas nothing to send. The refusal strip says the item has an unpublished draft this author may not read, that editing the published version would overwrite it, and that someone who holds the draft's required permissions can edit or publish it. The server's sentence is behind Details.engine.studio.refusal.draftUnreadable, in the studio namespace tables (en,zh).packages/rest/src/meta-item-read-gate.tsis unchanged: the server's403is the designed answer, and the defect was the client reading it as "no draft".Tests
StudioDesignSurface.draftUnreadable-29015.test.tsx, over a server double whose draft read refuses the gated dashboard draft the way the client throws it (status: 403,code: PERMISSION_DENIED):/layersfor the leaf, and after the autosave window has sent no save; the stored draft still carriesrequiredPermissions;If-None-Match: *.DraftConflictDialog.test.tsx: a403read returns{ answer: null, pin: null, refused }; a network failure carries norefused;isDraftReadRefusedis false for a500and fornull.scripts/ablation-replace.mjs, restored to HEAD's blob): with the new leaf-load branch disabled, the refused-leaf case goes red ("Unable to find an element with the text: This item has an unpublished draft…") and the control stays green.Acceptance notes
403draft read as "no draft" sits in otherreadDraftForSavecallers, which this PR does not change: the app navigation load in the same pillar (an app draft carryingrequiredPermissionsis refused the same way, and the nav save goes unpinned), andResourceEditPage,ObjectListViewInspector(list views carry the same gate),StudioBundleItemEditor,PermissionMatrixEditorandObjectHooksPanel. Each can now askrefused; reported to the seat as a family, not filed from here.Verification
All readings are on head
16e3c584, the only commit on the branch, based onorigin/main5d3667e2.Tests
pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.draftUnreadable-29015.test.tsx packages/app-shell/src/views/metadata-admin/DraftConflictDialog.test.tsx: 2 files, 27 tests passed.readDraftForSave,DraftConflictDialogorInterfacesPillar, plus the studio-namespace i18n readers (64 files): 737 tests passed.pnpm --dir ui exec vitest run packages/i18n/: 95 files, 1443 passed, 13 skipped.pnpm --dir ui exec vitest run scripts/: 169 files passed, 2 skipped; 4900 tests passed.git diff HEADempty.Type-check and gates
turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n: 66 of 66 tasks successful.node scripts/pm/dispatch-gates.mjs --commandsderived 34 families for this diff; all 34 ran with exit 0, and--ranreconciled 34 derived, 34 run, 0 NOT MEASURED. The changeset and closing-keyword gates ran against this body.node scripts/check-sdui-manifest.mjs: exit 0 (no registry change).pnpm check:new-line-citations(underui/): 0 new citations.Generated by Claude Code