Skip to content

fix: make round-trip exports independent of media mode - #1153

Merged
LeviXIII merged 3 commits into
mainfrom
non-blocking-export-in-stream-only
Sep 8, 2026
Merged

fix: make round-trip exports independent of media mode#1153
LeviXIII merged 3 commits into
mainfrom
non-blocking-export-in-stream-only

Conversation

@TimRl

@TimRl TimRl commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

fix: make round-trip exports independent of media mode

Summary

Round-trip export was disabled in Stream Only mode even when original documents were available locally or could be downloaded from LFS.

Supported exports now work without changing the project's media strategy. Required originals are downloaded only when no usable local copy is available.

Changes

  • Remove the Stream Only restriction and clarify download progress messages.
  • Resolve originals through a shared loader that checks local files, the sync mirror, embedded content, and the Git LFS cache before downloading.
  • Verify downloaded originals against their expected size and SHA-256 hash, and reuse them through a size-limited cache for the duration of the export.
  • Preserve project originals and media settings.
  • Share download retries and cancellation handling with audio export, and propagate cancellation through all round-trip formats.
  • Keep PDF conversion intermediates outside the project and clean them up after success, failure, or cancellation.
  • Count only successful outputs and report individual failures while allowing other files to export.

Test Checklist

  • 104 targeted regression tests passed.
  • Full compilation passed.
  • Production and test TypeScript checks passed.
  • Lint passed for changed files.
  • Verified local and remote DOCX originals across all media strategies.
  • Covered original resolution across supported round-trip formats.
  • Verified local fallbacks, cache reuse, and integrity checks.
  • Verified partial failures and accurate export counts.
  • Verified cancellation and partial-output cleanup.
  • Verified PDF temporary-file cleanup.

Validation limits

LFS network requests and the PDF conversion subprocess are mocked in tests. Real PDF conversion was not exercised because its existing Python script is absent from this checkout.

Round-trip export was disabled in Stream Only even though required
original documents can be fetched from LFS. Allow supported exports
without changing the project's media strategy.

Resolve originals through a shared loader that checks local files,
the sync mirror, embedded content, and the Git LFS cache before
requesting a download. Verify downloaded content and retain it in a
bounded per-export cache without rewriting project originals.

Share cancellable download retries with audio export, propagate
cancellation through round-trip formats, keep PDF intermediates in
operation-scoped temporary storage, and count only successful outputs.
Clarify download progress and report individual failures without
preventing other files from exporting.

Add regression coverage for all round-trip formats, storage modes,
local fallbacks, integrity failures, cancellation, and temporary cleanup.
Validated with 104 targeted tests, compilation, type checks, and lint;
LFS network and PDF subprocess boundaries are mocked in tests.
@TimRl TimRl self-assigned this Aug 31, 2026
LeviXIII and others added 2 commits September 8, 2026 07:53
…n-stream-only

Resolve import conflict in exportHandler.ts: keep the new round-trip
resolver imports from this branch, adopt main's toExportFileName helper,
and drop the legacy original-file/LFS lookup imports this branch replaced.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
On Windows, vscode.Uri.fsPath lower-cases the drive letter while
path.resolve keeps it upper-case, so every read through the stubbed
workspace filesystem missed the in-memory map and all 20 round-trip
export regressions that expect a successful export failed in CI.
Derive the fixture root from Uri.fsPath so both sides agree, and make
the temporary-directory assertion separator-agnostic.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@LeviXIII
LeviXIII merged commit d7e94c4 into main Sep 8, 2026
3 checks passed
@LeviXIII
LeviXIII deleted the non-blocking-export-in-stream-only branch September 8, 2026 13:22
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