Repository navigation
fix(console): a child written through an authored related list refreshes the record page's header - #27106
Conversation
…hes the record page's header The record page re-read its record on a child write only for the children the relationship graph derives. An authored page's related-list blocks and reference-rail entries can list a child whose FK opts out of the derived lists, so a create through that list left the header's rollup stale until a reload. The child-write subscription now also watches the children the page itself lists. Claude-Session: https://claude.ai/code/session_01JQwxbZdCt7JoRJa32i5BHs Co-Authored-By: Claude <noreply@anthropic.com>
|
Two
Neither file is in this PR's tree; CI picked them up from The fix is the open draft #27103, which adds (Edited: the first version of this comment lost its code spans to a shell quoting slip.) Update, head 074f09f (
This PR does not touch that file or the report index. On Generated by Claude Code |
席位核对ACCEPT · seat 席位意见:记录页写入子记录后重读父记录(objectui#12244)原先只监听关系图推导出的相关列表;页面作者自己放的相关列表块和引用栏条目里的子对象(外键设了
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 40648195810 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Warren · project thread
Fixes #26890
Clause-②: no
Metadata-protocol: none
维护者速读
relatedList: false的子对象,这时它不在推导集合里,经该列表新建、编辑或删除子记录后,表头的汇总值(如报价总额)要刷新页面才会变。RecordDetailView.tsx中relatedChildObjectsKey那一段;新文件recordPageChildObjects.ts;RecordDetailView.authoredChildWriteRefreshesParent-26890.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/RecordDetailView.authoredChildWriteRefreshesParent-26890.test.tsx,预期 4 个测试全绿。What changes
recordPageChildObjects(page)beside the view: the child objects a record page lists itself, read from everyrecord:related_listblock (properties.objectName, or the node'sdataSource.objectbinding that the block's element data-source gate maps ontoobjectName) and everyrecord:reference_railentry'sobjectName, at any depth of the page. Sorted and deduplicated.RecordDetailView's child-write subscription (objectui#12244) now watches the union of the derived related lists' children and those, still keyed by content (AGENTS.md chore: version packages #10). Nothing else in the view moves.Why
objectui#12244 re-reads the parent on a child write, but it watched only the children
deriveRelatedListsderives from the relationship graph. An authored record page declares its own lists, and a child it lists there need not be derived: its FK can opt out of the derived lists withrelatedList: false, the authored page then being the only place the child is shown. A create, edit or delete through such a list reached the invalidation bus under the child's name and matched nothing, so the header kept the pre-write rollup until a reload, as the card reports.Reproduced first on
origin/maincbb3a1a1with the new test file: the create, update/delete and rail cases were red (expected 1 to be 2parent reads). A one-off control copy of the same file withoutrelatedList: false(child derivable from the graph) was green on those three cases on the same tree, so the gap is specific to a child the authored page alone declares. HotCRM's own quote-line metadata was not read here (it lives outside this repository), so whether its FK carriesrelatedList: falseis not measured; the fix covers the shape the dispatch named.Tests
RecordDetailView.authoredChildWriteRefreshesParent-26890.test.tsx(4 tests, real page + real MutationEvent bridge, a fake backend that recomputes the rollup): a create of a line listed only by the authored related list re-reads the parent once and the header shows the new total in place; an update and a delete each re-read it; a write to a child listed only in the reference rail re-reads it; a write to a child that points at the parent but is listed nowhere does not.recordPageChildObjects.test.ts(2 tests): every related list and rail entry at any depth including thedataSource.objectarm, sorted and once; other blocks' objects (element:chart,record:line_items) and non-string values are not named.RecordDetailView.childWriteRefreshesParent-12244.test.tsxstill green (5/5) beside the new file., ...authoredChildObjects])replaced inRecordDetailView.tsxviascripts/ablation-replace.mjs(anchor 1 → 0, mutation blob landed, restored blob equal to HEAD,git diff HEADempty), the new page file goes 3 failed / 1 passed: create, update/delete and rail red, the scope control green.Acceptance notes
record:line_itemson a record page is not added: its save writes the parent leg too, which the record's own invalidation already catches.Verification
On head
24529675(main merged): 24 gates derived bynode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, exits captured before any pipe;check-sdui-manifest0. 23 exit 0;pnpm --dir ui exec vitest run scripts/exited 1 on three tests incheck-i18n-dead-keys.test.tsandcheck-vi-mock-inherit.test.tsthat timed out at 15 s while another suite shared the box (5031 others passed); those two files rerun alone: 223/223 passed.--ranreconciles 24 derived / 24 run / 0 NOT-MEASURED. The wholeRecordDetailView*suite plus the helper test: 76 files, 505 tests passed. Extra:pnpm --filter @object-ui/app-shell run type-check0, eslint on the four touched files 0 errors (warnings pre-existing, none on touched lines),pnpm --dir ui run check:new-line-citations0 new.@object-ui/app-shellisprivate: true, soskip-changeset.Generated by Claude Code