From 7c2d0c91d06833ab98f15ccf5dbcf4009b32f459 Mon Sep 17 00:00:00 2001 From: Ajimaru Date: Wed, 23 Sep 2026 09:02:10 +0200 Subject: [PATCH 1/2] fix: run PortRetry conflict check after login The check ran at DOM-ready, before OctoPrint's client had its base URL set, so every page load requested /undefined/api/plugin/autoconnectplus (404) and the conflict warning never showed. The API is login-protected anyway, so run the check from the view model's onUserLoggedIn. Also stop ignoring editor/assistant files in .gitignore. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 4 ---- .../static/js/autoconnectplus.js | 11 +++++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 81a969e..f9113e1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,3 @@ dist *.zip octoprint/* .venv/ -.vscode/ -.github/instructions/codacy.instructions.md -.claude/ -CLAUDE.md diff --git a/octoprint_autoconnectplus/static/js/autoconnectplus.js b/octoprint_autoconnectplus/static/js/autoconnectplus.js index 45cad29..65ee5d7 100644 --- a/octoprint_autoconnectplus/static/js/autoconnectplus.js +++ b/octoprint_autoconnectplus/static/js/autoconnectplus.js @@ -35,10 +35,6 @@ $(function () { }); } - // Check immediately after the global plugin assets are ready, not only - // when the user opens the settings dialog. - checkPortRetryConflict(); - function AutoConnectPlusViewModel(parameters) { var self = this; @@ -61,6 +57,13 @@ $(function () { self.onSettingsShown = function () { self.refreshDetected(); }; + + // Check on login, not only when the user opens the settings dialog. + // Not at DOM-ready: the client's base URL is not set yet then + // (requests go to /undefined/api/...) and the API needs a session. + self.onUserLoggedIn = function () { + checkPortRetryConflict(); + }; } OCTOPRINT_VIEWMODELS.push({ From 565023bfa264b2fb82898d3f11a7ae3c2adde9d6 Mon Sep 17 00:00:00 2001 From: Ajimaru Date: Wed, 23 Sep 2026 09:18:34 +0200 Subject: [PATCH 2/2] chore: bump version to 0.1.1 in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 59dd2b0..f44a98b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "OctoPrint-AutoConnectPlus" -version = "0.1.0" +version = "0.1.1" description = "Automatically reconnects the printer over serial, Moonraker or Bambu connectors" authors = [ {name = "ajimaru", email = "ajimaru_gdr@pm.me"}