Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds string sanitization to remove null bytes from external API data to prevent PostgreSQL UTF8 encoding errors. The PR description mentions that LunchFlow may be providing strings with null terminators, and the implementation addresses this by introducing a SanitizeString method to strip null bytes from strings before database storage.
Changes:
- Added
SanitizeStringmethod to TransactionService, SimpleFinService, and LunchFlowService to remove null bytes (\0) from strings - Applied sanitization to transaction-related string fields (SyncID, Category, Subcategory, MerchantName, Source) in TransactionService
- Applied sanitization to transaction string fields (SyncID, MerchantName) from SimpleFin and LunchFlow external APIs
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| server/BudgetBoard.Service/TransactionService.cs | Added SanitizeString method and applied it to transaction string fields in create, update, and split operations |
| server/BudgetBoard.Service/SimpleFinService.cs | Added SanitizeString method and applied it to transaction ID and description fields from SimpleFin API |
| server/BudgetBoard.Service/LunchFlowService.cs | Added SanitizeString method and applied it to transaction ID and merchant fields from LunchFlow API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
It's possible lunchflow is providing strings will null terminators somewhere. Need to sanitize the strings just in case.