Skip to content

fix(connection): auto-reconnect until klipper is ready, drop retry button - #339

Merged
gmmcosta15 merged 2 commits into
devfrom
fix/connection-auto-reconnect
Sep 28, 2026
Merged

gmmcosta15 merged 2 commits into
devfrom
fix/connection-auto-reconnect

Conversation

@gmmcosta15

Copy link
Copy Markdown
Collaborator

Description

  • Feature
  • Bug fix
  • Code refactor
  • Documentation

ConnectionPage now shows only while Klipper/Moonraker is down. It keeps retrying on its own and returns to the main window when Klipper is ready. The only buttons left are Restart Klipper and Restart Firmware.

  • Websocket: one retry timer every 3s with no cap, stopped only by an intentional disconnect.
  • Klippy: server.info is polled every 2s in any non-ready state with no cap. The state signal is sent only when the state changes, and the tracked state is reset on reconnect and on notify_klippy_disconnected.
  • Retry button removed from ConnectionPage.
  • mainWindow: removed the duplicate klippy_state_signal connection.
  • mainWindow: the automatic klipper service restart waits 15s in "disconnected", so a RESTART/SAVE_CONFIG or systemd's own restart (RestartSec=10) no longer triggers it.

Motivation

After #211 the page froze: the websocket gave up after 3 attempts, and the Klippy poll stopped after 60s, which is shorter than Klipper's 90s MCU connect window.

Tests

  • Unit tests added for moonrakerComm, mainWindow and ConnectionPage.

@gmmcosta15 gmmcosta15 added the bug Something is broken, or a fix for it label Sep 28, 2026
@gmmcosta15 gmmcosta15 self-assigned this Sep 28, 2026

@RobeMartins RobeMartins left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gmmcosta15
gmmcosta15 merged commit d9b3416 into dev Sep 28, 2026
8 checks passed
@gmmcosta15
gmmcosta15 deleted the fix/connection-auto-reconnect branch September 28, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken, or a fix for it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants