support to configure decompression buffer#188
Conversation
removed deprecated method which always support unlimited buffer, user can use decompressionBufferSize to set the limits
|
Worried about impact? Review this PR in Change Stack to explore blast radius before you approve or request changes. Warning Review limit reached
More reviews will be available in 50 minutes and 38 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds WebSocket decompression buffer size as a configurable property. ChangesWebSocket Decompression Buffer Configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/BasicConfiguration.java (1)
76-78: ⚡ Quick winAdd JavaDoc and input validation for the new public API.
The setter lacks documentation explaining:
- What this parameter controls (WebSocket decompression buffer size limit)
- What the default value of
0means (unlimited? use Netty's default?)- What values are acceptable (positive integers only? any specific limits?)
Additionally, consider adding validation to reject invalid values such as negative numbers.
📝 Suggested documentation and validation
+ /** + * Set the maximum decompression buffer size for WebSocket compression. + * Used to limit memory consumption during WebSocket message decompression. + * <p> + * Default is <code>0</code> which means [specify: unlimited or use Netty default] + * + * `@param` decompressionBufferSize - buffer size in bytes, or 0 for [unlimited/default] + */ public void setDecompressionBufferSize(int decompressionBufferSize) { + if (decompressionBufferSize < 0) { + throw new IllegalArgumentException("decompressionBufferSize must be non-negative"); + } this.decompressionBufferSize = decompressionBufferSize; }🤖 Prompt for 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. In `@netty-socketio-core/src/main/java/com/socketio4j/socketio/BasicConfiguration.java` around lines 76 - 78, Add JavaDoc to BasicConfiguration.setDecompressionBufferSize describing that this controls the WebSocket decompression buffer size limit, what a default of 0 means (e.g., unlimited or use Netty's default—state which), and the acceptable range (positive integers only). Add input validation in setDecompressionBufferSize to reject negative values (throw IllegalArgumentException with a clear message) and document the behavior for 0 and positive values; reference the field decompressionBufferSize and the setter setDecompressionBufferSize in the comment so reviewers can locate the change.
🤖 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.
Nitpick comments:
In
`@netty-socketio-core/src/main/java/com/socketio4j/socketio/BasicConfiguration.java`:
- Around line 76-78: Add JavaDoc to
BasicConfiguration.setDecompressionBufferSize describing that this controls the
WebSocket decompression buffer size limit, what a default of 0 means (e.g.,
unlimited or use Netty's default—state which), and the acceptable range
(positive integers only). Add input validation in setDecompressionBufferSize to
reject negative values (throw IllegalArgumentException with a clear message) and
document the behavior for 0 and positive values; reference the field
decompressionBufferSize and the setter setDecompressionBufferSize in the comment
so reviewers can locate the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c58faabb-e6c8-4788-a90d-517fbac10392
📒 Files selected for processing (2)
netty-socketio-core/src/main/java/com/socketio4j/socketio/BasicConfiguration.javanetty-socketio-core/src/main/java/com/socketio4j/socketio/SocketIOChannelInitializer.java
removed deprecated method which always support unlimited buffer, user can use decompressionBufferSize to set the limits
Description
Brief description of the changes in this PR.
Type of Change
Related Issue
Closes #(issue number)
Changes Made
Testing
mvn testChecklist
Additional Notes
Any additional information, screenshots, or context that reviewers should know.
Summary by CodeRabbit