After a recent refactor, the draft batch commit service started behaving unstably when file system errors occur. You need to review the diff and find regressions in the lifecycle of temporary resources and in handling the operation result.
commit_batch method takes a list of draft_ids and must:
drafts directory;committed directory;commits counter only after the entire operation completes successfully.before and after versions of src/lib.rs.Storage::persist_committed returns an error.Err, does not increment commits, and does not leave the batch temporary file behind.commits by exactly 1.1.85.0, edition 2021Storage is an abstraction over the file system, and errors must be propagated through Result<String, String>Use line comments to explain the problem, its impact, the fix and how to test it.