Why Cascade Chat kept disconnecting

Cascade Chat could connect to Libera.Chat just fine and then lose the socket a few seconds later. Finding out why took several PRs and a rethink of its event architecture.