The IRC listener tells peers Connection closed instead of the user's QUIT reason #216

Closed
opened 2026-10-27 14:21:59 +01:00 by clawbot · 1 comment
Collaborator

On the IRC listener, handleQuit in internal/ircserver/commands.go reads the user's QUIT reason, sends it back in the ERROR :Closing Link line and marks the connection closed. When the connection then ends, cleanup in internal/ircserver/conn.go sends every peer a QUIT with the fixed reason Connection closed. The reason the user gave is lost, so peers on both transports see Connection closed for every IRC user who quits. Found by the rewrite of the README for #190; read from the code on ecf47c3.

Fix: the QUIT that peers receive carries the reason the user gave, or the listener's default Client quit when they gave none. A connection that ends without a QUIT keeps Connection closed. Change nothing else.

Definition of done

  1. An IRC listener user's QUIT :gone home reaches a peer on the IRC listener and a peer on the HTTP API with the reason gone home.
  2. A QUIT with no reason reaches peers as Client quit; a dropped connection still reaches them as Connection closed.
  3. Tests in internal/ircserver for items 1 and 2.
  4. If README.md describes the QUIT reason on the IRC listener, it says what the code now does.
  5. One reviewed PR against next.

Model: opus-5-5

On the IRC listener, `handleQuit` in `internal/ircserver/commands.go` reads the user's `QUIT` reason, sends it back in the `ERROR :Closing Link` line and marks the connection closed. When the connection then ends, `cleanup` in `internal/ircserver/conn.go` sends every peer a `QUIT` with the fixed reason `Connection closed`. The reason the user gave is lost, so peers on both transports see `Connection closed` for every IRC user who quits. Found by the rewrite of the README for https://git.eeqj.de/sneak/neoirc/issues/190; read from the code on `ecf47c3`. Fix: the `QUIT` that peers receive carries the reason the user gave, or the listener's default `Client quit` when they gave none. A connection that ends without a `QUIT` keeps `Connection closed`. Change nothing else. ## Definition of done 1. An IRC listener user's `QUIT :gone home` reaches a peer on the IRC listener and a peer on the HTTP API with the reason `gone home`. 2. A `QUIT` with no reason reaches peers as `Client quit`; a dropped connection still reaches them as `Connection closed`. 3. Tests in `internal/ircserver` for items 1 and 2. 4. If `README.md` describes the `QUIT` reason on the IRC listener, it says what the code now does. 5. One reviewed PR against `next`. Model: opus-5-5
Author
Collaborator

Built in #239. Peers of an IRC listener user who quits now get the reason the user gave, Client quit when there is none, and Connection closed when the connection ends without a QUIT. README.md does not describe this reason, so it is unchanged.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/neoirc/pulls/239. Peers of an IRC listener user who quits now get the reason the user gave, `Client quit` when there is none, and `Connection closed` when the connection ends without a `QUIT`. `README.md` does not describe this reason, so it is unchanged. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/neoirc#216