Skip to content

[P1][bug] CSV import has no row-size cap or file-size cap; parseCSV on 10 GB file hangs renderer #366

Closed

Description

@EVWorth

Context

CSV import path. Per docs/audits/import.md F4.

Problem

src/lib/csv-parser.ts:8-18 parseCSV has no limits. src/components/import/ImportDialog.tsx:80-95 calls api.readFileContents which reads entire file into memory. For multi-GB CSV renderer is dead before user sees column-mapping step. Same class as backup F2.

Files

  • src/lib/csv-parser.ts:8-18
  • src/components/import/ImportDialog.tsx:80-95

Repro

  1. Try to import a 5 GB CSV file
  2. Observe renderer freeze before preview pane renders

Expected

Streaming CSV import that reads in chunks; renderer stays responsive.

Proposed fix

M: add api.readFilePreview(path, max_bytes) reading first 1 MB. Add import_csv_stream(connection_id, target_table, mapping, path, batch_size) that reads in chunks and bulk-inserts.

Acceptance

5 GB synthetic CSV opens dialog without freezing renderer; preview shows first 1 MB; user can configure row cap.

Needs human verify

yes

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/import
    on Jul 31, 2026
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

    area/importauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions