-
Notifications
You must be signed in to change notification settings - Fork 13k
chore(http-router): add logger for invalid operations #37097
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 ready to merge! 🎉 |
|
WalkthroughAdds @rocket.chat/logger as a dependency and introduces warning logs in HttpRouter for query, body, and response validation failures without changing control flow or responses. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant R as HttpRouter
participant V as Validator
participant L as Logger
participant S as Service/Handler
C->>R: HTTP request (method, path, query, body)
R->>V: Validate query
alt Query invalid
V-->>R: Error(s)
R->>L: warn(method, path, errors)
R-->>C: 400/422 with error details
else Query valid
R->>V: Validate body
alt Body invalid
V-->>R: Error(s)
R->>L: warn(method, path, errors)
R-->>C: 400/422 with error details
else Body valid
R->>S: Invoke handler
S-->>R: Response payload
R->>V: Validate response
alt Response invalid
V-->>R: Error(s)
R->>L: warn(method, path, errors)
R-->>C: Error response
else Response valid
R-->>C: Success response
end
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests
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. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #37097 +/- ##
========================================
Coverage 67.37% 67.37%
========================================
Files 3330 3330
Lines 113482 113490 +8
Branches 20598 20599 +1
========================================
+ Hits 76454 76469 +15
+ Misses 34418 34409 -9
- Partials 2610 2612 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
3a4a0fe to
8016913
Compare
https://rocketchat.atlassian.net/browse/FDR-179
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit