Skip to content

DataSource.deleteView's declared return is still the narrow { deleted } — consumers through the shared interface cannot see the per-home outcomes #4479 added #4564

Description

@yinlianghui

Follow-up accepted from #4479 / PR #4562's consumer census, filed for the pool (unassigned).

The gap: PR #4562 widened the ObjectStackAdapter's deleteView to return DeleteViewResult { deleted, draft?, published? } (exported from @object-ui/data-objectstack). But packages/types/src/data.ts:538 still declares the shared interface method as deleteView?(objectName, viewName): Promise of the narrow { deleted: boolean }. The adapter's wider return is assignable, so nothing breaks — but a consumer reaching the adapter THROUGH the shared DataSource interface sees only deleted, not the per-home outcomes. Today's single real call site (ObjectView's handleDeleteView) reads nothing, so the gap is latent.

Design question the card carries (dependency direction): data-objectstack depends on types, not vice versa — so the widened shape cannot be imported downward. Either (a) the canonical DeleteViewResult/ViewHomeDeleteOutcome shapes MOVE to packages/types (data.ts), with data-objectstack importing and re-exporting them (entry-reachable growth in both packages ⇒ minor/minor; re-export keeps existing importers compiling), or (b) types re-declares the shape structurally (duplication the one-resolver rule dislikes). (a) looks right; the dispatch should measure whether anything else imports the data-objectstack spellings before moving them.

Small card: types + data-objectstack, one interface line + a type move + pins that the adapter still satisfies the interface and existing importers still compile. Refs: #4479, PR #4562.


Generated by Claude Code

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions