Skip to content

[finding] record:line_items issues getObjectSchema(undefined) for a panel whose childObject is unset, instead of declining to fetch #6188

Description

@yinlianghui-tw

Found during the scope sweep for #5940 and deliberately left unfixed there — that card's scope was object-master-detail-form's detail-collection resolution, and #5940's dispatch order named other unresolved-sub-key sites as file-not-fix.

Fact (objectui origin/main @ b37d3f0)

LineItemsPanel (registered as record:line_items) reads schema.childObject and hands it to the data layer with no guard on it being resolved:

packages/plugin-form/src/LineItemsPanel.tsx:110-118

useEffect(() => {
const ds: any = dataSource;
if (!ds || typeof ds.getObjectSchema !== 'function') return;
let cancelled = false;
ds.getObjectSchema(schema.childObject)
.then((s: any) => { if (!cancelled) setChildSchema(s ?? null); })
.catch(() => { if (!cancelled) setChildSchema(null); });
return () => { cancelled = true; };
}, [dataSource, schema.childObject]);

The effect guards the data source (ds, and that getObjectSchema is callable) but never the argument. A panel authored without childObject therefore asks the backend for an object literally named undefined; the .catch turns whatever comes back into a null schema, so the symptom is a silently unsanitized child grid rather than a visible error.

Why this is the same defect class as #5940, filed separately

Identical shape, identical key name, same package — and the same in-repo precedent settles it: RelatedList declines when it cannot scope ("has no referenceField/parentId — refusing to fetch all rows", RelatedList.tsx:498), and after #5940MasterDetailForm's detail resolve effect declines on this exact key. MasterDetailForm's other effect — the child-schema cache — has always spelled it .filter(Boolean). So three sites in this package now decline and this one does not.

Not folded into #5940 because that would have widened a scoped card into a sweep, and because the two blocks differ in one way worth a reading before anyone edits: record:line_items is bound to an existing parent record, so whether an unset childObject is reachable at all through the registered authoring surface (vs. only through direct component use) has not been measured here. That measurement is what this card is for.

Not verified here

Related: #5940 (same decline-to-fetch decision, object-master-detail-form), #3838 and #3840 (same family — an unresolved optional sub-key reaching a read unguarded).

Metadata

Metadata

Labels

domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repofindingpm:dispatched

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions