Bugfixed by Claude#68
Open
tropotek wants to merge 5 commits into
Open
Conversation
Connection setup previously required repeatedly deleting/re-adding the printer profile before it would pick up the API key and connect. Root cause: the plugin matched Repetier server instances to Cura machines by comparing the instance's own name against Cura's auto-generated machine id, which only lined up by coincidence. Now an explicit link (repetier_instance_id) is persisted when "Connect" is clicked, with a self-healing fallback for already-working profiles. Also fixes several bugs found while auditing the same code paths: - API key validation/"Get Printers" reading from the wrong container, leaving Connect permanently disabled or requiring multiple clicks - an UnboundLocalError silently corrupting printer status polling - an undefined self._key reference in the listPrinter handler - the "Store G-code on SD card" checkbox being a no-op due to a case-mismatched metadata key - an unguarded None dereference on upload completion - missing imports/PyQt6 enum scoping in unreachable appkey-request code - duplicate signal connections and non-idempotent connect() calls Removes dead code (NetworkReplyTimeout, stale metadata writes) and outdated assets (config.jpg, webcam.jpg, old Cura 4.1 testing doc), and updates the README accordingly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Repetier-Server (confirmed against a real 1.4 server) starts printing as a direct side effect of uploading to the job endpoint and never returns a Location header — that behavior was ported from the OctoPrint plugin this was forked from and doesn't apply here. Log it at debug level instead of surfacing a blocking user-facing error; the print already started fine. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v5.2 - connection setup bugfixes (Mick Mifsud)
RepetierOutputDevicePlugindecided whether to pushthe API key into a live connection by comparing the Repetier server instance's own name
against Cura's auto-generated machine container
id— two unrelated values that only matchedby coincidence. This is why setup required repeatedly deleting/re-adding the printer profile.
Fixed by persisting an explicit
repetier_instance_idlink on the machine when "Connect" isclicked, and matching on that. Existing (accidentally-working) profiles are migrated
automatically on first reconnect (legacy id-match still honored as a fallback, then
self-heals by backfilling the new metadata).
wizard's "RepetierID" and "API Key" fields were reading Cura container metadata keyed by the
Repetier server instance's name instead of the active machine's id — essentially never a
valid lookup for a fresh profile. Fixed to read the printer slug directly off the selected
instance and the API key from the active machine.
instance-list "linked instance" bolding (
font.italicwas comparing against a nonexistent.keyproperty and the wrong metadata field) and in the "Edit" button's pre-fill logic forthe manual-instance dialog. Both fixed to use the same reliable source.
getPrinterList()fires an async network request but the QML read the result synchronouslyright after calling it — always one click behind. Added a
printersChangedsignal (properlynotified when the response actually lands) and an
isFetchingPrintersbusy flag; the buttonnow disables while in flight and the dropdown populates reliably on the first response.
Re-fetching now also preserves the current selection if it's still present in the new list.
UnboundLocalErrorcrash silently breaking printer status polling whenever astateListresponse omitted
numExtruder(seen with a real printer profile) —printer_statewas onlyassigned inside a conditional branch but used unconditionally afterward. The
except:handlerfor this case then also crashed on
printer.activePrintJobbeingNone. Both fixed.AttributeErrorlandmine in thelistPrinterresponse handler(
self._keywas never defined anywhere — should have beenself._repetier_id).read back with a case-mismatched metadata key (
Repetier_store_sdvs. the storedrepetier_store_sd), so it always evaluated to the default (off).Fixed to use the matching, correctly-cased key.
location_urldereference in the upload-finished handler — would crash if Repetierever omits the
Locationheader on a successful auto-print upload. Added a guard with aclear error message instead.
QSslConfiguration/QSslSocketimports and PyQt6 enum-scoping issues(
FollowRedirectsAttribute,VerifyNone) inDiscoverRepetierAction._createRequest()—currently unreachable dead code (not wired to any UI button) but would have crashed
immediately if ever invoked.
connectionStateChangedsignal connections stacking up on every reconnect attempt,causing repeated/duplicated
addOutputDevice/removeOutputDevicecalls during setup. Nowdisconnects before reconnecting.
RepetierOutputDevice.connect()had no idempotency guard, so rapid successive calls (e.g.from
setInstanceId()andsetApiKey()each triggering a reconnect) restarted the poll timerand re-issued a burst of duplicate HTTP requests. Now a no-op while already
connecting/connected.
error state. Now surfaces a proper
Errorstate and recovers toConnectedautomatically onthe next successful poll once the key is corrected.
Changed
linked to the active printer, and shows a "currently linked" label when it's selected.
different instance is selected.
#(default/ungrouped bucket) as "(Default)" instead of the raw symbol, and defaults to the first
available group instead of leaving no selection.
manualPrinterDialog.onAcceptedno longer writesrepetier_idmetadata onto whichevermachine happens to be active just from adding/editing a server entry in the list — that link
is only ever made via the explicit "Connect" action now.
Removed
NetworkReplyTimeout.py(never instantiated) and all references to it.config.jpg,webcam.jpg, andCura 4.1 testing doc.rtf.zip— stale screenshots/testing docfrom the Cura 4.1 era, superseded by the current README instructions.
linking is explicit rather than name-coincidence-based.