Skip to content

Self-heal partial PDF asset cache + ensure output dir (v0.6.14) - #28

Merged
hikariming merged 1 commit into
mainfrom
codex/pdf-sidecar-packaging-fix
Jun 17, 2026
Merged

Self-heal partial PDF asset cache + ensure output dir (v0.6.14)#28
hikariming merged 1 commit into
mainfrom
codex/pdf-sidecar-packaging-fix

Conversation

@hikariming

Copy link
Copy Markdown
Owner

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.
  • Bump to v0.6.14.

Verified: py_compile, cargo check, plus real runs of the frozen sidecar (fresh cache, corrupt cache).

🤖 Generated with Claude Code

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>
@hikariming
hikariming merged commit c6d83c3 into main Jun 17, 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