RUBY-3814 Remove dead code#3074
Open
jamis wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes unused/dead code paths across the driver, simplifying internal helpers and auth/stringprep support code while leaving a breadcrumb for intentionally “not yet wired” client-closed guarding (RUBY-3174).
Changes:
- Remove unused helper methods and dead branches in socket, connection pool, operation result parsing, and map-reduce view code.
- Drop the vendored Unicode normalization implementation and unconditionally use
String#unicode_normalize!in stringprep. - Clarify intent around
Client#assert_not_closed(kept for RUBY-3174) via updated inline documentation.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/mongo/timeout.rb | Simplifies timeout wrapper to a single delegation path with compacted optional args. |
| lib/mongo/socket.rb | Removes unused unix_socket? helper. |
| lib/mongo/server/connection_pool.rb | Removes unused locked timeout-raising helper. |
| lib/mongo/operation/result.rb | Removes unused aggregate count helpers. |
| lib/mongo/collection/view/map_reduce.rb | Removes unused query/command spec helper methods. |
| lib/mongo/client.rb | Replaces TODO with explanatory comment and documents assert_not_closed intent. |
| lib/mongo/auth/stringprep/unicode_normalize/normalize.rb | Deletes vendored Unicode normalization implementation. |
| lib/mongo/auth/stringprep.rb | Always uses unicode_normalize! for NFKC normalization. |
| lib/mongo/auth/scram_conversation_base.rb | Removes unused payload_data reader. |
| lib/mongo/auth/aws/conversation.rb | Removes unused wrap_data helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+33
to
+34
| optional_args = [ klass, message ].compact | ||
| ::Timeout.timeout(sec, *optional_args, &block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Identify and remove dead/unused code.