Skip to content

fix: resolve column corruption in CSV downloads.#489

Open
Sweety3106 wants to merge 1 commit into
Charushi06:mainfrom
Sweety3106:fix/csv-export-escaping
Open

fix: resolve column corruption in CSV downloads.#489
Sweety3106 wants to merge 1 commit into
Charushi06:mainfrom
Sweety3106:fix/csv-export-escaping

Conversation

@Sweety3106
Copy link
Copy Markdown

Related Issue

None (Self-discovered formatting bug)

Summary

This PR fixes a bug in the CSV download export where columns would shift and corrupt the spreadsheet if tasks contained commas (,), double quotes ("), or newlines (\n) in their text fields. We now use RFC-4180 compliant escaping on all fields before joining them.

Changes Made

  • Added an escapeCSVField helper function to handle quote-escaping and wrap fields with commas or quotes in double-quotes.
  • Updated the row mapper in backend/controllers/csvDownload.controller.js to apply escapeCSVField to all exported columns.

Testing

  • Created a task with commas and quotes in the title (CS Homework, Part "1") and notes (Read pages 1, 2, and 3) and exported to CSV.
  • Verified that the fields are properly escaped ("CS Homework, Part ""1""" and "Read pages 1, 2, and 3") and alignment is preserved.

Screenshots

None (Backend change only)

Checklist

  • Code follows project style
  • Tested locally
  • No unrelated changes included
  • Documentation updated (if applicable)

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