-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: Log request/response contents when a validation error occurs #37170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughLogging fields were added to error reports in Router.ts for validation failures. Query validation now logs queryParams and sets bodyParams undefined; body validation logs bodyParams and sets queryParams undefined; response validation logs originalResponse body. No control flow or public API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37170 +/- ##
===========================================
- Coverage 67.39% 67.36% -0.04%
===========================================
Files 3287 3287
Lines 111684 111684
Branches 20409 20405 -4
===========================================
- Hits 75270 75233 -37
- Misses 33730 33765 +35
- Partials 2684 2686 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/http-router/src/Router.ts(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: 📦 Meteor Build - coverage
🔇 Additional comments (1)
packages/http-router/src/Router.ts (1)
267-267: Verify test-only logging is sufficient for response validation.Logging the full response body is appropriate here since response validation only runs in test mode (per line 255). This mitigates the security concerns that apply to request payload logging.
However, verify that test environments do not contain production or production-like sensitive data that could still be exposed in test logs.
Proposed changes (including videos or screenshots)
Issue(s)
https://rocketchat.atlassian.net/browse/CORE-1501
This helps to understand why a validation error happened.
Steps to test or reproduce
Further comments
Summary by CodeRabbit