Connection-timeout watchdog never fires: starting_timer assigns nothing (== for =) #103

Closed
opened 2026-08-20 19:21:14 -04:00 by mysticalsoap · 0 comments
Owner

starting_timer, starting_timer_hop, starting_timer_bypass and start_timer (aqomui_gui.py) all contain bare comparisons where assignments were intended:

def starting_timer(self):
    self.tunnel_active == 0   # no-op
    self.start_timer()

def start_timer(self):
    self.tunnel_bypass_active == 0   # no-op, and the wrong flag anyway
    self.conn_timer.start(15000)

Consequence: when a connection attempt starts, the active flag is never reset, so timeout()'s check — if getattr(self, "tunnel{}_active".format(tunnel)) == 0: kill() — sees the stale 1 from the previous connection and does nothing. The 15-second connection-timeout watchdog only works when no tunnel was ever active this session; every later hung connect/reconnect attempt just spins the cursor forever.

Fix shape: s/==/=/, but this is a real behavior change to the connect flow (the watchdog will actually start killing hung attempts), so it needs deliberate testing around server-switch and reconnect, and it interacts with #102's tunnel_terminated now also resetting tunnel_active. Also worth fixing while there: start_timer touching tunnel_bypass_active regardless of which tunnel the timer is for.

Found while fixing #69 (PR #102); left out of that PR deliberately.

`starting_timer`, `starting_timer_hop`, `starting_timer_bypass` and `start_timer` (aqomui_gui.py) all contain bare comparisons where assignments were intended: ```python def starting_timer(self): self.tunnel_active == 0 # no-op self.start_timer() def start_timer(self): self.tunnel_bypass_active == 0 # no-op, and the wrong flag anyway self.conn_timer.start(15000) ``` **Consequence:** when a connection attempt starts, the active flag is never reset, so `timeout()`'s check — `if getattr(self, "tunnel{}_active".format(tunnel)) == 0: kill()` — sees the stale 1 from the previous connection and does nothing. The 15-second connection-timeout watchdog only works when no tunnel was ever active this session; every later hung connect/reconnect attempt just spins the cursor forever. **Fix shape:** `s/==/=/`, but this is a real behavior change to the connect flow (the watchdog will actually start killing hung attempts), so it needs deliberate testing around server-switch and reconnect, and it interacts with #102's `tunnel_terminated` now also resetting `tunnel_active`. Also worth fixing while there: `start_timer` touching `tunnel_bypass_active` regardless of which tunnel the timer is for. Found while fixing #69 (PR #102); left out of that PR deliberately.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mysticalsoap/aqomui#103
No description provided.