Skip to content

fix(windows): clean up qpdf staging files - #94

Merged
McanKul merged 1 commit into
McanKul:developmentfrom
terminalchai:fix/windows-qpdf-temp-cleanup
Aug 30, 2026
Merged

fix(windows): clean up qpdf staging files#94
McanKul merged 1 commit into
McanKul:developmentfrom
terminalchai:fix/windows-qpdf-temp-cleanup

Conversation

@terminalchai

Copy link
Copy Markdown

Summary

  • Wrap Windows qpdf staging in try/finally and remove its temporary directory on success or failure.
  • Preserve copied qpdf binaries, Visual C++ runtime files, existing output, and version handling.

Why

Closes #38. Downloaded archives and extracted files currently remain in offpdf-qpdf-* directories after the script exits.

Validation

  • npm run build
  • npm test (261 tests across 30 files)
  • cargo check --manifest-path src-tauri/Cargo.toml (not run; no Rust changes)
  • PowerShell syntax parsing passed.
  • An isolated local verification harness reproduced the staging leak before the change with a simulated download failure.
  • After the change, simulated download and extraction failures both preserved the original error and left no staging directories.
  • A real qpdf 12.4.1 download/extraction completed with no staging directories left behind. The staged executable reported version 12.4.1, and all three required runtime DLL copies matched their source hashes.
  • The local harness and downloaded artifacts are not included in this PR.

Privacy Checklist

  • This keeps OffPDF usable offline.
  • This does not upload, log, or transmit user files.
  • New dependencies or bundled binaries have compatible licenses (none added).

Remove temporary downloads and extracted files in a finally block while preserving staged binaries and runtime DLLs.

Refs McanKul#38

@McanKul McanKul left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused fix and thorough validation. I also verified the success and simulated failure paths locally; the staged binaries remain intact and the temporary directory is removed in both cases. Great first contribution!

@McanKul
McanKul merged commit 0525694 into McanKul:development Aug 30, 2026
2 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.

2 participants