Skip to content

RUBY-3814 Remove dead code#3074

Open
jamis wants to merge 3 commits into
mongodb:masterfrom
jamis:3814-dead-code
Open

RUBY-3814 Remove dead code#3074
jamis wants to merge 3 commits into
mongodb:masterfrom
jamis:3814-dead-code

Conversation

@jamis

@jamis jamis commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Identify and remove dead/unused code.

@jamis jamis marked this pull request as ready for review July 2, 2026 16:51
@jamis jamis requested a review from a team as a code owner July 2, 2026 16:51
@jamis jamis requested review from comandeo-mongo and Copilot July 2, 2026 16:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread lib/mongo/timeout.rb
Comment on lines +33 to +34
optional_args = [ klass, message ].compact
::Timeout.timeout(sec, *optional_args, &block)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants