-
-
Notifications
You must be signed in to change notification settings - Fork 638
Add onUpgrade method to WebSocket RequestLogger #2450
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
Co-authored-by: tipsy <[email protected]>
onUpgrade| /** | ||
| * Get the WebSocket upgrade logger, if configured | ||
| */ | ||
| public WsUpgradeLogger getWsUpgradeLogger() { | ||
| return wsUpgradeLogger; | ||
| } |
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.
Don't think we need this.
| /** | ||
| * Add a WsUpgradeLogger to the WsHandler. | ||
| * The handler is called when an HTTP request attempts to upgrade to WebSocket. | ||
| * This is invoked before the upgrade process begins, whether the upgrade succeeds or fails. |
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.
Isn't it after? 🤔
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2450 +/- ##
============================================
+ Coverage 86.26% 86.39% +0.13%
- Complexity 1318 1435 +117
============================================
Files 148 148
Lines 4506 4587 +81
Branches 514 490 -24
============================================
+ Hits 3887 3963 +76
- Misses 400 407 +7
+ Partials 219 217 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| cfg = servletContextConfig, | ||
| req = req, | ||
| res = res, | ||
| matchedPath = requestUri, |
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.
This should probably be null, since it didn't match a path.
| req = req, | ||
| res = res, | ||
| matchedPath = requestUri, | ||
| pathParamMap = emptyMap(), |
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.
Maybe these empty maps could be default args, so the whole statement could be val upgradeContext = JavalinWsServletContext(servletContextConfig, req, res)
| pathParamMap = emptyMap(), | ||
| routeRoles = emptySet(), | ||
| ) | ||
| val executionTimeMs = (System.nanoTime() - requestStartTime) / 1_000_000.0f |
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.
Could we pull this out to a function? We are using it somewhere else too.
|
@copilot please update your PR based on the review comments. |
Co-authored-by: tipsy <[email protected]>
I've addressed all the review feedback:
All changes tested and WebSocket tests passing. Commit: 55b0504 |
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.