Skip to content

Bug: CSV import error row numbers skip blank lines and identify the wrong spreadsheet row #3581

Closed

Description

@yannickmonney

Found during the local Tale fleet audit. P3 · confirmed parser defect.

Source: 44e0dcf254975286c0e9dea443b5cd1ca6b23347. No production testing or writes.

Users correcting a partially imported file are directed to the wrong row; each blank line shifts later server/parser refusals farther. Excel already preserves rowNum correctly.

Reproduce:

  1. Use CSV: header line1; Okay,1,1 line2; blank line3; Broken,not-number,2 line4.
  2. Parse/import products and inspect the repairable price refusal.

Expected: Error identifies row4, where the invalid price is located.

Observed: rowErrors reports row3, a blank row; omitted blank lines are lost before firstLine+index calculates the row.

The assigned auditor and independent parent rerun both executed the production parser and import mappers with actual SheetJS-generated CSV/XLSX bytes. The browser file picker and database import were not exercised. The local Bun FileReader adapter only delivered File bytes to the existing callbacks.

Reproduction output:

{
  "id": "CSV_BLANK_LINE",
  "expected": {
    "refusedRow": 4
  },
  "actual": {
    "data": [
      {
        "name": "Okay",
        "stock": 1,
        "price": 1,
        "currency": "USD"
      }
    ],
    "rows": [
      2
    ],
    "errors": [],
    "rowErrors": [
      {
        "row": 3,
        "field": "price",
        "reason": "notNumber"
      }
    ]
  }
}

Source locations:

Acceptance: Preserve source row/line positions through empty-line skipping. A refusal after the blank line must identify physical row4, with further blank/leading lines covered.

Deduplication: No matching issue found in the cached repository inventory or focused GitHub search.

Local evidence: tale-100-findings/settings-import-probe.ts and settings-import-parent-rerun.log in the audit notes.

Activity

  1. added a commit that references this issue on Oct 8, 2026
    85360da
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

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions