Skip to content

[5.28] Clean up dead and broken code - #1337

Merged
robsdedude merged 1 commit into
neo4j:5.0from
robsdedude:clean-up-dead-code-5.0
Sep 3, 2026
Merged

robsdedude merged 1 commit into
neo4j:5.0from
robsdedude:clean-up-dead-code-5.0

Conversation

@robsdedude

Copy link
Copy Markdown
Member

The code is broken because

  • in async, AsyncBolt.socket is of type AsyncBoltSocket wrapping asyncio constructs
  • in sync, Bolt.socket is of type BoltSocket wrapping socket.socket or ssl.SSLSocket

Note that (Async)Bolt.socket is never of type ssl.SSLSocket directly. Therefore this check is useless. The code could be fixed, but it's never called. Therefore removing it is the best option.

Back port of: #1335

The code is broken because
 * in async, `AsyncBolt.socket` is of type `AsyncBoltSocket` wrapping `asyncio`
   constructs
 * in sync, `Bolt.socket` is of type `BoltSocket` wrapping `socket.socket` or
   `ssl.SSLSocket`

Note that `(Async)Bolt.socket` is *never* of type `ssl.SSLSocket` directly.
Therefore this check is useless. The code could be fixed, but it's never called.
Therefore removing it is the best option.
@robsdedude robsdedude changed the title Clean up dead and broken code [5.28] Clean up dead and broken code Sep 2, 2026
@robsdedude
robsdedude marked this pull request as ready for review September 2, 2026 11:40

@MaxAake MaxAake 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.

✅

@robsdedude
robsdedude merged commit 9159e4b into neo4j:5.0 Sep 3, 2026
27 checks passed
@robsdedude
robsdedude deleted the clean-up-dead-code-5.0 branch September 3, 2026 07:16
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