Recover from SASL outcomes the library leaves hanging #7
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/sasl-dead-ends"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The bot connected, sat silent for 41 seconds, and was dropped by the server with nothing logged — with correct credentials.
Root cause
ServerConnection._sasl_auth_sentbranches onsaslsuccess(903) andsaslfail(904) — and nothing else. Every other reply in the SASL block hits no branch:_sasl_stepstays set,CAP ENDis never sent, capability negotiation never ends, registration never completes, and the server times the connection out. Exactly the 41-second silence.Verified against the real state machine with a fake socket:
Names come from the library
Event names are read from
irc.events.numericrather than copied, so they cannot drift from what the library dispatches, and handlers are registered by name throughadd_global_handlerrather than ason_<name>methods.Hardcoded here is only what is genuinely ours: that 900-908 is the SASL block, and which of those are handled upstream, informational, or dead ends.
Registration watchdog
If
welcomehas not arrived within 20 seconds, the bot now says so and names the two usual causes rather than sitting mute:PASSthis client cannot send, since SASL and PASS share one password fieldVerification
407 tests, up from 385. They pin the library's gap in both directions — that it still ignores these numerics, and that it still handles the two we defer to — so either changing upstream fails in CI rather than in production.