You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop/Emergency Stop also fire the 'completed' callback: status overwritten and duplicate session-log entries #41
Every stop path, including user Stop and Emergency Stop, also triggers the "completed naturally" path. As a result the status bar overwrites "Emergency Stop" with "Stopped", and the session log records two stop events per run.
Why it matters
After pressing ESC the user briefly sees "Emergency Stop" (red), which is replaced almost at once by "Stopped" (grey). The state indicator is the main safety feedback in the UI.
sessions.log gets event=stop reason=user_stop (or emergency) andevent=stop reason=completed for the same run, so the log can't be used for auditing.
notify_click_complete() calls stop_clicking() a second time, joining from the Tk thread again.
Related: after Emergency Stop (which deliberately does not join), pressing F6 while the old thread is still finishing makes start_clicking() return False (click_engine.py:124-127), and the UI gives no feedback at all.
Evidence
autoclicker/core/click_engine.py:342-345 — finally: always calls on_click_complete() unless a safety stop fired; it doesn't check whether the stop was user-initiated.
Reproduced: on_click_complete fired after user stop: 1.
Suggested approach
Have the engine record a stop reason (completed/user/emergency/safety/error) and pass it to a single on_finished(reason) callback. Only max_clicks/auto_stop count as completed.
Alternatively, tag each run with a generation id and ignore callbacks from a superseded run.
When Start is refused because the previous thread is still alive, show a status message such as "Still stopping…".
Update the stop-path table in docs/ARCHITECTURE.md.
Done when
One stop event per run in sessions.log, with the correct reason (tests for each path).
The Emergency Stop status persists until the next action.
Activity