Skip to content

fix: preserve output when translation resources cannot be read - #826

Merged
samuelstroschein merged 1 commit into
opral:mainfrom
everton-dgn:fix/translation-resource-read-errors
Oct 19, 2026
Merged

samuelstroschein merged 1 commit into
opral:mainfrom
everton-dgn:fix/translation-resource-read-errors

Conversation

@everton-dgn

Copy link
Copy Markdown
Contributor

Fixes #825.

An unreadable translation resource currently produces a warning only after compilation has replaced the previous output. Check ResourceFileImportError diagnostics before compileProject() and writeOutput(), and reject with an AggregateError that identifies each affected path and filesystem error code.

The existing cleanup path closes the loaded project and permits a later compilation to retry. Missing resources (ENOENT) remain tolerated, other diagnostics retain their warning behavior, and compileProject() remains under its caller's error policy. The diagnostic is matched by name because the SDK does not export its error class.

Validation:

  • The two new regression cases fail against main and pass with the fix. They use the real message-format plugin and cover clean output, incremental output, the original read error, project cleanup, missing-file tolerance and same-process recovery.
  • Native filesystem reproduction with EACCES: the previous version loses the German translation; the fix preserves the previous output and recovers after restoring readability.
  • Independent CLI reproduction with native EISDIR: before the fix, exit 0 and changed output; after the fix, exit 1 and byte-identical output; recovery exits 0.
  • pnpm test --maxWorkers=2 --minWorkers=1: 63 files passed, 996 tests passed, 5 skipped, including typecheck and coverage. An earlier unrestricted run had three timeouts; those cases passed in isolation and in this complete run without changing their timeouts.
  • tsc --build, targeted Oxlint, Prettier and git diff --check passed.

Reject ResourceFileImportError diagnostics before compiling or writing output, with an AggregateError that identifies each path and filesystem error code. Keep the existing cleanup path so the loaded project is closed and a later compilation can retry.

Missing files remain tolerated, other project diagnostics retain their warning behavior, and compileProject remains under its caller's error policy. Match the diagnostic name because the SDK does not export the error class.

Cover clean and incremental output, the original read error, project cleanup and same-process recovery with the real message-format plugin. The two regression cases fail against the base and pass with this change. Native filesystem and CLI checks also confirm that unreadable resources preserve the prior output and return a failure status.

Fixes opral#825.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T01:20:11.386407Z 0836727 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@samuelstroschein
samuelstroschein merged commit 03f4c67 into opral:main Oct 19, 2026
1 check 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.

compile() succeeds and replaces output after translation resource read failures

2 participants