Skip to content

fix: report failed copies and preserve text on save - #1030

Merged
andiwand merged 2 commits into
mainfrom
review/12-io-failures
Oct 4, 2026
Merged

andiwand merged 2 commits into
mainfrom
review/12-io-failures

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Saving an unedited text file over its source opened the destination before reading the text and could empty it. Read before truncation. Shared stream copies now report failed reads and writes, disk writes check close/flush, and failed temporary copies remove their partial output.

Magic and encoding probes reuse the bounded stream reader, removing two copies of that code and inheriting its error checks. Three focused regressions cover source aliasing, failed temporary-copy cleanup, and stream failures; existing text and ZIP coverage checks callers.

Validation: test build and 62 targeted tests passed. The full repository review continues.

@andiwand
andiwand force-pushed the review/11-global-core branch from b6c13b9 to 2aec3ad Compare October 4, 2026 20:38
Base automatically changed from review/11-global-core to main October 4, 2026 20:40
andiwand and others added 2 commits October 4, 2026 22:40
TemporaryDiskFileFactory::copy is [[nodiscard]], so the bare call in
EXPECT_THROW gives -Wunused-result, which -Werror on CI turns into an
error.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
@andiwand
andiwand force-pushed the review/12-io-failures branch from 8f40d0f to c6b7c04 Compare October 4, 2026 20:44
@andiwand
andiwand merged commit 9941304 into main Oct 4, 2026
23 checks passed
@andiwand
andiwand deleted the review/12-io-failures branch October 4, 2026 20:46
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