Skip to content

fix(faq): reject malformed CSV before importing partial rows - #6245

Open
Yzzz88 wants to merge 1 commit into
Tencent:mainfrom
Yzzz88:fix/faq-reject-malformed-csv
Open

Yzzz88 wants to merge 1 commit into
Tencent:mainfrom
Yzzz88:fix/faq-reject-malformed-csv

Conversation

@Yzzz88

@Yzzz88 Yzzz88 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

What changed

Reject FAQ CSV imports when Papa Parse reports a syntax or field-count error, using the existing parse-error feedback and preview clearing path.

Why

An unterminated quoted answer can absorb later FAQ rows. An unquoted comma can shift or drop answer columns. Papa Parse returns these problems in results.errors even though it invokes complete, so the current importer treats the partial result as a valid preview and allows it to be submitted.

Validation

  • Added component-level regressions for missing quotes, extra fields and missing fields, including replacing an existing valid preview. All three fail on main and pass with the fix; no import request is sent.
  • Added a valid quoted CSV case covering commas, multiline answers and escaped quotes.
  • 27 FAQ import, manager and batch tests pass.
  • vue-tsc --build and git diff --check pass.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant