Repository navigation
feat(torrent): report torrent peers' client names on live connections - #576
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00c39c9c8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Torrent peers' handshakes already carry who they are, but Ketch dropped it. Live connections now report the remote client:
PeerDetails.client(library:api, nullable, display only, self-reported).PeerClients(library:torrent) decodes 20-byte peer IDs: Azureus style (-qB4630-→qBittorrent 4.6.3, ~90 codes incl.KE= Ketch), Shadow style and Mainline style; unknown IDs →null.PeerExtensionsreads BEP 10v, stripped of control and formatting (bidi) characters and cut to 64 chars; it replaces the peer-ID guess once the extension handshake arrives.PeerTraffic.open(peerId = …)andPeerTraffic.client(name), wired into the v1 swarm workers and the v2/hybrid session loop. Client names go to the connection reporter only, never to logs with hosts (ConnectionSpec.toStringstill leaves the peer out)./api/connectionsand the event stream serializeActiveConnection, so the field flows through unchanged; older clients ignore it.fitColumnsafter Peer and Route), sortable with unknown clients last; narrow rows lead their second line with the client; search matches clients. String translated into all 9 locales.Snapshots
Tests
PeerClientsTest: Azureus/Shadow/Mainline decoding, our own peer ID, unknown IDs,vsanitizing (control, bidi, length, surrogate pairs).TorrentPeerConnectionsTest: an incoming v1 peer reports the client from its peer ID, then itsv;client()describes only on change.ConnectionRowsTest: search by client, client sort.:library:api:jvmTest,:library:server:test,:library:remote:jvmTest,:library:torrent:jvmTest,:library:torrent:compileTestKotlinIosSimulatorArm64,:app:shared:jvmTest: all pass. API dump updated.