Repository navigation
fix(app-shell): the record page draws the record the server served to a pending approver with no object read - #39739
Conversation
…bject read (red) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvMXrDPhCt3pGziYWE
…reader the answer grants no read on Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvMXrDPhCt3pGziYWE
…over Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvMXrDPhCt3pGziYWE
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibz12BVzo6a9hKybbEd 席位核对L1-b · 2026-12-04T18:51Z · REWORK · head
Rework (one item, a real red this PR causes):
Same claim, same dev. Re-run shard 2/16 locally on the new head and quote its count. |
…eads opens The control mounted the request page without ApprovalRecordReads and pinned the request's own row stripped to its id. Since the record page leaves the reads of its own object to the server once the row is served and the answer grants no read on it (the rulings on objectstack#26180 and #39485, applied by reading 7419067633), that premise is superseded: the page draws the request's own fields there too. The control now pins both halves: the page's own served row is drawn (title and step), and the Timeline, a related list of the other approval object, draws no row without ApprovalRecordReads. Measured as a real control: with ApprovalRecordReads mounted over the same routes it goes red (the Timeline draws 'Budget checked'). The old wire assertion (no GET of the actions route) is replaced by the drawn-rows assertion: on main the tab's count badge reads that route too, so the wire assertion only held by timing. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvMXrDPhCt3pGziYWE
… Timeline test reads its route The control without ApprovalRecordReads now also asserts the page offers no edit control for the request (reads only). The Timeline test asserts its rows came from the actions route, which uses the wire helper the rewritten control no longer read (TS6133 in Type Check UI). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvMXrDPhCt3pGziYWE
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibz12BVzo6a9hKybbEd 席位核对L1-b · 2026-12-04T19:25Z · ACCEPT · head
For the seat (no rework), on the dev's Acceptance note: the served row now also feeds a declared action's |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvMXrDPhCt3pGziYWE Landing · 2026-12-04T19:26Z · head
State: ready + auto-merge through the merge queue. |
Requested by Tesla · project thread
Fixes #39709
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
RecordDetailView(the record page) now draws the row the server served when both of these hold, and only then:/auth/me/permissionsanswer grants noreadon the page's object.That is the pending approver whose read comes from the approval (rulings 6429330267 on #26180 and 7402324742 on #39485, applied by the decision reading 7419067633 on #39709). Under those two conditions:
readablePageRecord, which feeds the title, the breadcrumb andRecordContext.data) is the served row as served, instead of the row folded through the client's field mirror (readableRow), which stripped every field for an object the answer does not name;ServerReadScopenaming only the page's own object, so the blocks'check(object, 'read')/checkField(object, field, 'read')answer "allowed" for that object, for that page.Kept exactly as before:
create/update/delete/export, fieldwrite/create,getFieldPermissions,effectiveObjects. The header Edit/Delete gates, inline edit and actions read the enclosing answer (computed above the scope);canOnObject, above the scope), and the scope names no child object;RecordPageDrawerHostrenders them beside the page tree, outside the scope) and every other page;Keyed on the server's answer only (row held + answer silent), never on a client reading of who approves what. No change to
ServerReadScope.tsx,AppContent.tsx, the permissions endpoint or spec.The scope element is mounted on every record page, with an empty object list unless both conditions hold, so the page tree keeps its shape: a conditional wrapper would remount every block of the page when the read lands and again on every re-read (the record-load effect passes through
loading). With no object named it changes no verdict.Tests
New top-level block
RecordDetailView.approverServedRow-39709inRecordDetailView.harness.test.tsx(the component's shared harness), real record page under a realMePermissionsProvider:readable: false, on a backend that does not strip (the field rides the row): the field stays off the page, and Edit is present (which also proves the Edit probe sees the button);record-not-found.Red first on
origin/main3adf532 (commit 65e526e): approver cases red (expected 'Contract CT-1' to contain 'Supply contract'), controls green.Ablations (each restored from the commit, `git status --porcelain` empty after)
expected 'ContractSupply contractCommentsDetail…' to contain 'Net 30 days'(title drawn, fields not): the mount is load-bearing for the body;expected 'Contract CT-1' to contain 'Supply contract': the bypass is load-bearing for the title;expected 'ContractSupply contractCommentsEditDe…' not to contain 'Merger planned': the scope never reaches a reader whose answer grants the read.Local runs
vitest run packages/app-shell/src/views/RecordDetailView(all 104 files): 905 passed;vitest run packages/app-shell/src/console packages/app-shell/src/views/recordDrawerStack packages/app-shell/src/views/approval-decision: 313 files, 2724 passed;origin/main(which brought fix(approvals): draw the served snapshot to an approver whose read comes from the approval #39736):RecordDetailView.harness,approval-decision,RecordDetailView.approval*: 17 files, 267 passed;pnpm --filter @object-ui/app-shell type-check(both tsconfigs): exit 0.The whole
@object-ui/app-shellsuite was not run locally (over the container's foreground limit): CITest UI.Acceptance notes
Server-side pin not in this PR's file surface: no test on
mainpins a field hidden by field-level security staying stripped on the approval-admitted read (the decision reading's ADR-0124 D5 item). This page draws what was served, so that strip is the server's guarantee; carrier: the seat.Under the scope the client's field read mirror is off for the page's object, explicit
readable: falseentries included (asServerReadScopedocuments); the boundary is the server's masker.Lookup display names for the approver: the record read's
$expandis still field-gated by the enclosing answer before the row arrives, so for this reader it expands nothing and lookups draw their ids. Not changed here (it would ask the server for more before knowing the read is admitted).An authored page block inside the scope that lists the page's own object (a self-referencing related list placed by the page itself) would ask
checkunder the scope; the data API confines that read to the vouched record ids. The default related-list derivation is unaffected (decided above the scope).ApprovalRecordReads (
AppContent.tsx) and the record page's own-object scope (serverReadsRecord) now overlap on the approval request record page's own row; ApprovalRecordReads stays load-bearing for the Timeline (sys_approval_action) and for request reads on other objects' pages. Follow-up: decide whether the request page's own-row half of ApprovalRecordReads is redundant; not removed here.The served row also feeds declared-action
visiblepredicates: an action whose predicate reads a field can now show to an approver with no client read on the object. Permission verdicts (update, delete…) are unchanged and the server refuses the write.Rework (L1-b 7421035995): the objectui#13324 console control is rewritten for the new rule (page draws its served row; no edit control; the
sys_approval_actionTimeline draws no rows without ApprovalRecordReads, ablation-proven), not skipped or deleted.Verification
Risk-ordered first reads:
RecordDetailView.tsxhunk atserverReadsRecord(the two conditions), then thepageTreemount, then the harness block.Two-minute check:
cd ui/packages/app-shell && pnpm exec vitest run --root ../.. packages/app-shell/src/views/RecordDetailView.harness.test.tsx -t approverServedRow: 4 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibvMXrDPhCt3pGziYWE