fix(279): avoid leaking sanitization error payloads#281
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR changes sanitization error construction so DataSanitizationError.details contain only safe metadata (inputType, and optionally errorName). Internal helpers implement the classification and safe-details creation; sanitizeData error paths, tests, JSDoc, and README are updated to stop exposing original payloads. ChangesSafe sanitization error details
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/index-errors.test.ts`:
- Around line 189-222: The test uses an ad-hoc try/catch to capture the error
while other tests use a consistent wrapper that throws — refactor this test to
match that pattern: call sanitizeData inside a small function wrapper (same
style as the other tests) and use the existing expect(...).toThrow /
expect(...).toBeInstanceOf assertions against that wrapper; keep references to
sanitizeData and DataSanitizationError and remove the manual thrownError
variable and try/catch so the test structure matches the rest of the suite.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 875ff5d3-63dd-4678-92bd-5d7c5a889856
📒 Files selected for processing (5)
README.mddocs/plans/003-sanitization-error-details.mdsrc/errors.tssrc/index.tstest/index-errors.test.ts
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Overview
Prevent sanitization failures from exposing caller payloads in
DataSanitizationError.detailswhile keeping structured diagnostics available for logging and debugging.Details
originalDataand wrappederrordetails with safe metadata such asinputTypeanderrorName.DataSanitizationError.detailsshape so callers can continue reading structured error context.Related Tickets and/or Pull Requests
Fixes #279
Summary by CodeRabbit
Bug Fixes
Documentation
Tests