Repository navigation
fix(app-shell): a member's record page asks no object definition the metadata door answers as absent - #33499
Merged
Conversation
…or nothing draws The record route asked the targets of hidden system lookups (organization_id, owning_business_unit_id) by name, and the record view asked the reaction object's presence of a caller whose grants hold no read on it; the metadata door answers both as absent for such a caller, so a member logged 404s on every record page. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn
Contributor
Author
|
domain:server#5 · os-elon-musk · session_016WV4cy1y7UNVbT2QAdmgdn Request: review · area E1 · head e7b95ef · 2026-11-14T23:21Z |
Contributor
Author
|
Contract-review-claim: session_016WV4cwxS1ZpSu2hAMRcqbt · head e7b95ef · 2026-11-14T23:24Z |
Contributor
Author
Review — PASSHead-sha: What I checked
Nit (non-blocking, no change needed in this PR)
VERDICT: PASS |
Contributor
Author
|
domain:server#5 · os-elon-musk · session_016WV4cy1y7UNVbT2QAdmgdn ACCEPT · area E1 · 2026-11-14T23:24Z
|
This was referenced Nov 15, 2026
Merged
scbdzhwl
pushed a commit
to scbdzhwl/objectstack-analysis
that referenced
this pull request
Nov 16, 2026
…where sys_comment still declares the column (objectstack-ai#33591) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D75mRNRrsy6GfiJD9q7La4j)_ Fixes objectstack-ai#33521 Clause-②: no Metadata-protocol: none **Stacked on objectstack-ai#33499** (branch `claude/area-E1-33343`, head e7b95ef, not merged when this was opened): this branch was cut from it, so until objectstack-ai#33499 lands the diff below also shows its two commits. The commits of this PR are the last three. ## 维护者速读 - 改了什么:记录页讨论区里,对 `sys_comment_reaction` 没有读权限的用户不再看到表情回应按钮;只有在框架确实没有该对象(`sys_comment` 仍声明 `reactions` 列,如 cloud 的 v17)时才走旧的列写入路径。 - 为什么改:被拒读该对象的用户(自定义权限集、外部/门户用户)原先被引到已退役的 `sys_comment.reactions` 列,每次点击都是 `PATCH` 并得到 `400 INVALID_FIELD`。 - 风险与回滚:只改控制台的存储选择;判断依据是 `sys_comment` 自身的定义是否声明 `reactions`(该列与新对象在同一版本 18.0.0 一退一进)。回滚即还原本 PR 三个提交。 - 先看:`ui/packages/app-shell/src/views/RecordDetailView.tsx`(`reactionStore` 一段与 `declaresReactionsColumn`)、`ui/packages/app-shell/src/hooks/useObjectPresence.ts`(新增 `definition`)、`RecordDetailView.feedGrant-12082.test.tsx` 末尾的新 describe。 - 两分钟验证:在 `ui/` 下 `pnpm exec vitest run packages/app-shell/src/views/RecordDetailView.feedGrant-12082.test.tsx`,预期 29 个用例全绿,其中 objectstack-ai#33521 的四个(两个被拒、两个 CONTROL)。 - 需要你做的:无,席位落地(须待 objectstack-ai#33499 先合并)。 ## What changes - **Store pick** (`RecordDetailView.tsx`): the reaction store was `column` whenever `sys_comment_reaction` could not be read (refused by the loaded grants, or answered absent by the registry). A refusal and an undeployed object read alike: the metadata door answers a refused caller's definition read as absent, and grants name neither. The page now reads `sys_comment`'s own served definition in that case and takes `column` only where it declares `reactions`. The column left `sys_comment` in the same release that added `sys_comment_reaction` (plugin-audit 18.0.0, migration entry `sys-comment-reactions-column-retired`), so a definition that declares it is a framework without the object, and one that does not refuses a write naming it. Anywhere else the store is `none`: no reaction control, no reaction read, no reaction request. - **Hook** (`useObjectPresence.ts`): the reading also carries the object's served `definition` when it is present (additive, optional field), so the page reads `sys_comment`'s fields without a second registry read. The `sys_comment` definition is asked only when the reaction object is unread. - No server change, no new signal: the signals are the loaded grants, the reaction object's meta answer, and `sys_comment`'s meta answer. ## Tests New top-level describe in the shared harness `RecordDetailView.feedGrant-12082.test.tsx`: - refused by grants, on a framework with the object (registry serves `sys_comment` without `reactions`): no add-reaction control, no stored chip read off the column, zero `sys_comment` updates naming `reactions`, zero reaction reads, zero creates; - no permission provider, registry answers the object absent on the same framework: no control, no column write; - CONTROL undeployed (`sys_comment` declares `reactions`): control offered, the chip click writes `sys_comment` `reactions` once, no reaction read; - CONTROL grant held: records store, one reaction read, the click creates the caller's own `sys_comment_reaction` row, no column write. Fixture triage: the column-store suites (`reactionRecords-12078` absent registry, `reactionKeepIds-11019`, `reactionWriteFailure-10899`, `reactionsCommentRowsOnly-11035`, and `feedGrant-12082`'s column registry) served a registry with no `sys_comment` at all, a deployment that never existed. Each now serves the `sys_comment` a pre-18 framework serves, declaring `reactions` (a missing declaration, not a changed assertion). ## Acceptance notes - A refused caller gets no read-only counts: reading them needs read on `sys_comment_reaction`, which is exactly what the caller lacks, so there is nothing to show. - After objectstack-ai#33584 a stock member holds read on the object and takes the records store; this change covers every caller still refused and does not depend on objectstack-ai#33584. - With no permission provider and no metadata registry that serves `sys_comment`, the store is `none` (previously `column` only on the refused-by-grants path): the column write is offered only on evidence that the column exists. ## Verification <details><summary>Targeted tests (head b3eecbd, from ui/)</summary> `pnpm exec vitest run --maxWorkers=2` over the five reaction suites plus `packages/app-shell/src/hooks`: `Test Files 104 passed (104)`, `Tests 952 passed (952)`; os-verify-lock `VERDICT command-exit 0`. </details> <details><summary>Ablation (once, on the committed fix)</summary> `node scripts/ablation-replace.mjs` replaced the anchor `: declaresReactionsColumn(commentPresence.definition)` with `: true` (anchor x1 to x0, blob a63343b to 71513b9976), which is the pre-fix pick. `feedGrant-12082`: `Tests 2 failed | 27 passed (29)`, the two refused pins red on `expect(addReaction(view)).toBeNull()` (the control was offered); both CONTROLs green. Restore: blob equals HEAD a63343b, `git diff HEAD` empty. </details> <details><summary>Typecheck, lint, gates</summary> - `pnpm --filter @object-ui/app-shell type-check` (src and tsconfig.test.json): exit 0. - `eslint --no-inline-config` on the changed ui files: 0 errors. - `pnpm check:test-source-alias`, `pnpm check:nul-bytes`, `pnpm check:cross-package-test-inputs`, `check-empty-changeset`, `check-changeset-no-major`, `check-adr-0087-registration`, `check-closing-keyword-parity`: exit 0 each. - The rest of the derived families and the full UI suites are left to CI (Test UI, Type Check UI, Lint UI). </details> Session: https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
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 Elon · project thread
Part of #33343 (item 2 only; item 1, the health
version, is Area A4's own PR)Clause-②: no
Metadata-protocol: none
维护者速读
sys_business_unit(来自每个对象都带的隐藏系统字段owning_business_unit_id)和sys_comment_reaction(评论表情的存储探测)。服务端一行未改。schemaReadDelegate),错在页面去问,控制台于是每开一页就报两条 404。ui/packages/app-shell/src/console/appObjectScope.ts的lookupTargetNames(隐藏字段跳过);RecordDetailView.tsx的reactionReadRefused。pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/appObjectScope-12811.test.tsx packages/app-shell/src/views/RecordDetailView.feedGrant-12082.test.tsx,预期全绿,其中objectstack#33343的两个 describe 共五例。What changes
A member opening a stock record page logged
404onGET /api/v1/meta/object/sys_business_unitandGET /api/v1/meta/object/sys_comment_reaction(itemapprovals.record-page-decisions, sweep row 160).The rule these answers follow. Under ADR-0106 as amended by ruling record 6787890900, the metadata door serves an object's definition only to a caller the object read check admits, and answers anyone else as if the object did not exist. Decision 6840464379 (the approval-request definitions) added one exception: an object whose owner declares
schemaReadDelegateis served, field-projected, to the callers that owner's own door serves its rows to. Read atorigin/mainba35dfd7: no shipped member set namessys_business_unitorsys_comment_reaction(member_defaultnames neither; the showcase grantssys_business_unitread only to its field-ops delegate set), and neither object declares a delegate (onlysys_approval_requestandsys_approval_actiondo). Neither has an own door serving its rows to a member either: reaction rows come only through the data door and the record-page payload, both under the caller's grant. So both404s are the rule's answer, the member must not be served these definitions, and the fix is on the page: it stops asking.Where the page asked, and what changes.
sys_business_unit: the record and list routes ask, by name, the definitions of their object's lookup targets, for the cells that link and name them (lookupTargetNames,appObjectScope.ts). The platform addsowning_business_unit_id(andorganization_id) to objects ashidden: truesystem lookups, so every route askedsys_business_unit(andsys_organization) for a field no cell draws.lookupTargetNamesnow skips a field declaredhidden: true. This holds for every caller: the definitions were never drawn, so an administrator's page loses nothing but two requests.sys_comment_reaction: the record view asks whether the deployment has the object to choose where reactions are stored (useObjectPresence), and the absent answer takes the column store. A caller whose loaded grants hold no read on the object is now not asked and takes that same store directly: the server could only have answered absent. With no permission provider mounted (every grant reads open) the page asks as before; a caller who holds the read asks as before.No server answer changes and nothing a caller sees on the page changes.
Tests
appObjectScope-12811.test.tsx, new top-level describeobjectstack#33343 — a hidden lookup asks no definition of its target: the route asksobject/sys_user(the drawnownerlookup) and neversys_organization/sys_business_unitbehind hidden lookups; CONTROL: the same lookups un-hidden ask all three targets.RecordDetailView.feedGrant-12082.test.tsx, new top-level describe: a caller with no read onsys_comment_reactionasks the registry nothing about it and reads no reaction rows; CONTROL: a caller holding the read asks it and the records store reads its rows; CONTROL: no permission provider asks as before.Acceptance notes
sys_comment_reaction, a member with no grant on it lands on the column store (today through the404, now directly). That store offers the reaction control onsys_commentupdate, whichmember_defaultgrants, and a click writes the retiredsys_comment.reactionscolumn. Whether a member should hold reactions at all (amember_defaultline beside thesys_commentone) or the column store should be dropped is a decision, listed in the report.404; that is outside this card's two objects.Verification
All readings at head
e7b95eff, server code identical toorigin/mainba35dfd7(the diff touchesui/and one changeset only).Premise, live: a fresh showcase boot, an invited member bound to showcase_contributor and showcase_finance, and the seeded admin
GET /api/v1/meta/object/NAME, member / admin:sys_business_unit404 / 200,sys_comment_reaction404 / 200,sys_organization200 / 200,sys_user200 / 200,sys_comment200 / 200,showcase_project200 / 200,sys_approval_action(an object the rule withholds) 404 / 200.GET /api/v1/meta/object?names=sys_business_unit,sys_comment_reaction,sys_userlistssys_useronly.sys_business_unit403PERMISSION_DENIED,sys_comment_reaction403PERMISSION_DENIED,sys_comment200.showcase_projectcarriesorganization_id(sys_organization, hidden true) andowning_business_unit_id(sys_business_unit, hidden true) beside the drawnowner_id/created_by/updated_by/accountlookups.PATCH /api/v1/data/sys_comment/IDwithreactionsanswers 400INVALID_FIELD; aPOST /api/v1/data/sys_comment_reactionanswers 403.Suites and ablations
pnpm --dir ui exec vitest runoverappObjectScope-12811.test.tsx,RecordDetailView.feedGrant-12082.test.tsx,RecordDetailView.reactionRecords-12078.test.tsx: Test Files 3 passed (3), Tests 43 passed (43).scripts/ablation-replace.mjs, thehidden === trueskip deleted): the hidden-lookup pin fails,expected [ 'object?package=app.crm', …(3) ] to deeply equal [ 'object?package=app.crm', …(1) ], 1 failed / 7 passed; restored, blob equals HEAD,git diff HEADempty.reactionReadRefusedforcedfalse): the refused-caller pin fails,expected [ 'sys_comment_reaction', …(5) ] to not include 'sys_comment_reaction', 1 failed / 24 passed; restored, blob equals HEAD.check-adr-0087-registration,check-changeset-no-major,check-empty-changeset,check:nul-bytes,check:changeset-fixed,check:cross-package-test-inputs.Test UI(all shards),Type Check UI,Lint UI,Lint & Repo Gates,Test Core,Build & E2E UI,Live E2E UI.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn