Skip to content

Close the printer-preview race: quantized thumbnails, blocking metascan - #29

Merged
bbolinger merged 1 commit into
mainfrom
fix/printer-preview-race
Jul 22, 2026
Merged

Close the printer-preview race: quantized thumbnails, blocking metascan#29
bbolinger merged 1 commit into
mainfrom
fix/printer-preview-race

Conversation

@bbolinger

Copy link
Copy Markdown
Owner

Big plates surfaced a race in the printer's own UI: Moonraker parses an uploaded file's metadata asynchronously, the touchscreen and app request the thumbnail while the scan is still running on a 50 MB file, and the miss gets cached as a generic icon. Proven live by re-uploading identical bytes under a fresh name, which displayed fine.

  • Injected thumbnails are palette-quantized (a 300 px block dropped from 50 KB to 12 KB with no visible cost), so headers parse faster everywhere.
  • The upload step forces the metadata scan and waits for it (/server/files/metascan) before reporting, with a fallback to the plain GET on older Moonraker builds.

Full suite green (1105 passed, 8 skipped). Deployed and verified on the operator box; the affected files were healed in place.

Big plates surfaced a race in the printer's own UI: Moonraker parses an
uploaded file's metadata asynchronously, the touchscreen and app ask for
the thumbnail while the scan is still running on a 50 MB file, get
nothing, and cache the miss for that filename. The result was a generic
icon that never healed, and it looked exactly like a broken thumbnail
inject. Proven live by re-uploading the identical bytes under a fresh
name, which displayed fine.

Two changes shrink and then close the window:

- Injected thumbnails are palette-quantized before encoding. The toolpath
  renders are dense texture that defeats RGB PNG compression; a 300 px
  block ran 50 KB encoded against 12 KB quantized with no visible cost on
  these flat-color images. Smaller headers parse faster everywhere.

- The upload step now forces the metadata scan and waits for it
  (/server/files/metascan) before reporting, so thumbnails are queryable
  by the time the workflow announces the upload. Older Moonraker builds
  without the endpoint fall back to the previous metadata GET.

Full suite green (1105 passed, 8 skipped).
@bbolinger
bbolinger merged commit b10ffd4 into main Jul 22, 2026
3 checks passed
@bbolinger
bbolinger deleted the fix/printer-preview-race branch July 22, 2026 13:38
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