Close the printer-preview race: quantized thumbnails, blocking metascan - #29
Merged
Conversation
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).
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.
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.
Full suite green (1105 passed, 8 skipped). Deployed and verified on the operator box; the affected files were healed in place.