Skip to content

Ingest: jsonb field-metadata merge never removes fields that disappeared #172

Description

@jfilter

Found by a multi-agent sweep on 2026-07-21. Reported by hunter agents but never adjudicated — the verifier pass hit a rate limit, so these are unverified, not confirmed. Check each against the code before acting.

  • apps/web/lib/services/schema-builder/schema-builder.ts:395buildManualSchema throws a TypeError on any nested or array-of-object field, so the getSchema() error fallback itself crashes.
  • apps/web/lib/services/schema-detection/utilities/geo.ts:132enrichTagField classifies a column as a tag field when even one value is an array, making the whole column's scalar values unfilterable.
  • apps/web/lib/ingest/fetch-remote-data.ts:406 — the native-CSV excludeFields path uses a bare Papa.unparse and drops columns for ragged CSVs. The web app has an unparseRowsToCsv helper that handles this; this path does not use it.
  • apps/web/lib/jobs/handlers/create-schema-version-job.ts:195 — the jsonb merge of dataset fieldMetadata/fieldTypes never removes fields that disappeared from the source schema.
  • apps/web/lib/jobs/handlers/create-schema-version-job.ts:193 — datasets are written via raw drizzle, bypassing updatedAt and the versions table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions