Skip to content

[Bulk import] Ingest CSV drops whole columns and blank-means-clear silently no-ops #45

Description

@Exotic209093

Severity

Critical — the automatic REST→Bulk switch at 2,000 rows changes write semantics and loses data.

What happens

  1. recordsToCsv takes headers from Object.keys(records[0]) only. mapRecords omits a key when a cell is blank with "ignore blank" behavior — so if record 0 has a blank Phone, the CSV has no Phone column at all and every other row's Phone value is silently never uploaded.
  2. "Clear field" maps blanks to null, serialized as '' — but Bulk API 2.0 ignores empty values on update and requires #N/A to null a field. Blank-means-clear silently no-ops on the Bulk path while the identical mapping clears correctly via REST JSON null.

Evidence

  • src/services/salesforce/bulk-api.ts:277 (headers from first record; null → '')
  • src/data/mappers/index.ts:127-130 (blank-ignore omits keys)
  • Routing: src/background/index.ts:1661

Suggested fix

Build the header row as the union of keys across all records, emit #N/A for explicit nulls, and quote \r.

Environment

Commit 74cf21b (main), WaveLink 0.6.0. Found in the 2026-08-31 adversarial audit (code-verified).

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

    Labels

    bugSomething isn't working

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions