Skip to content

createIdentityImportDataSource spreads a class instance, so listImportMappings (a prototype method) is dropped and the saved-mapping selector is hidden on sys_user by accident rather than by the design the file states #7740

Description

@claude

Ungraded and unrouteddomain:*, priority and type are triage's. Filed unassigned from the #14026 measurement round (objectstack-ai/objectui#7738), which met it while measuring something else.

The defect

packages/app-shell/src/views/identityImport.ts, createIdentityImportDataSource, returns:

return {
  ...(base as Record<string, unknown>),
  importRecords,
  createImportJob: undefined,
  getImportJobProgress: undefined,
  getImportJobResults: undefined,
  listImportJobs: undefined,
  cancelImportJob: undefined,
  undoImportJob: undefined,
};

An object spread copies own enumerable properties only. listImportMappings is declared in the class body of ObjectStackAdapter (packages/data-objectstack/src/index.ts:4510, class opened at :2148), so it lives on the prototype and the spread drops it.

⇒ on sys_user, the wizard's data source has no listImportMappings, the feature detection fails, and the saved-mapping selector is hidden by construction.

⭐ Why this is a defect and not a design choice — the file answers that itself

The docblock immediately above the function (:167-168) states the intended mechanism verbatim:

the wizard feature-detects these methods, so clearing them cleanly hides the corresponding UI

⇒ the file's own design is hide by explicit undefined, and it applies that design deliberately to six job methods, each spelled out. listImportMappings is not in that list. It is hidden by an accident of the spread, not by the design the file describes.

So whichever way the design question falls, something here is wrong:

  • if identity import should not offer saved mappings ⇒ the correct expression is listImportMappings: undefined beside the other six, and its absence today is a silent coincidence that the next refactor can flip without anyone noticing;
  • if it should ⇒ the selector is broken on sys_user and nobody can see why, because the adapter degrades a missing method to an empty list.

⚠️ ⛔ This card does not decide which. The design question — whether a saved mapping should apply to identity import at all — is a product call. What it asserts is narrower and measured: the current behaviour is not expressed, it is inherited from a language rule.

Published

Yes, by measurement. The same spread is in @object-ui/app-shell@17.1.0's shipped dist (1 site) — measured by npm pack during the #14026 round.

⛔ What is NOT claimed

⛔ Not that this is the cause of #14026. That card's object is crm_plant_cost, ⛔ not sys_user; this seam cannot produce that capture. It is a separate, real, published instance of the same class — a feature-detected capability lost silently.

⛔ Not that a spread is the wrong idiom generally. It is the wrong idiom for a class instance whose methods are being selectively withheld, which is exactly what this function does.

Re-check

git -C objectui show origin/main:packages/app-shell/src/views/identityImport.ts | grep -n -A12 'return {'
git -C objectui show origin/main:packages/data-objectstack/src/index.ts | grep -n 'async listImportMappings'   # :4510, inside the class opened at :2148

Related

objectstack#14026 (the card the round was measuring) · objectui#7738 (the round's pin) · objectstack#15907 (the producer-side pin residue from the same round).


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions