Skip to content

A fourth loader in metadata-admin widgets.tsx swallows a failed field fetch into an empty field list — FieldSelectorWidget #5227

Description

@os-support-ai

Found while implementing objectui#5170 (PR objectui#5226), which fixed the three option-picker loaders in ResourceEditPage.tsx and the Audit tab. Filed unassigned for PM triage — deliberately not fixed in that PR, see "Why not folded in" below.

The reading

packages/app-shell/src/views/metadata-admin/widgets.tsx, inside FieldSelectorWidget (locate by text, not by line number):

setLoading(true);fetch(`/api/v1/objects/${objectName}/fields`).then(r=>r.json()).then(data=>{setFields(data.fields||[]);setLoading(false);}).catch(err=>{console.error('Failed to load fields:',err);setFields([]);setLoading(false);});

This is the same defect class objectui#5170 and objectui#5169 were filed for: the catch writes setFields([]) — the exact value a successful response with no fields writes — and clears the loading flag. The picker then renders as a completed, empty field list.

Why it is a separate card and not part of #5170

It is a fourth loader, and it shares nothing with the three that card named:

So it needs its own loader rewrite and its own render wiring, not a line in an existing one. #5170's declared completion scope was the three option-picker loaders and their render sites; this one is outside it and would have widened that PR's verification surface without being covered by either card's acceptance criteria.

Shape, if it is taken

The same one, already landed twice in this directory: the four-arm LoadState union in views/metadata-admin/loadState.ts (added by PR objectui#5226, mirroring the union objectui#5110 landed for the References panel), plus the shared PickerLoadFailure render that PR added for the other pickers. Both exist now, so this is wiring rather than design. Worth also fixing the missing r.ok check while in there, since the current code cannot tell a refusal from an answer at all.

Dedup

Searched open issues for FieldSelectorWidget by name, for the field-fetch loader by path, and for the failure-rendered-as-empty family in widgets.tsx; nothing covering it. Control: the same search family returns objectui#5040 and objectui#4871 (both real metadata-admin widget cards, and #4871 closed), so the zero is a measurement rather than a dead query. No duplicate.

Deliberately filed standalone rather than as a sub-issue of objectui#5170: #5170's completion scope is the three ResourceEditPage loaders, and its PR is up. This loader is not inside that scope — it only shares its class.

Related

objectui#5170 and objectui#5169 (same class, fixed together in PR objectui#5226) · objectui#5110 (the union this shape comes from) · ADR-0110 D3, "a miss and a fault are different facts"

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions