Skip to content

fix: add csv sanitizer module - #809

Merged
gopaljilab merged 1 commit into
gopaljilab:mainfrom
saurabhhhcodes:fix/csv-sanitizer-module-789
Jun 6, 2026
Merged

fix: add csv sanitizer module#809
gopaljilab merged 1 commit into
gopaljilab:mainfrom
saurabhhhcodes:fix/csv-sanitizer-module-789

Conversation

@saurabhhhcodes

Copy link
Copy Markdown
Contributor

Description

Implements server/utils/csvSanitizer.ts so the empty utility file is now a real TypeScript module, then routes CSV export cell serialization through the sanitizer.

Related Issue

Closes #789

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Test addition or update

Changes Made

  • Added sanitizeCsvCell and escapeCsvCell exports for CSV-safe value handling.
  • Updated assessmentsToCsv to use the sanitizer for headers and row values.
  • Added Vitest coverage for CSV escaping and spreadsheet formula-prefix protection.

Testing

  • npm run test -- server/utils/csvExport.test.ts
  • git diff --check
  • npm run check currently fails on upstream main before this change is reached due syntax errors in server/routes/assessments.routes.ts around lines 118-141.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have added/updated tests where applicable

@github-actions github-actions Bot added the type:bug Something isn't working or throwing errors. label Jun 4, 2026
@gopaljilab gopaljilab added gssoc:approved level:intermediate Requires standard familiarity with the codebase. labels Jun 6, 2026
@gopaljilab
gopaljilab merged commit 779d528 into gopaljilab:main Jun 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved level:intermediate Requires standard familiarity with the codebase. type:bug Something isn't working or throwing errors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] server/utils/csvSanitizer.ts is empty and fails TypeScript module checks

2 participants