engine: forget a split server's users on SQUIT
All checks were successful
CI / check (push) Successful in 3m47s

A netsplit is signalled once via SQUIT, not as a QUIT per user, so every
user behind the departed server lingered in services' state — stale
sessions, session-limit slots, and channel memberships. The parser now
surfaces ServerSplit and the engine forgets every uid carrying that
server's SID prefix, leaving other servers' users untouched.
This commit is contained in:
Jean Chevronnet 2026-07-16 10:10:20 +00:00
parent 63ecd79b12
commit 4aff734340
No known key found for this signature in database
5 changed files with 49 additions and 0 deletions

View file

@ -208,6 +208,11 @@ impl Protocol for InspIrcd {
Some(uid) if !uid.is_empty() => vec![NetEvent::UserKilled { uid: uid.to_string() }],
_ => vec![],
},
// :<src> SQUIT <sid> :<reason> — a server split; forget its users.
"SQUIT" => match tokens.next() {
Some(server) if !server.is_empty() => vec![NetEvent::ServerSplit { server: server.to_string() }],
_ => vec![],
},
// ENCAP <target> <subcmd> … — we care about relayed SASL and the
// account-registration relay (the ircd's account module forwards a
// leaf's REGISTER/VERIFY/RESEND/STATUS to us, the authority server).
@ -478,6 +483,13 @@ mod tests {
assert!(matches!(ev.as_slice(), [NetEvent::UserKilled { uid }] if uid == "0IRAAAAAB"), "{ev:?}");
}
// A SQUIT surfaces as a ServerSplit carrying the departed server's SID.
#[test]
fn parses_squit() {
let ev = proto().parse(":42S SQUIT 0IR :ping timeout");
assert!(matches!(ev.as_slice(), [NetEvent::ServerSplit { server }] if server == "0IR"), "{ev:?}");
}
// A UID burst introduces the user under their current nick.
#[test]
fn parses_uid_burst() {