Skip to content

fix: fail translation runs on filesystem discovery errors - #553

Open
Gautam Sharma (GautamSharma99) wants to merge 1 commit into
langchain-ai:mainfrom
GautamSharma99:fix/translation-discovery-errors
Open

fix: fail translation runs on filesystem discovery errors#553
Gautam Sharma (GautamSharma99) wants to merge 1 commit into
langchain-ai:mainfrom
GautamSharma99:fix/translation-discovery-errors

Conversation

@GautamSharma99

Copy link
Copy Markdown

Summary

Fixes #543.

Translation discovery previously converted every backend.ls() error into an empty directory. During a language switch this could translate visible pages, skip an unreadable subtree, and let the run persist the target language while leaving the wiki mixed.

Changes

  • Make recursive Markdown discovery throw an actionable error containing the affected virtual path and backend reason for permission, I/O, backend, and transient listing failures.
  • Preserve the intentional repository-mode no-op when the top-level /openwiki root is genuinely absent (ENOENT or a not-found result); all nested missing directories remain failures because their contents are expected to exist after discovery.
  • Because discovery runs before any page translation, a failed listing aborts the middleware before the outer update can claim the requested language completed.
  • Add regression coverage for root permission failures, nested I/O failures, and the existing absent-root no-op behavior.
  • Add a patch changeset.

Why this fixes the data-integrity issue

An incomplete tree is no longer indistinguishable from an empty tree. Translation cannot silently finish with unknown pages, and the failed run does not reach language metadata persistence. A later retry will re-run discovery against the full tree rather than relying on per-page pending markers that could never be created for undiscovered files.

Validation

  • pnpm run lint:check
  • pnpm run typecheck
  • pnpm exec prettier --check (changed files)
  • pnpm test — 67 files, 793 tests passed

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: efd2a08

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openwiki Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

[Bug]: Translation silently treats filesystem listing failures as empty directories

1 participant