Send peers the IRC listener user's QUIT reason (closes #216) #239

Merged
clawbot merged 1 commits from issue-216-quit-reason into next 2026-11-02 05:02:34 +01:00
Collaborator

On the IRC listener, handleQuit read the user's QUIT reason but used it only in the ERROR :Closing Link line. cleanup then sent peers a QUIT with the fixed reason Connection closed. Peers on both transports never saw the reason. This fixes #216.

What changed:

  • Each IRC connection keeps the reason for its QUIT, which starts as Connection closed.
  • handleQuit replaces it with the user's reason, or Client quit when none is given.
  • cleanup passes it to svc.BroadcastQuit, the same service call the HTTP API's QUIT uses.

What a reader might trip over:

  • TestRelayNickDiffersOnlyInCase expected Connection closed for a bare QUIT. That was the bug, so it now expects Client quit.
  • In the new test, the HTTP API peer is a session created in the database and joined to the channel, as TestStopEndsSessions already does.

Disclosures:

  • Judgement call: handleQuit records the reason and cleanup sends it, rather than handleQuit calling BroadcastQuit itself as the HTTP API handler does. cleanup already ends the session for every connection, and a QUIT before registration has no session to end.
  • Judgement call: QUIT : with an empty reason sends peers an empty reason, as the HTTP API does for an empty body. IRC peers see Quit for it.
  • README.md does not describe the QUIT reason on the IRC listener, so it is unchanged.

Model: opus-5-5

On the IRC listener, `handleQuit` read the user's `QUIT` reason but used it only in the `ERROR :Closing Link` line. `cleanup` then sent peers a `QUIT` with the fixed reason `Connection closed`. Peers on both transports never saw the reason. This fixes https://git.eeqj.de/sneak/neoirc/issues/216. What changed: - Each IRC connection keeps the reason for its `QUIT`, which starts as `Connection closed`. - `handleQuit` replaces it with the user's reason, or `Client quit` when none is given. - `cleanup` passes it to `svc.BroadcastQuit`, the same service call the HTTP API's `QUIT` uses. What a reader might trip over: - `TestRelayNickDiffersOnlyInCase` expected `Connection closed` for a bare `QUIT`. That was the bug, so it now expects `Client quit`. - In the new test, the HTTP API peer is a session created in the database and joined to the channel, as `TestStopEndsSessions` already does. Disclosures: - Judgement call: `handleQuit` records the reason and `cleanup` sends it, rather than `handleQuit` calling `BroadcastQuit` itself as the HTTP API handler does. `cleanup` already ends the session for every connection, and a `QUIT` before registration has no session to end. - Judgement call: `QUIT :` with an empty reason sends peers an empty reason, as the HTTP API does for an empty body. IRC peers see `Quit` for it. - `README.md` does not describe the `QUIT` reason on the IRC listener, so it is unchanged. Model: opus-5-5
clawbot added the needs-review label 2026-11-02 04:20:39 +01:00
clawbot self-assigned this 2026-11-02 04:20:39 +01:00
clawbot added 1 commit 2026-11-02 04:37:16 +01:00
handleQuit now records the reason on the connection, and cleanup
passes it to BroadcastQuit, the same service call the HTTP API's
QUIT uses. A QUIT without a reason still gives Client quit. A
connection that ends without a QUIT still gives Connection closed.

The relay test that expected Connection closed for a bare QUIT now
expects Client quit.

Model: opus-5-5
clawbot force-pushed issue-216-quit-reason from 4236b3dec8 to 039e2187cb 2026-11-02 04:37:16 +01:00 Compare
Author
Collaborator

PASS: an IRC listener user's QUIT now reaches channel peers on both transports with the reason given, Client quit for a bare QUIT, and Connection closed when the connection ends without one.

Judgement call: QUIT : with an empty reason reaches peers with an empty reason (IRC peers see Quit), as an empty reason over the HTTP API does; I read it as a reason given, not as none.

Model: opus-5-5

PASS: an IRC listener user's `QUIT` now reaches channel peers on both transports with the reason given, `Client quit` for a bare `QUIT`, and `Connection closed` when the connection ends without one. Judgement call: `QUIT :` with an empty reason reaches peers with an empty reason (IRC peers see `Quit`), as an empty reason over the HTTP API does; I read it as a reason given, not as none. Model: opus-5-5
clawbot merged commit e7ae675155 into next 2026-11-02 05:02:34 +01:00
clawbot deleted branch issue-216-quit-reason 2026-11-02 05:02:34 +01:00
Sign in to join this conversation.