home · contact · privacy
Attempt reconnecting on all handled IrcConnAbortExceptions. master
authorChristian Heller <c.heller@plomlompom.de>
Sun, 5 Oct 2025 12:32:37 +0000 (14:32 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 5 Oct 2025 12:32:37 +0000 (14:32 +0200)
src/ircplom/client.py
src/tests/test.test

index e01c35009ff2dbf0dd596bbcc3c056055eb5f9a3..fd05bf96b1f67e3f26862f3066b3ca377df83cc8 100644 (file)
@@ -904,11 +904,11 @@ class Client(ABC, ClientQueueMixin):
     def on_handled_loop_exception(self, e: IrcConnException) -> None:
         'On …AbortException, call .close(), on …Timeout… first (!) try PING.'
         if isinstance(e, IrcConnAbortException):
     def on_handled_loop_exception(self, e: IrcConnException) -> None:
         'On …AbortException, call .close(), on …Timeout… first (!) try PING.'
         if isinstance(e, IrcConnAbortException):
+            self._retry_connect_in_s = 1
             self.db.connection_state = f'broken: {e}'
             self.close()
         elif isinstance(e, IrcConnTimeoutException):
             if self._expected_pong:
             self.db.connection_state = f'broken: {e}'
             self.close()
         elif isinstance(e, IrcConnTimeoutException):
             if self._expected_pong:
-                self._retry_connect_in_s = 1
                 self.on_handled_loop_exception(
                         IrcConnAbortException('no timely PONG from server'))
             else:
                 self.on_handled_loop_exception(
                         IrcConnAbortException('no timely PONG from server'))
             else:
index c5b371ba65ba5295457b1d56f21a092bcd192a73..d7bc4ad1e141c4f49b9bda68589cb35adbfbd846 100644 (file)
@@ -399,7 +399,9 @@ repeat isupport-clear-in isupport-clear-out 9
 
 # check that (save TUI tests assuming start on window 0, and no 4 yet) on reconnect, all the same effects can be expected
 > /reconnect
 
 # check that (save TUI tests assuming start on window 0, and no 4 yet) on reconnect, all the same effects can be expected
 > /reconnect
-repeat conn0 conn1
+9 .!$ will retry connecting in 1 seconds
+1 ..$ connection_state set to: [connecting]
+1 ..$ connection_state set to: [connected]
 2,3,4,5,6,7 ..$ CONNECTED
 repeat conn2 conn3
 1 ..> JOIN :#testtest
 2,3,4,5,6,7 ..$ CONNECTED
 repeat conn2 conn3
 1 ..> JOIN :#testtest