Skip to content

import mapping: no fieldMapping target can build a compound (address) value from separate CSV columns — a dotted target passes validate and dry-run, then fails every row on commit #20149

Description

@objectstack-fleet

Ruled: 5852138019 · letter A · 2026-09-27T03:00Z
Blocked-by: #20150
Seam: spec ImportFieldMappingSchema.target (a declared part of a compound field, field.part) → runtime packages/rest import-mapping.ts applyMappingToRows assembly, and the shared target door in objectstack validate / dryRun

Filing-gate category ① — reproducible platform defect/gap with a named landing (@objectstack/rest import-mapping.ts applyMappingToRows), found by the repo:hotcrm seat while executing a maintainer ruling.
Reader: objectstack triage → the lane that owns packages/rest import mapping (and packages/spec defineMapping if the fix is a new transform). Ruled A (comment 5852138019): a Seam: card in the spec lane, dispatched vertically once #20150 has landed. hotcrm#1836 waits on it with Blocked-by:.
Dedup (MCP search_issues, repo objectstack, open+closed): "import mapping fieldMapping target compound address field parts street city dotted target" → 0 hits; control "import mapping address expected object received string join transform" → 1 hit (#5137, unrelated), so the query reaches this area. Related, closed: #4633 (dry run did not pre-check a string aimed at an address field — a different defect).

What happens (measured on @objectstack/* 17.4.0, by the hotcrm#1836 dev, report hotcrm#1836 comment 5833767403)

A mapping can only write each CSV column to one flat key. Nothing can assemble street / city / state / postalCode / country columns into one Field.address() value.

  • fieldMapping targets mailing_address.street … mailing_address.country against the unchanged customer template (50 rows):
  • Mechanism (read in @objectstack/rest dist, src/import-mapping.ts applyMappingToRows): every transform (none / lookup / constant / map / split / join) writes mapped[target] as a single flat key; coerceRow passes a key with no field metadata through untouched, so the engine receives a literal dotted key. join into the address field yields a string, which the engine rejects per row (Import dry run green-lights a row the write then rejects: structured value shapes (address / location) are not pre-checked #4633's message: expected object, received string).
  • Control: the engine itself accepts the compound value — a nested JSON row (mailing_address: { street, city, … }) imports 1/1 and reads back intact, and the 17.4.0 console renders it as one unit.

Why it matters

A structured address cannot be fed by a spreadsheet at all. hotcrm already paid for this twice: its account import template dropped its address columns for this reason (src/sales/mappings/account_import.mapping.ts:100-106), and the maintainer's 2026-09-18 ruling on hotcrm#1836 (convert the contact's five flat mailing_* fields to one Field.address(), "the customer's template does not change") cannot land.

The three observations, for triage to split or keep together

  1. Capability: a way for a mapping to write into a compound field's parts (a dotted target resolved into a nested value, or a compose transform).
  2. Dry run ≠ commit for a target naming no field (sibling of Import dry run green-lights a row the write then rejects: structured value shapes (address / location) are not pre-checked #4633).
  3. Author-time silence: validate accepts a fieldMapping.target that names no field on the object.

Activity

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

Metadata

Metadata

Labels

area:recordsBusiness objects, records, the views that show data, usable forms, searchdomain:specpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions