fix(csv): neutralize formula-leading exports - #6993
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Moves Adds unit coverage for neutralization and escaping, including formula-leading copilot, chat, and console exports. Reviewed by Cursor Bugbot for commit f35abc7. Configure here. |
Greptile SummaryThis PR centralizes CSV field formatting and escaping, then applies formula neutralization consistently across API, table, Copilot, chat, and terminal exports.
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defects identified. The shared formatter neutralizes reachable formula-leading string cells before applying CSV escaping, and the migrated export paths preserve their existing serialization, provenance, streaming, and browser-download contracts.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/core/utils/csv.ts | Introduces the canonical CSV value formatter and row escaper, including formula neutralization for string values. |
| apps/sim/app/api/logs/export/route.ts | Replaces the route-local CSV serializer with the shared formatter while preserving streaming behavior. |
| apps/sim/lib/copilot/request/tools/files.ts | Uses canonical CSV formatting for generated Copilot files while retaining persisted-value provenance bookkeeping. |
| apps/sim/lib/table/export-format.ts | Removes duplicate generic CSV helpers while retaining table-specific cell and filename formatting. |
| apps/sim/lib/table/export-stream.ts | Migrates streamed table exports to the shared CSV row serializer. |
| apps/sim/stores/chat/store.ts | Neutralizes exported chat cells and delegates Blob downloads to the shared browser helper. |
| apps/sim/stores/terminal/console/store.ts | Applies shared CSV formatting to normalized console entries while preserving the specialized safe object serializer. |
| apps/sim/lib/core/utils/csv.test.ts | Covers formula triggers, primitive and object serialization, empty serialization, and RFC-style field escaping. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Export source values] --> B[formatCsvValue]
B --> C[Neutralize formula-leading strings]
C --> D[toCsvRow]
D --> E[Escape quotes, commas, CR and LF]
E --> F{Export target}
F --> G[API response stream]
F --> H[Table or Copilot file]
F --> I[Browser Blob download]
Reviews (1): Last reviewed commit: "fix(csv): neutralize formula-leading exp..." | Re-trigger Greptile
Summary
Type of Change
Testing
bun run lintbun run check:auditsbun run apps/sim/scripts/check-block-registry.ts origin/stagingbun run type-checkinapps/simChecklist