-
-
Notifications
You must be signed in to change notification settings - Fork 638
Fix compatibility with connection_pool >= 3.0 #2186
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
base: master
Are you sure you want to change the base?
Conversation
The connection_pool gem v3.0 changed its API from positional hash arguments to keyword arguments. This caused an ArgumentError when initializing the server rendering pool. The fix uses the double-splat operator (**options) which works with both old and new versions of connection_pool: - Old versions (< 3.0): Accepts hash as positional argument - New versions (>= 3.0): Requires keyword arguments Fixes #2185 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughUpdated ConnectionPool initialization in the server rendering pool module to use keyword argument splatting (**options) instead of positional hash argument. This resolves incompatibility with connection_pool gem version 3.0+, which changed its API to require keyword arguments. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{rb,rake}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-11-25T08:05:17.804ZApplied to files:
⏰ 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). (4)
🔇 Additional comments (1)
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 |
Code ReviewSummaryThis PR fixes a critical compatibility issue with ✅ Code Quality & Best PracticesExcellent:
Code correctness: ConnectionPool.new(options) { create_js_context }to: ConnectionPool.new(**options) { create_js_context }is the correct way to handle the ✅ Backward CompatibilityVerified: The
✅ Bug Fix ValidationIssue correctly identified:
Fix addresses the root cause:
🔍 Test CoverageCurrent state:
Recommendation for future enhancement (NOT blocking): Example structure: describe 'ConnectionPool initialization' do
it 'initializes pool with keyword arguments' do
expect { described_class.reset_pool }.not_to raise_error
expect(described_class.instance_variable_get(:@js_context_pool)).to be_a(ConnectionPool)
end
endHowever, since existing integration tests cover this, it's not critical for this PR. ✅ Security ConsiderationsNo security concerns:
✅ Performance ConsiderationsNo performance impact:
📋 Pre-merge ChecklistBased on CLAUDE.md requirements:
📝 DocumentationRecommendation: Consider adding a note to the CHANGELOG under "Bug Fixes": #### Bug Fixes
- [PR 2186](https://github.com/shakacode/react_on_rails/pull/2186) by [example-user](https://github.com/example-user): Fix compatibility with connection_pool >= 3.0 by using keyword argument splattingThis is a user-visible bug fix (blocks Rails boot), so it should be documented per CLAUDE.md guidelines. ✅ Final RecommendationAPPROVE AND MERGE once CI passes. This is a textbook example of a minimal, correct bug fix:
Great work! 🎉 🤖 Review generated with Claude Code |
Code Review - PR #2186Thank you for this PR! This is an excellent fix for a critical compatibility issue. Here's my detailed review: ✅ Strengths
📝 Suggestions1. Add CHANGELOG Entry (Required)According to the project's CLAUDE.md guidelines, user-visible bug fixes should be documented in Suggested entry under #### Fixed
- **Compatibility with connection_pool >= 3.0**: Fixed `ArgumentError: wrong number of arguments` crash during Rails boot when using connection_pool gem version 3.0+. Updated to use keyword argument splatting (`**options`) in `ConnectionPool.new` initialization. [PR 2186](https://github.com/shakacode/react_on_rails/pull/2186) by [<your-github-username>](https://github.com/<your-github-username>).You can use the 2. Consider Test Coverage (Nice to Have)I noticed there are no existing tests for
However, given this is a bug fix for an external API change and manual testing was done with a fresh Rails 8 app, the lack of automated tests is acceptable for now. 3. Verify Pro Package (Already Confirmed ✅)I checked and confirmed the Pro package doesn't use 🔍 Code Quality Assessment
📋 Pre-Merge ChecklistBefore merging, please ensure:
🚀 RecommendationApprove and merge after adding the CHANGELOG entry. This is a critical bug fix that unblocks users who have connection_pool 3.0+ installed. Great work identifying the issue and providing a clean fix! 🎉 Review conducted following the project's CLAUDE.md guidelines and conventions. |
Code Review - PR 2186SummaryThis PR fixes a critical compatibility issue with connection_pool >= 3.0. The fix is minimal, correct, and backward compatible. Strengths
Suggestions1. Add CHANGELOG EntryThis is a user-facing bug fix that should be documented in CHANGELOG.md under Unreleased > Fixed:
2. Verify RuboCopRun bundle exec rubocop before committing (per CLAUDE.md) 3. Monitor CI After MergeMonitor CI for 30 minutes after merge (per CLAUDE.md) Security and Performance
ConclusionRecommendation: Approve with changelog update Excellent fix! The code change is correct and the only missing piece is a CHANGELOG entry. Great work identifying and fixing this! 🎉 |
Code Review for PR #2186SummaryThis PR fixes a critical compatibility issue with ✅ Strengths
📝 Observations & Suggestions1. Changelog Entry NeededThis is a user-visible bug fix that should be documented: #### Bug Fixes
- [PR 2186](https://github.com/shakacode/react_on_rails/pull/2186) by [ihabadham](https://github.com/ihabadham): Fix compatibility with `connection_pool` gem version 3.0+. Fixes `ArgumentError: wrong number of arguments` when using `connection_pool` 3.0+ during Rails boot.Per 2. Test Coverage Gap (Low Priority)The
This is not blocking for this PR, but could be a future improvement. 3. Dependency Version Constraint (Informational)The gemspec has
This is actually fine given your backwards-compatible fix, but worth noting for future reference. 🔒 Security & Performance
✅ RecommendationLGTM - Ready to Merge This is an excellent fix that:
Action Items Before Merge:
📚 References
Great work on identifying and fixing this quickly! 🎉 |
Code Review - Excellent Fix! 🎉SummaryThis PR correctly fixes a critical compatibility issue with ✅ Strengths
📝 Suggestions1. Add CHANGELOG EntryPer the project's CLAUDE.md guidelines, user-visible bug fixes should be documented. Please add this to - **Compatibility with connection_pool >= 3.0**: Fixed `ArgumentError: wrong number of arguments` crash during Rails boot when using connection_pool gem version 3.0+. Updated to use keyword argument splatting (`**options`) in ServerRenderingPool initialization. [PR 2186](https://github.com/shakacode/react_on_rails/pull/2186) by [ihabadham](https://github.com/ihabadham).You can use the 2. Monitor After MergePer CLAUDE.md guidelines, please monitor CI for 30 minutes after your PR merges to ensure it doesn't break master. 🔍 Code Quality Assessment
🚀 RecommendationAPPROVE - Ready to merge after adding the CHANGELOG entry. This is a textbook example of a minimal, correct bug fix that unblocks users experiencing Rails boot failures. Excellent work identifying the issue and providing a clean solution! Review conducted following the project's CLAUDE.md guidelines. |
Code Review for PR #2186: Fix compatibility with connection_pool >= 3.0SummaryThis is an excellent fix for a critical compatibility issue. The change is minimal, correct, and well-researched. Code Quality: EXCELLENTStrengths:
Code location: react_on_rails/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb:16 Bug Fix Validation: CONFIRMEDRoot cause correctly identified:
Impact: This bug prevents all Rails apps from booting when connection_pool >= 3.0 is installed (including fresh Rails 8 apps), making this a CRITICAL fix. Security: NO CONCERNSNo security implications - purely an API compatibility fix. Performance: NO IMPACTThe Test Coverage: ADEQUATEExisting coverage:
Manual verification noted in PR:
Checklist ItemsBased on CLAUDE.md requirements:
Recommendations
Per CLAUDE.md section on Changelog Guidelines, this user-visible bug fix needs documentation: Add to the Unreleased section under [16.2.0] in /CHANGELOG.md:
Currently the gemspec has no version constraint. Since this fix makes the code work with all versions of connection_pool, the current unconstrained dependency is fine.
While existing integration tests cover this indirectly, consider adding explicit test for ConnectionPool initialization with keyword arguments. This is nice-to-have but not critical. Verdict: APPROVE with minor CHANGELOG additionThis is a high-quality, well-researched fix for a critical bug. The only required change before merge is adding the CHANGELOG entry. Merge recommendation: APPROVE after CHANGELOG update. Great work @ihabadham! |
Summary
ArgumentError: wrong number of arguments (given 1, expected 0)when usingconnection_poolgem version 3.0+**options) instead of positional hash argument when initializingConnectionPoolFixes #2185
Background
The
connection_poolgem changed its API in version 3.0 to use keyword arguments instead of positional arguments. This breaking change caused React on Rails to fail during Rails boot whenconnection_pool3.0+ was installed.This is the same fix that Rails applied for their
RedisCacheStore.Test plan
connection_pool3.0.2 using fresh Rails 8 app with local gem**optionssyntax is backwards compatible with older versions ofconnection_pool🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.