Self-heal partial PDF asset cache + ensure output dir (v0.6.14) - #28
Merged
Conversation
Verified end-to-end locally (frozen sidecar + bundled assets, cache cleared): seeding copies the DocLayout model + CJK fonts with zero network download and translation progresses 0→100%. Two robustness fixes from that testing: - _seed_offline_assets now overwrites a cached asset whose size differs from the bundled one, instead of skipping when the file merely exists. A prior stuck run (no offline assets) can leave a partial/corrupt download in the cache; skipping it made babeldoc re-download and hang again at 0%. Size mismatch -> restore the known-good bundled file. Verified by planting a truncated model. - translate_pdf_document creates the output directory before spawning so writing the result PDFs never fails. - Bump desktop to v0.6.14. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Follow-up to v0.6.13 after full local end-to-end verification (frozen PyInstaller sidecar + bundled assets, cache cleared → seeding copies model+fonts, zero network download, progress 0→100%, output PDFs produced).
Changes
_seed_offline_assets: overwrite a cached asset when its size differs from the bundled one (don't skip on mere existence). A prior stuck run on a build without offline assets can leave a partial/corrupt download in~/.cache/babeldoc; skipping it made babeldoc re-download and hang at 0% again. Verified by planting a truncated model — it gets restored and translation succeeds.translate_pdf_document:create_dir_all(output_dir)before spawn so writing result PDFs never fails.Verified: py_compile, cargo check, plus real runs of the frozen sidecar (fresh cache, corrupt cache).
🤖 Generated with Claude Code