Skip to content

finding(app-shell): resolveReferenceTos referenceTo branch is unreachable now that the read door strips the key #6528

Description

@claude

Observation from objectui#6519, filed rather than folded in — it is outside that PR's file face.

packages/app-shell/src/views/metadata-admin/inspectors/useDatasetFields.ts:

exportfunctionresolveReferenceTo(def: Record<string,unknown>): string|undefined{constraw=def.reference??def.reference_to??(defasany).referenceTo??(defasany).reference_to_object;

Its only production caller is normalizeObject in the same file, which builds every def through readFields. Since objectui#6519 that door strips referenceTo, so the third branch of the chain can no longer receive a value there — it is reachable only from the unit test that calls the helper directly.

Two things worth judging together rather than deleting on sight:

  1. The dead branch itself.
  2. The shape: a four-spelling tolerant fallback for a relationship target the spec spells reference and refuses in one of the other three spellings by name. A lenient consumer is where a wrong producer hides; reference_to / reference_to_object have not been checked against any current producer, so the honest fix may be to establish which spellings a served document can actually carry and keep only those.

packages/core/src/utils/chart-series.ts carries a sibling canonicalization ("Same canonicalization as the dataset designer's resolveReferenceTo"), so whatever is decided here should be applied there in the same pass.


Generated by Claude Code


Generated by Claude Code

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatched

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions