Skip to content

DOCX: add native conversion timeout and stage-level telemetry #110

@developer0hye

Description

@developer0hye

Summary

DOCX conversion needs built-in timeout controls and stage-level telemetry to handle heavy documents predictably.

Problem

Some documents require excessive conversion time and currently depend on external wrappers for process-level timeouts. The library/CLI should provide first-class timeout behavior and timing visibility.

Proposal

  1. Add configurable timeout budget.
  • library: ConversionOptions::timeout
  • CLI: --timeout-seconds <n>
  • return explicit timeout error type
  1. Add stage timing instrumentation.
  • parse time
  • IR -> Typst generation time
  • Typst compile/export time
  1. Improve timeout UX.
  • clear error message stating which stage exceeded budget
  • deterministic non-zero exit code in CLI
  1. Add tests.
  • unit tests for timeout option validation
  • integration tests for timeout error mapping and exit behavior

Code Areas

  • crates/office2pdf/src/config.rs
  • crates/office2pdf/src/lib.rs
  • crates/office2pdf/src/error.rs
  • crates/office2pdf-cli/src/main.rs

Acceptance Criteria

  • CLI can enforce conversion timeout without external shell wrappers.
  • Timeout failures are distinguishable from parse/render failures.
  • Stage timing is available in logs (debug mode) for profiling.
  • Default behavior remains backward-compatible when timeout is not set.

Non-Goals

  • No XLSX scope in this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions