Skip to content

CI validation (draft): preserve subtitles if atomic temp creation fails - #170

Draft
Blackspirits wants to merge 4 commits into
ci-base-seconv-20261111from
fix/seconv-atomic-write-fallback-20261111
Draft

Blackspirits wants to merge 4 commits into
ci-base-seconv-20261111from
fix/seconv-atomic-write-fallback-20261111

Conversation

@Blackspirits

Copy link
Copy Markdown
Owner

CI-only draft in personal fork — do not merge.

On upstream baseline SubtitleEdit/subtitleedit@5e673e4c6fbbaaa6b851270eaf6338a5c924878b, seconv's AtomicFileWriter.Write would use FileMode.Create directly on the destination when creating a temp file raised IOException or UnauthorizedAccessException, which could truncate a subtitle file on a later write failure.

Change: remove unsafe direct-write fallback. Keep atomic writing when possible, otherwise propagate the original failure without modifying the destination. A narrow internal factory overload enables deterministic I/O failure tests. Regression tests cover both exception classes with an existing file, and failure to create a new output. Existing normal-save, interrupted-save and symlink behavior tests remain.

Trade-off: saving now fails instead of falling back to a non-atomic write when the folder is unwritable but the destination itself is writable; preserving data is the intentional priority.

Validation pending: CI build/tests, independent review. This fork-only PR is only to run checks before upstream consideration; no merge authorization.

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.

1 participant