Skip to content

fix(monitor): ignore stale layers above the job total - #19

Merged
voska merged 2 commits into
mainfrom
fix/monitor-stale-layer
Nov 7, 2026
Merged

voska merged 2 commits into
mainfrom
fix/monitor-stale-layer

Conversation

@voska

@voska voska commented Nov 7, 2026

Copy link
Copy Markdown
Owner

monitor --snapshot-at-layer 2 could consume its one-shot snapshot during startup when RUNNING still carried the previous job's layer count, such as 319 layers out of a reported total of 75. Require the layer to fit within the reported total before capturing. Joining an active print still captures at the first valid layer at or above the target.

Adds command-level regressions for stale startup, an unknown total, joining mid-print, the final layer, and a run with no valid layer. The stale-layer regression captured layer 319 before the fix and layer 2 after it.

Snapshots now require a positive reported total; they wait while the total is unknown. This bounds check cannot distinguish a stale layer that already fits within the new job's total.

Validation: GOTOOLCHAIN=go1.26.10 make ci passed formatting, lint, vet, race tests, and build. The built executable also passed read-only status and monitor checks against a printer. Startup behavior is verified with simulated status reports and ffmpeg; no new print was started.

Review gate: approve with nits. The requirement for a known total is documented; the test connection deliberately advances once per status read.

@voska
voska merged commit cd71112 into main Nov 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant