Reconnection attempts are expected to be handled by libpurple and not by the protocol plugin, so it is visible to the user when the connection is not working.
When the internet connection is lost, in some cases libpurple can return a file descriptor without any error that is still not writable or readable. In that case, the connection would remain in the state conn_error until the next ping timeout, which has been causing an assertion error until now.