Skip to content

fix(import): reject malformed and invalid catalog CSV values #248

Description

@khaira777

Summary

Catalog CSV import accepts negative and partially parsed numeric values, silently accepts unclosed quoted fields, and reports reactivated add-ons as created. This can corrupt product/add-on financial fields and produce misleading import results.

Current behavior

  • main/routes/menu-csv.ts:271-292,388-434 uses permissive parseFloat handling and accepts negative monetary values.
  • main/routes/menu-csv.ts:13-49 does not reject EOF while inside a quoted field.
  • Reactivated groups/add-ons are not reported separately from newly created records.

Expected behavior

Malformed CSV and invalid numeric values should be rejected with row-specific errors, and import result counters should accurately describe each operation.

Acceptance criteria

  • Use strict full-string finite-number parsing and reject negative monetary values.
  • Reject unterminated quoted fields and add focused malformed-input tests.
  • Add explicit row/cell/value length limits within the existing request-body limit.
  • Report created, updated, reactivated, skipped, and failed rows separately.
  • Preserve the currently tested tax-column semantics unless intentionally changing the import contract.

Relevant files

main/routes/menu-csv.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendBackend (Express/SQLite)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions